-
Notifications
You must be signed in to change notification settings - Fork 4
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
1D line extraction from 2D images #10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome - really clean (but I would say that... it mirrors my own implementation 😆)
few minor notes but happy for this to be merged when you're ready
re: the 90 degree rotation I can't see anything obvious - the difference I would expect between conventions/implementations would be an inversion of rotation angle rather than a 90 degree shift, is this actually what is happening? does a zero degree projection produce an image projected along y as expected? what about 90 and x?
src/torch_fourier_slice/slice_extraction/_extract_central_slices_rfft_2d.py
Outdated
Show resolved
Hide resolved
I don't mind about the bugfix |
slice insertion can wait/come in a separate PR - no need to overload this one |
Haha, I was about to say, its mostly your implementation :p which is indeed clean!
I updated those things!
Double checked the projection at 0 and 90, and at 0 it is projected along the y-axis and at 90 along the x-axis. So that makes sense. For the reconstruction, the tilt-axis is aligned with the y-axis, so to find the common line the projection from 2d to 1d needs to happen along the x-axis, i.e. the 90 addition makes sense. (the common line is perpendicular to the tilt axis) The real-space 2d to 1d projection I wrote before in tttsa was also projecting along the x-axis after the affine transform: https://github.com/teamtomo/tttsa/blob/ecaa1bc0a92d0f17cc80c51734ebe46e045ed860/src/tttsa/projection/project_real.py#L52 So in conclusion, it is correct like this. And, I need to add 90 degrees to project along the x-axis! |
For my part ready to merge, but please let me know if you have other things that should be fixed. |
Glad you got to the bottom of the 90 degree offset - it makes sense and everything matches expectations here Awesome work as always! |
I worked on the 2D to 1D Fourier slice extraction, which is functional (I tried it for tttsa, see teamtomo/tttsa#19).
One thing that I haven't figured out is a 90 degrees addition to the in plane rotations for the rotation matrices for this function, compared to the affine transform I used before (link to the line of code). One of the two is interpreting it wrongly.
The dft_center also needed a fix to run on GPU, I can also put that in a separate PR if you are not sure yet about this one and want that bug fix in.
I have not added the inverse operation of 1D to 2D slice insertion. Should that be added here as well?