Skip to content

BUG: No longer read rotation center as index (elastix transform < 3.402) #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

N-Dekker
Copy link
Member

@N-Dekker N-Dekker commented Sep 24, 2019

No longer read "CenterOfRotation" from an old transform parameter file, which is the rotation center of the transformation, specified by its index coordinates.

elastix version >= 3.402 no longer specifies the rotation center by its index coordinates.

As explained by Stefan @stefanklein

"Having a center of rotation in index coordinates in the TransformParameter file is bad practice, since its conversion to a world coordinate depends on the knowledge of the size/spacing/origin/directioncosines of the fixed image that was used for registration. That information is stored in the TransformParameter file as well, but it is easy to forget changing the CenterOfRotationIndex when adjusting the (fixed image) resample domain."

Also discussed with Marius @mstaring

Fixes issue #162 ("AffineLogStackTransform: uninitialized local variable 'rdorigin' used")

@N-Dekker N-Dekker force-pushed the AffineLogStackTransform-rdorigin-uninitialized branch 2 times, most recently from 24d3041 to 6ba04e4 Compare September 30, 2019 16:21
@N-Dekker N-Dekker changed the title WIP: Add error messages + abort, to see if code is covered by tests WIP: Remove AffineLogStackTransform<TElastix>::ReadCenterOfRotationIndex Sep 30, 2019
@N-Dekker
Copy link
Member Author

@stefanklein Shall I also remove the ReadCenterOfRotationIndex member functions from elxAdvancedAffineTransform, elxEulerStackTransform, and elxEulerTransform? (It seems that all of them are just for backward compatibility for elastix version < 3.402.)

@mstaring
Copy link
Member

mstaring commented Oct 1, 2019

@stefanklein Shall I also remove the ReadCenterOfRotationIndex member functions from elxAdvancedAffineTransform, elxEulerStackTransform, and elxEulerTransform? (It seems that all of them are just for backward compatibility for elastix version < 3.402.)

I think that is a good idea, since we are moving to a major new version (5.0.0)

@stefanklein
Copy link
Member

The fix looks good, and I agree that we can remove this from other transforms as well. In elxEulerStackTransform the same function was implemented correctly by the way. But anyway, it's better to remove that functionality everywhere.
Quick recap of reason to deprecate/remove that functionality: Having a center of rotation in index coordinates in the TransformParameter file is bad practice, since its conversion to a world coordinate depends on the knowledge of the size/spacing/origin/directioncosines of the fixed image that was used for registration. That information is stored in the TransformParameter file as well, but it is easy to forget changing the CenterOfRotationIndex when adjusting the (fixed image) resample domain.

No longer read "CenterOfRotation" from an old transform parameter file, which is the rotation center of the transformation, specified by its index coordinates.

elastix version >= 3.402 no longer specifies the rotation center by its index coordinates.

As explained by Stefan @stefanklein

"Having a center of rotation in index coordinates in the TransformParameter file is bad practice, since its conversion to a world coordinate depends on the knowledge of the size/spacing/origin/directioncosines of the fixed image that was used for registration. That information is stored in the TransformParameter file as well, but it is easy to forget changing the CenterOfRotationIndex when adjusting the (fixed image) resample domain."

Also discussed with Marius @mstaring

Fixes issue #162 ("AffineLogStackTransform: uninitialized local variable 'rdorigin' used")
@N-Dekker N-Dekker force-pushed the AffineLogStackTransform-rdorigin-uninitialized branch from 6ba04e4 to 47c470f Compare October 1, 2019 15:40
@N-Dekker N-Dekker changed the title WIP: Remove AffineLogStackTransform<TElastix>::ReadCenterOfRotationIndex BUG: No longer read rotation center as index (elastix transform < 3.402) Oct 1, 2019
@N-Dekker N-Dekker marked this pull request as ready for review October 1, 2019 18:09
@N-Dekker
Copy link
Member Author

N-Dekker commented Oct 1, 2019

@stefanklein If you think it's OK, feel free to press the "merge" button 😄

@stefanklein stefanklein merged commit 08e4f54 into develop Oct 2, 2019
@N-Dekker N-Dekker deleted the AffineLogStackTransform-rdorigin-uninitialized branch October 2, 2019 13:26
N-Dekker added a commit that referenced this pull request Mar 14, 2025
elastix version 3.402 deprecated the index-based "CenterOfRotation" in favor of "CenterOfRotationPoint" (which assumes world coordinates).

Following:

- commit 70dd3b8, "ENH: added the possibility to set the CenterOfRotationPoint", Marius Staring, Aug 2, 2006.

- pull request #190 commit 47c470f, "BUG: No longer read rotation center as index (elastix transform < 3.402)", 24 Sep 2019
N-Dekker added a commit that referenced this pull request Mar 14, 2025
elastix version 3.402 deprecated the index-based "CenterOfRotation" in favor of "CenterOfRotationPoint" (which assumes world coordinates).

Following:

- commit 70dd3b8, "ENH: added the possibility to set the CenterOfRotationPoint", Marius Staring, Aug 2, 2006.

- pull request #190 commit 47c470f, "BUG: No longer read rotation center as index (elastix transform < 3.402)", 24 Sep 2019
N-Dekker added a commit that referenced this pull request Apr 1, 2025
elastix version 3.402 deprecated the index-based "CenterOfRotation" in favor of "CenterOfRotationPoint" (which assumes world coordinates).

Following:

- commit 70dd3b8, "ENH: added the possibility to set the CenterOfRotationPoint", Marius Staring, Aug 2, 2006.

- pull request #190 commit 47c470f, "BUG: No longer read rotation center as index (elastix transform < 3.402)", 24 Sep 2019
N-Dekker added a commit that referenced this pull request Apr 2, 2025
elastix version 3.402 deprecated the index-based "CenterOfRotation" in favor of "CenterOfRotationPoint" (which assumes world coordinates).

Following:

- commit 70dd3b8, "ENH: added the possibility to set the CenterOfRotationPoint", Marius Staring, Aug 2, 2006.

- pull request #190 commit 47c470f, "BUG: No longer read rotation center as index (elastix transform < 3.402)", 24 Sep 2019
N-Dekker added a commit that referenced this pull request Apr 3, 2025
elastix version 3.402 deprecated the index-based "CenterOfRotation" in favor of "CenterOfRotationPoint" (which assumes world coordinates).

Following:

- commit 70dd3b8, "ENH: added the possibility to set the CenterOfRotationPoint", Marius Staring, Aug 2, 2006.

- pull request #190 commit 47c470f, "BUG: No longer read rotation center as index (elastix transform < 3.402)", 24 Sep 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants