Preserve IMOD final tilt angles in YTilt#1343
Conversation
IMOD's final OutputTiltFile already includes any AngleOffset estimated by tiltalign. Subtracting that offset again stores nominal stage angles in rlnTomoYTilt, while the aligned stack and IMOD reconstruction use the final corrected angles. Keep the final .tlt angles in rlnTomoYTilt so RELION projection matrices match the IMOD geometry. This also keeps native tomogram reconstruction's default CTF scale consistent: relion_tomo_reconstruct_tomogram initialises rlnCtfScalefactor as cos(rlnTomoYTilt) when the column is absent. Do not rewrite pre-existing rlnCtfScalefactor values here: RELION CTF refinement can use that column for signal/ice-thickness scale, so overwriting it during alignment would be unsafe.
0e61999 to
5be7821
Compare
|
Closing this PR. After deeper investigation in my fork, I could see you might had designer choice and might need to be sure this convention change would be safe, couldn't find why Relion choose different convention
Will submit a focused PR for the Thanks for the review patience. |
Summary
.tltangles in_rlnTomoYTiltinstead of subtractingAngleOffset.tltis IMOD's final OutputTiltFile used for reconstruction geometryRationale
When IMOD
tiltalignestimatesAngleOffset, the final.tltfile already includes that offset and IMODtiltreconstructs from those corrected angles. SubtractingAngleOffsetwhile writing_rlnTomoYTiltreverts the STAR metadata to nominal stage tilts, making RELION projection matrices inconsistent with the IMOD reconstruction geometry. This matches the symptom reported in #1141.CTF / downstream extraction
This PR intentionally does not rewrite existing
_rlnCtfScalefactorvalues during alignment. RELION native tomogram reconstruction already initializes_rlnCtfScalefactor = cos(_rlnTomoYTilt)when the column is absent, so preserving the final IMOD angles keeps the default CTF scale consistent with the projection geometry.If
_rlnCtfScalefactoris already present, it may have been written by RELION CTF refinement as a signal/ice-thickness scale. Overwriting it at alignment-import time would be unsafe.Tests
git diff --checkpython -m py_compile src/tomography_python_programs/align_tilt_series/imod/_utils.py