Skip to content

Estimate Shifts w/ Symmetry - #1397

Draft
j-c-c wants to merge 5 commits into
developfrom
est_shifts_sym
Draft

Estimate Shifts w/ Symmetry#1397
j-c-c wants to merge 5 commits into
developfrom
est_shifts_sym

Conversation

@j-c-c

@j-c-c j-c-c commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

This PR incorporates the multiple common-lines between images of symmetric molecules into the shift estimation algorithm.

Specifically for each pair of images, instead of generating a single shift equation using the common-line induced by the estimated rotations Ri and Rj, we generate a set of shift equations using the multiple common-lines induced by the estimate Ri and the estimates g @ Rj, for each g in the symmetry group associated with the symmetric molecule.

For simulated data (with and without noise) incorporating the symmetry reduced shift estimation error by about 5% on average when using the projected relative error which is used in the matlab code and in the associated publication. This error accounts for a global 3d translational ambiguity that is inherent in the solution.

More dramatically, when we make a direct euclidean distance comparison (ie. not accounting for the global translational ambiguity) between the estimated shifts and the ground truth offsets of the simulation, we get on average a 50% reduction in error. This is because in the case of higher order symmetries (Dn, T, O, I) the global translation ambiguity is constrained away by the additional common-line information. This mean we are getting shift estimates that correspond to a volume whose center is more aligned to the volume which produced the simulated images.

There are 3 main additions in this PR:

  1. Adding the additional shift equations corresponding to the multiple common-lines between images of symmetric molecules
  2. Vectorization of the additional loop needed for (1.)
  3. Unit tests using the legacy metric of projected relative error and additionally a direct pixel comparison after aligning away the error associated with the global translational ambiguity.

There is still some work to do regarding the max memory check that occurs on larger problems.

@j-c-c j-c-c self-assigned this Jul 23, 2026
@j-c-c j-c-c added the enhancement New feature or request label Jul 23, 2026
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.70%. Comparing base (c531848) to head (dc9a73c).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1397      +/-   ##
===========================================
+ Coverage    90.66%   90.70%   +0.04%     
===========================================
  Files          135      135              
  Lines        14921    14987      +66     
===========================================
+ Hits         13528    13594      +66     
  Misses        1393     1393              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant