I did somewhat succeed to create reconstructions for a virtual aperture using the CircleROI tool. However, the way I did it, I have to swap navigation and signal space using transpose to apply the ROI to the signal (the diffraction pattern). My dataset is loaded into the variable s and has the dimensions (200, 200|144, 144). What I did is the following:
roi = hs.roi.CircleROI(1.165, 1.165, 0.5, 0.35) #DP scaled in cm, center approx. at 1.16 cm.
signal = s.T #Transposing DP to swap navigation and signal spaces. This allows applying a roi to the DP.
signal.plot() #Generate plot for ROI to be displayed.
s_virtual = roi.interactive(signal).T
s_nav = hs.interactive(s_virtual.mean, s_virtual.events.data_changed, axis=s_virtual.axes_manager.signal_axes).
This way, however, I cannot apply the aperture to a selected diffraction pattern (i.e. one of the coordinates of the original navigation space). Is there a way to directly apply a ROI to the signal as it is done in the HyperspyUI?
Thanks again for your help in advance. Best,