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

forward and inverse affine transforms are identical #340

Open
rueberger opened this issue Mar 11, 2022 · 5 comments
Open

forward and inverse affine transforms are identical #340

rueberger opened this issue Mar 11, 2022 · 5 comments

Comments

@rueberger
Copy link
Contributor

I've noticed that:

aff = ants.registration(fix, mov, type_of_transform='Affine')

# true
aff['fwdtransforms'][0] == aff['invtransforms'][0] 

Is this intentional? Affine transforms are easy to invert of course but this behavior seems misleading

@stnava
Copy link
Member

stnava commented Mar 11, 2022 via email

@stnava
Copy link
Member

stnava commented Mar 11, 2022 via email

@rueberger
Copy link
Contributor Author

I can't say that I understand this design decision, as it is up to the user to keep track of the forward/inverse transformation files anyway, and makes proper use of apply_transforms more confusing. I realize it would be a breaking change to change this behavior, but it would allow simplification of the default behavior of the whichtoinvert kwarg of apply_transforms

I think it would be a good idea to better document this gotcha.

@ntustison
Copy link
Member

Great. Since you find it confusing, you would probably be in the best position to alleviate that confusion with updated documentation.

@rueberger
Copy link
Contributor Author

another aspect of this behavior that I am confused about is that for SyN registration, the fwdtransform list is ['warp.nii.gz', 'aff.mat'] - which under the described behavior which would result in a default whichtoinvert argument of [False, False]. however, the default whichtoinvert value for an affine transform is [True].

suggesting that the affine matrices returned by the two transform types are inverted relative to each other. do I have that right?

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