Bug #5133
open
Added by Scott Stagg over 7 years ago.
Updated over 7 years ago.
Affected Version:
Appion/Leginon 3.2
Description
We have having an issue where our template-based picks are systematically off center. It is particularly apparent when making a stack as the summary average is off center. Is anyone else having these problems? We are seeing it in multiple different sessions with multiple different users. We're on myami trunk.
Files
Related issues
2 (2 open — 0 closed)
It is probably related to my fix for #4904.
If this is the case then, you should only see problems on micrographs with weird dimensions. True 4k and 8k images would not have a centering problem.
Our images are true 8K images, 8192 x 8192
Hmm, then the image size should not be changed by the script.
Is this happening only from FindEM or other particle pickers (DoG) as well?
Just FindEM. DoG is fine.
I was looking into the same issue, although in our case the images are from a K2. Removing the fix for #4904 solves the problem for us, but is probably not a good long-term solution.
The plot thickens. Here is a line from a template correlator run:
trimming image from 1024x1024 to 1020x1020 for findem
Looks like that script needs an if statement to prevent the trimming.
We've been seeing this issue for ages, always figured it had something to do with FindEM and K2 images.
- Status changed from New to In Code Review
- Assignee set to Anchi Cheng
That was it. I edited the code, and it's working for me know. I'm going to assign this to Anchi, for code review to see what you think about my fix.
For what it is worth, FindEM2 does not seem to have any problems with large prime factors and works fine with our K2 images without any additional cropping.
Sorry to hijack this one more time. A fix for those people with odd image dimensions would be to add a new function to appion/appionlib/apImage/imagefilter.py like:
def frame_cut_border(a, newshape):
mindimx = int(0)
maxdimx = int(newshape[0])
mindimy = int(0)
maxdimy = int(newshape[1])
return a[mindimx:maxdimx, mindimy:maxdimy]
and substitute this in appion/appionlib/apTemplateCorrelator.py at line 183
filtarray = apImage.imagefilter.frame_cut_border(filtarray, newshape)
This will remove some pixels at the bottom right of the image used for the correlation, which will likely not be boxed out in any case, but would preserve the coordinates/centers of the boxed particles from the cropped images.
Can not test it now. Maybe I will do this during Hackathon
No need to test, I just wanted to see what you thought about the code. It's sort of brute force, but I think it's the right way.
- Related to Bug #6530: Particle picks off center with K3 added
- Related to Bug #4904: FindEM produces artifacts when image dimensions have a large prime factor added
Also available in: Atom
PDF