Bug #5133
openpicks not centered
0%
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
Updated by Neil Voss over 7 years ago
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.
Updated by Scott Stagg over 7 years ago
Our images are true 8K images, 8192 x 8192
Updated by Neil Voss over 7 years ago
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?
Updated by Thomas Klose over 7 years ago
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.
Updated by Scott Stagg over 7 years ago
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.
Updated by Gabriel Lander over 7 years ago
We've been seeing this issue for ages, always figured it had something to do with FindEM and K2 images.
Updated by Scott Stagg over 7 years ago
- 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.
Updated by Thomas Klose over 7 years ago
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.
Updated by Thomas Klose over 7 years ago
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.
Updated by Anchi Cheng over 7 years ago
Can not test it now. Maybe I will do this during Hackathon
Updated by Scott Stagg over 7 years ago
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.
Updated by Neil Voss almost 6 years ago
- Related to Bug #6530: Particle picks off center with K3 added
Updated by Neil Voss almost 6 years ago
- Related to Bug #4904: FindEM produces artifacts when image dimensions have a large prime factor added