Closed gdevenyi closed 6 years ago
holy s*** all of our studies have been producing results exactly the opposite of what we reported!
Just kidding maybe try reading documentation ants PDF explains this
On Thu, Sep 20, 2018, 16:27 Gabriel A. Devenyi notifications@github.com wrote:
Hi,
Consider a simple antsRegistration between two images, one with a larger ventricle than the other, otherwise "identical". These images also already are perfectly affinely registered.
I shall choose the image with the smaller ventricle as the "fixed" image, and do a standard antsRegistrationSyN.sh between them, producing a Warp.nii.gz and InverseWarp.nii.gz.
When I use antsApplyTransform to the "smaller ventricle" image, and use the InverseWarp.nii.gz, I get what I expect, the smaller vertricle is warped to match the larger ventricle.
From the perspective of a registration, everything is ok.
Now, I shall compute the jacobian determinant image from the InverseWarp.nii.gz
CreateJacobianDeterminantImage 3 InverseWarp.nii.gz inv_jac.nii.gz 1 0
I would expect, based on what the warp field does to the image, that values within the ventricle for the log jacobian will be > 0. Since the volume of the ventricle increases due to the warp field. The exact opposite is observed, with the Warp.nii.gz producing positive jacobians in the area of interest and the InverseWarp.nii.gz producing negative!
Am I misunderstanding something? Or is this a bug?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ANTsX/ANTs/issues/640, or mute the thread https://github.com/notifications/unsubscribe-auth/AATyfplChyllYeqznto0t0BwptekvFKTks5uc_pOgaJpZM4Wy4Qa .
Specifically fig 7 and 22 @ https://github.com/stnava/ANTsDoc
On Thu, Sep 20, 2018 at 4:34 PM brian avants stnava@gmail.com wrote:
holy s*** all of our studies have been producing results exactly the opposite of what we reported!
Just kidding maybe try reading documentation ants PDF explains this
On Thu, Sep 20, 2018, 16:27 Gabriel A. Devenyi notifications@github.com wrote:
Hi,
Consider a simple antsRegistration between two images, one with a larger ventricle than the other, otherwise "identical". These images also already are perfectly affinely registered.
I shall choose the image with the smaller ventricle as the "fixed" image, and do a standard antsRegistrationSyN.sh between them, producing a Warp.nii.gz and InverseWarp.nii.gz.
When I use antsApplyTransform to the "smaller ventricle" image, and use the InverseWarp.nii.gz, I get what I expect, the smaller vertricle is warped to match the larger ventricle.
From the perspective of a registration, everything is ok.
Now, I shall compute the jacobian determinant image from the InverseWarp.nii.gz
CreateJacobianDeterminantImage 3 InverseWarp.nii.gz inv_jac.nii.gz 1 0
I would expect, based on what the warp field does to the image, that values within the ventricle for the log jacobian will be > 0. Since the volume of the ventricle increases due to the warp field. The exact opposite is observed, with the Warp.nii.gz producing positive jacobians in the area of interest and the InverseWarp.nii.gz producing negative!
Am I misunderstanding something? Or is this a bug?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ANTsX/ANTs/issues/640, or mute the thread https://github.com/notifications/unsubscribe-auth/AATyfplChyllYeqznto0t0BwptekvFKTks5uc_pOgaJpZM4Wy4Qa .
--
brian
Thank you very much @stnava for your polite, comprehensive and detailed response.
For those who may not have understood @stnava's excellent response, I offer some more details.
First, while Figure 7 from doesn't indicate which is the Fixed or Moving in the toy example, we find a small hint regarding warps in the text on the previous page:
Warps/deformations applied to images occur in the opposite direction from warps/deformations applied to points
Along with the annotations in Figure 7:
Warp pulls B into space of A, but is not dense in B InverseWarp pulls A into space of B, but is not dense in A
Implies that transformations and the underlying warp field have differing directionality.
After much searching through the the discussion forums of ANTs on sourceforge I found a longer form response from @ntustison (https://sourceforge.net/p/advants/discussion/840261/thread/9a6e6241/#2249):
Nicola: More on conventions: when you say "The warp field points from the fixed to the moving image", does this mean that the Jacobian determinant of the warp field will be <1 if there is a volume contraction in going from the fixed image to the moving image (i.e. that specific region is atrophic in the moving image)? Or just the opposite?
Nick: The former.
From a conceptual standpoint this is what this means:
While the Warp.nii.gz produced by ANTs when applying with antsApplyTransforms to the moving image will cause a reduction in volume of a region, the internal representations of the warp field as "pulling" mean that if you compute the (log)Jacobian using CreateJacobianDeterminantImage
you will get a positive values in said region.
So, given a registration with A(moving) and B(fixed), local jacobian volume change from A to B will be Jacobian of (ABInverseWarp.nii.gz) and local jacobian volume change from B to A will be Jacobian of (ABWarp.nii.gz).
Thanks @gdevenyi, I will write up a Wiki page.
The naming convention defined forward warps as those used to resample an image from moving to fixed space. But under the hood, these warp a dense grid of points in the fixed space to the moving space, where the values are interpolated.
This is also the reason that antsApplyTransformsToPoints
needs the opposite set of warps to antsApplyTransforms
.
Hi,
Consider a simple antsRegistration between two images, one with a larger ventricle than the other, otherwise "identical". These images also already are perfectly affinely registered.
I shall choose the image with the smaller ventricle as the "fixed" image, and do a standard antsRegistrationSyN.sh between them, producing a Warp.nii.gz and InverseWarp.nii.gz.
When I use antsApplyTransform to the "smaller ventricle" image, and use the InverseWarp.nii.gz, I get what I expect, the smaller vertricle is warped to match the larger ventricle.
From the perspective of a registration, everything is ok.
Now, I shall compute the jacobian determinant image from the InverseWarp.nii.gz
I would expect, based on what the warp field does to the image, that values within the ventricle for the log jacobian will be > 0. Since the volume of the ventricle increases due to the warp field. The exact opposite is observed, with the Warp.nii.gz producing positive jacobians in the area of interest and the InverseWarp.nii.gz producing negative!
Am I misunderstanding something? Or is this a bug?