Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transformation order in ANTSpy

See original GitHub issue

This might be related to the issue I raised but I am still having issue getting my head around how the transformation concatenations and orderings are handled in ANTSpy.

So, if I perform a registration in ANTS (the usual SyN), I get the following list as my forward transformations an example:

'/tmp/tmpdddnbjk41Warp.nii.gz', '/tmp/tmpdddnbjk40GenericAffine.mat']

So the first entry is the non linear deformation field and the second one is the initial affine map.

Now, I can use apply_transforms to apply the map. However, what I know about antsApplyTransform, the transforms are applied in the order in which they are encountered on the command line and I think ANTSpy passes them on by simply going through the list.

My question is would this not result in the non linear warp being applied before the affine?

Also, on a related note if I combone two transformation list as:

final = t1 + t2

and use this in apply_transforms would the resulting transformation be t2(t1(x)) where x are the spatial coordinates i.e. t1 first and then t2?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

stnavacommented, Mar 29, 2020

there will be discussions of this in various places here and in the papers as well as in ants*pdf documentation.

the core reasons are mathematical, statistical and practical :

  • mathematical: we use Diff_0 which requires fixed boundary conditions. as such, images are mapped to the fixed space by an affine transformation. within the fixed domain, we compute the diffemorphism, member of Diff_0.

  • statistical: we want the tail of the deformation fields to be in common (template) space to allow group comparisons

  • practical: transformations are only dense under pull back not push forward

stnavacommented, Mar 29, 2020

edit: 3rd reason

Read more comments on GitHub >

github_iconTop Results From Across the Web

Registration — ANTsPy master documentation
Assumes images are aligned by an inital transformation. Can be useful if you want to run an unmasked affine followed by masked deformable...
Read more >
ANTsPy - Read the Docs
transformlist (list of strings) – list of transforms generated by ants.registration where each transform is a filename. • interpolator (string) ...
Read more >
Advanced Normalization Tools (ANTS) -
The numbers of the transformations (here, 0 and 1 because there is only a deformation and affine mapping) relate to the order in...
Read more >
Points vs pixel in ANTs - SourceForge
I use ANTsPY to find the transform between a fixed and a moving image. ... in order to find the corresponding points in...
Read more >
Apply transforms to images. — antsApplyTransforms ...
Apply a transform list to map an image from one domain to another. ... The order matters strongly and the user is advised...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found