Matlab CTF - #1315
Conversation
|
Removed the transpose mentioned above. Left the prior remark as strikethrough. At a0769 achieving ~0.02% between the MATLAB and Python phase_flip application for full resolution (360x360) 10028. I suspect a chunk of that diff is actually something like a pixel_size rounding as I don't expect the FFT implementations would be off that much between numpy as matlab. |
|
The changes in this branch matches (diff 0 at single precision) MATLAB workflow's phase_flip for the first ten 10028 images at full 360 pixels. I am comparing for the entire stack and will report back. Planning to discuss how we want to formally incorporate the changes. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1315 +/- ##
========================================
Coverage 90.60% 90.60%
========================================
Files 133 133
Lines 14394 14394
========================================
Hits 13042 13042
Misses 1352 1352 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
For the entire EMPIAR 10028 star file, the max abs error across all values wrt MATLAB phase_flip implementation came to |
|
I think I've managed to adopt the MATLAB CTFFilter using our I had tried moving from passing |
j-c-c
left a comment
There was a problem hiding this comment.
Looks good! Just have one question.
removes redundant tranposes
|
Okay, found one small dtype regression in final testing. For an example of how sensitive these codes are to singles vs doubles... Simply computing grid_2d associated arctan and sqrts in singles vs doubles takes the reference correspondence from a max abs diff of 2.3841858e-07 to 0.06. Yikes. Going from unshifted signal code (discuessed in the PR) to shifted (centered wrapper) is just a tad slower, but maintained single precision, so I went ahead and changed that as well in case it matters for some other code I'm not aware of. I will merge this once the tests pass and move onto a combined preprocessing workflow example to send to Yoel for his blessing. |
Relates to #1309
This python class will
allclosereproduce MATLABcryo_CTF_Relionfilter valuesup to a transpose. Can flip the transpose with theindexinggrid param, but my guess is we will want this ordering for the convolution application to the FT of our C order image data... TBD.In the process of porting I noticed that our (radial) grids appears to be off by a factor of exactly 2. This is likely the scaling factor I saw comparing them before.
It may be possible to reconcile our
CTFFilter, but for the time being we will at least have this one.I will try to integrate with phase_flip etc next so I can compare the application of the filter.