-
Notifications
You must be signed in to change notification settings - Fork 22
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
How to convert ITK transform into Elastix transform parameters file? #246
Comments
Applying an old trick from #79 (comment) seems to work, at least from the no-crashing point of view. Is this still the best way to do it? Why doesn't Elastix automatically combine two similarity transforms into one? |
@dzenanz have you tried |
I tried it, but at the time ran into a different issue: #245. |
Looks like that's the following issue: I wasn't sure if it was worth fixing, because apparently it behaved like that for more than five years already. So that's why it's still open. |
With parameter_object.WriteParameterFiles(
elastix_transform_parameters,
["fiducial_transform.txt", "rigid_transform.txt"]) produces both files, but content of
and subsequent run fails with:
|
If you do |
As far as I can tell, it does: temp.zip. |
The initial registration does that (produce those files). |
|
I am using
As I wrote earlier, I am doing this manually now. It would be good if |
@dzenanz Sorry, can you please clarify your use case? Do I understand correctly that you have a similarity transform, created outside of elastix? Do you have it stored in an ITK ".tfm" or ".h5" file already? Elastix supports specifying an external ".tfm" or ".h5" file as "TransformFileName" parameter, in an elastix transform parameter map or a transform parameter txt file: (This support is only implemented for ITK transform files that represent AffineTransform, BSplineTransform, Euler2D, Euler3D, Similarity2D, Similarity3D, TranslationTransform, or a Composite of them.) Does that help you any further? |
The use case is: use landmarks to create an initial transform, then use that to initialize first stage of registration, then result of that to initialize the next stage etc. I explained it a bit here: #245 (comment). I already have a working code, via a workaround of providing the initial transform via It would be good if this workaround was not needed. If fixing that has lousy cost/benefit ratio, than this issue can be closed. |
We need to further investigate how |
Why there are no functions to read/write and convert between both transforms? e.g. something like:
|
I have corresponding fiducial points between a pair of images. I use it to compute similarity transform. What is the best way to pass this as initial transform? See #245 for an attempt.
Setting it via
SetInitialTransform
seems to work (the compound registration does not work correctly in Slicer unless it is "split"), but a later call to:produces:
So I tried:
and it does not write the
fiducial_transform.txt
anywhere on the disk, withrigid_transform.txt
having the following content:Passing
rigid_transform.txt
viaSetInitialTransformParameterFileName
to the next (BSpline) stage of registration produces an error:If I do not provide initial transform to the first registration phase, the whole pipeline works - with imperfect results.
The text was updated successfully, but these errors were encountered: