Skip to content
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

Applying series of registrations to moving image label map #277

Closed
tenres opened this issue Apr 2, 2024 · 4 comments
Closed

Applying series of registrations to moving image label map #277

tenres opened this issue Apr 2, 2024 · 4 comments

Comments

@tenres
Copy link

tenres commented Apr 2, 2024

Hello, this is more of a question than a problem. I chained 3 registrations in series (affine, BSpline1, Bspline2) by initializing each registration with the transform obtained from the previous one (i.e., setting the "InitialTransformParameterFileName" of the current registration to the previous registration output parameter file). The registrations completed successfully and the result looks good. I then transform a label map (segmentation) from the moving image through the 3 registrations into the fixed image space using transformix. Few questions here:

  1. For transforming the moving image label (segmentation), I set the transformix SetTransformParameterObject to only the final BSpline2 output parameter file and update. Just wanted to confirm this is the correct way and it is not required to read the other transforms (affine and Bspline1) and perform the 3 transformations explicitly. The Bspline2 parameter already has the path to BSpline1 parameter file in its InitialTransformParameterFileName, which in turn has the path to the affine parameter file in its InitialTransformParameterFileName and transformix will account for this.
  2. Doing it the above way (set the transformix SetTransformParameterObject to only the final BSpline2 output parameter file and update), is it correct assume that the resampling happens only at the end after transformix applies the chained transformations affine, Bspline1 and Bspline2? Or does it happen after each of the 3 transforms?
  3. I also set the "ResampleInterpolator" to "FinalNearestNeighborInterpolator" since I am transforming a binary segmentation label map. This I do only for the last transform Bspline2, assuming the interpolation happens only at the end. But does it have to be set for all the 3 transforms?
    Thanks!
@dzenanz
Copy link
Member

dzenanz commented Apr 2, 2024

Everything sounds right to me. @N-Dekker or @ViktorvdValk might also pitch in.

@tenres
Copy link
Author

tenres commented Apr 3, 2024

Thanks for confirming @dzenanz. @N-Dekker, @ViktorvdValk, just checking in if you have other comments. Thanks!

@N-Dekker
Copy link
Collaborator

N-Dekker commented Apr 3, 2024

Your approach sounds right to me as well. Indeed, it is sufficient to just specify the final transform parameter file to transformix (Bspline2, in your case), it will then find the previous two transforms (affine, BSpline1) by "InitialTransformParameterFileName".

"ResampleInterpolator" only needs to be set in the final transform parameter file (BSpline2). The resampling only happens at the end.

Hope that helps!

@tenres tenres closed this as completed May 8, 2024
@tenres
Copy link
Author

tenres commented May 8, 2024

Thanks for the confirmation. Closing this issue.

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

No branches or pull requests

3 participants