polyTEM.image.fft.sliding_window_scan¶
- polyTEM.image.fft.sliding_window_scan(image, res: float, window_size: int, fft_size: int, step_size: int, device: str, angles: ndarray, orientation_filter: ndarray, q_vals: ndarray, image_mask, plot_freq: int)¶
Performs sliding psd across the input image. If orientation filter is given, then each local psd window ois converted to intensity vs orientation theta. Else, returns a 4d datacube of fft images.
Built off of Camila’s work. Requires use of GPU
- Parameters:
image – np.ndarray
res – image Angstrom/pixel resolution
window_size – int, image window size
fft_size – int, size of fft to calculate
step_size – step size of sliding window scan
device – ‘cuda:#’ for torch device
angles – np.ndarray with orientation angles to probe
orientation_filter – Gaussian filter that will be rotated to use for orientation analysis
q_vals – np.ndarray of q-values to track intensity (i.e:np.arange(q0,qmax,dq))
image_mask – mask to remove scans from final result if there are known defects in image (such as lacey carbon artifacts)
plot_freq – Frequency of scan result to plot and show
- Returns:
4D np.ndarray containing the fft power spectrum for every (row,col) ii_datacube: 4D pyTorch tensor containing integrated intensity for every (row,col,theta) q_datacube: 4D np.ndarray containign the q_linecut counts for every (row,col,q)
- Return type:
fft_4d_datacube