ComputationalCryoEM / ASPIRE-Python

Algorithms for Single Particle Reconstruction
http://spr.math.princeton.edu
GNU General Public License v3.0
45 stars 21 forks source link

Relion/ASPIRE projection image offsets #1146

Open j-c-c opened 6 days ago

j-c-c commented 6 days ago

A user has reported that when attempting to center images of a RelionSource that it is necessary to flip the x and y offsets, ie. ims_centered = ims.shift(-src.offsets[:,[1,0]])

I have confirmed that this is indeed the case by generating sets of shifted and unshifted Relion projections (both even and odd resolutions), creating corresponding RelionSources, and comparing the unshifted src to the centered (via the above method) shifted src.

This issue has been discussed in our dev meeting, but I wanted to keep some notes here to track the issue:

1) Offsets in Relion shift the particle in the opposite direction of the shift value. For example, the offset [x-off, y-off] = [6, 10] will shift the particle 6 pixels in the negative x-direction (ie. left) and 10 pixels in the negative y-direction (ie. up). You can see this in the image below of the RelionSource instantiated with Relion generated projections with offsets. Screenshot 2024-06-27 at 11 47 36 AM

2) Generating projection images using the same volume and same set of offsets in a Simulation produces images where the offset [6, 10] shifts the particle 6 pixels in the negative y-direction (ie. up) and 10 pixels in the negative x-direction (ie. left): Screenshot 2024-06-27 at 11 57 08 AM

3) There is also a difference in conventions concerning the center of images. In Relion the center of an image is ((int)(xdim/2), (int)(ydim/2)). In other words for both resolutions 64 and 65 the center will be (32, 32). In ASPIRE the image center is (33, 33) for resolution 65 and (32, 32) for resolution 64.

Some work has already been done towards resolving this issue, but I will update here with additional progress.