Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4D output should crop center #2

Closed
apryor6 opened this issue Oct 31, 2017 · 8 comments
Closed

4D output should crop center #2

apryor6 opened this issue Oct 31, 2017 · 8 comments

Comments

@apryor6
Copy link
Collaborator

apryor6 commented Oct 31, 2017

The current 4D output results in many 2D images, each of which includes the anti-aliasing aperture. The result is that much of the array is wasted space (zeros). Only the central region should be returned.

@matkraj
Copy link

matkraj commented Nov 1, 2017

4D output also has swapped quadrants

@matkraj
Copy link

matkraj commented Nov 23, 2017

I am not 100% sure how to do this, but here is a suggestion for change to crop and swap quadrants for 4D STEM - I am not sure this is not breaking any other data saves
matkraj@d7c0a98#diff-d87e66171dfb2a89f41ff2713110710f

@apryor6
Copy link
Collaborator Author

apryor6 commented Nov 23, 2017

The quadrant swapping functionality is already in Prismatic in the function fftshift2 within include/utility.h. Also, the Prismatic array class has a to_mrc method to write out the data, so all you should need to do is create a new Prismatic array, fftshift the large one, and then copy the center into the smaller array before writing

@matkraj
Copy link

matkraj commented Nov 23, 2017

my code was changing toMRC_f method for this. Thanks for fftshift2 suggestion

@cophus
Copy link
Collaborator

cophus commented Dec 5, 2017

I prefer the default FFT quadrant positions because the origin pixel is always at (0,0). I agree though that at some point we should definitely change the 4D output to only save the portions inside the anti aliasing aperture.

@apryor6
Copy link
Collaborator Author

apryor6 commented Dec 5, 2017

I think the solution would be to have only inside the anti aliasing aperture saved always, and then to add an additional option that will shift the quadrants if the user desires

@thomasaarholt
Copy link
Contributor

Anyone opening these files in python can achieve the shift with np.fft.fftshift(pr.fileio.readMRC(filename)[0]). The [0] is required because the readMRC function assumes that the mrc file can be a stack, I assume, and the file only contains a single image.

apryor6 pushed a commit that referenced this issue Jul 1, 2019
@lerandc lerandc closed this as completed Jul 3, 2019
@lerandc
Copy link
Collaborator

lerandc commented Jul 3, 2019

Outputs are now cropped and fftshifted by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants