ANTsX / ANTs

Advanced Normalization Tools (ANTs)
Apache License 2.0
1.19k stars 380 forks source link

Suggestions for accommodating larger deformations during atlas building #1621

Open muratmaga opened 11 months ago

muratmaga commented 11 months ago

We are trying to build an template from ~35 mid-gestation mouse fetuses. modality is microCT (with iodine contrast). Some fetuses at this stage may have a torsion of the head with respect to the axis of body (see the screenshot), or have tilt of the head with respect to the body.

image

This results in less than ideal registration as seen by samples in atlas space.

image

This results in a lot of ghosts in the atlas (middle image)

I appreciate if anyone can suggests improving the registration. Eventually (i.e., during the actual statistical analysis) we will have the same problems registering individual samples to the atlas we derived, since this is a naturally occurring variation (the angle of the head tilt changes with the gestational maturity of the fetus. Earlier ones are more tucked in towards the body , and later have a wider angle. Unfortunately this is not a factor we can experimentally control. There is always about +/- 12h uncertainty in litters).

This is the call to the aMTC2.sh

antsMultivariateTemplateConstruction2.sh -d 3 -i 2 -c 1  -n 0 -k 1 -f 6x4x2x1 -s 4x2x1x0vox -q 300x100x70x20 -p "export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=48"  -t SyN -m CC -z /home/maga/TxImgs18um/ref/average.nii  -o test *.nrrd
gdevenyi commented 11 months ago

We had exactly this issue with MRI of exvivo neonatal mice.

In the end we had to manually pre-register the most deformed subjects with thin plate splines and control points before we could successfully get convergence without any misaligned subjects. We also had to mask away the tail because trying to align it results to it detrementally impacting body registration.

You may also try https://github.com/CoBrALab/optimized_antsMultivariateTemplateConstruction which defaults to a more extensive image pyramid for registration which may computationally solve your issue, depending on how bad the initial alignment problems are.

muratmaga commented 11 months ago

@gdevenyi thank you. Glad to hear that we are not alone :) It is hard to work with small, squishy things.

So if I understood you correctly, you manually deformed each sample using landmarks and TPS, and used that warped image in atlas building? Does that also mean for jacobian or other statistical analyses you also do the same for all the samples?

gdevenyi commented 11 months ago

So if I understood you correctly, you manually deformed each sample using landmarks and TPS, and used that warped image in atlas building?

Correct

Does that also mean for jacobian or other statistical analyses you also do the same for all the samples?

Not all samples needed it, so it was not done to all of them.

A few options here that we examined:

  1. Compute the jacobians from the TPS transform and add that into the subject values after the fact
  2. Ignore the deformations, as they were large bulk shape changes and our areas of interest were internal tissues and brain which were not appreciably affected by the TPS

After examining the Jacobians from 1 we decided to ignore them, as we typically focus on local-deformations where we also discard the affine Jacobian and any residual affine volume change arising from bulk deformations.