ANTsX / ANTs

Advanced Normalization Tools (ANTs)
Apache License 2.0
1.21k stars 381 forks source link

AntsLongitudinalCorticalThickness and Atlas application #1428

Closed Nazuna23 closed 1 year ago

Nazuna23 commented 2 years ago

Dear community,

I have a question on the application of antsLongitudinalCorticalThickness.sh and the usage of atlases (in this case the Hammersmith segmentation atlas containing 95 regions, also implemented in cat12 (https://brain-development.org/brain-atlases/adult-brain-atlases/)). I would like to extract cortical thickness results from the Hammersmith atlas for one subject at time point 1 and time point 2. This is how my call looks like:

A=/Users/(…)B1668/B1668_T1w.nii.gz
B=/Users/(…)/B1826/B1826_T1w.nii.gz
TEMPLATE_DIR=/Users/(…)/MICCAI2012-Multi-Atlas-Challenge-Data
antsLongitudinalCorticalThickness.sh -d 3 \
  -e ${TEMPLATE_DIR}/T_template0.nii.gz \
  -m ${TEMPLATE_DIR}/T_template0_BrainCerebellumProbabilityMask.nii.gz \
  -f ${TEMPLATE_DIR}/T_template0_BrainCerebellumExtractionMask.nii.gz \
  -p ${TEMPLATE_DIR}/Priors2fixedforantslongitudinal/priors%02d.nii.gz \
  -q 0 \
  -t ${TEMPLATE_DIR}/T_template0_BrainCerebellum.nii.gz \
  -a /Users/(…)/Template_T1_masked.nii \
  -l /Users/(…)/rhammers.nii \
  -o /Users/(…)/LongitudinalAntsCorticalThickness/B1668_B1826 \
  ${A} ${B}

The script runs the first steps, however, throws an error at the jointslabelfusion step (inside antsJointLabelFusion.sh):

--------------------------------------------------------------------------------------
 Starting JLF
--------------------------------------------------------------------------------------
/Users/(…)/B1668_B1826SingleSubjectTemplate//T_templateTemplate_T1_masked_0_Warped.nii.gz
Error:  At least 2 warped image/label pairs needs to exist for jointFusion.

Since the error occurs inside antsJointLabelFusion.sh, I directly tried to get antsJointLabelFusion.sh running on its own with the above Hammersmith atlas. Since only the labels are provided, I followed the MalfLabelingExample, and mapped the hammers labels from the MNI template to the _Ttemplate0.nii.gz (see also screenshot). However, I still get the same error message as above when running antsJointLabelFusion.sh on its own.

The underlying problem is therefore, that the call to antsJointLabelFusion.sh fails, as no multi-label fusion seems to be required on the higher level of the task.

Does anyone have an advice for this on what I am missing? Help would be greatly appreciated.

Thank you very much in advance!

Bildschirmfoto 2022-10-10 um 19 16 53
ntustison commented 2 years ago

The underlying joint label fusion process requires more than 1 atlas and the specific task is for 6-tissue labeling (CSF, GM, WM, Deep GM, brain stem and cerebellum). Here are the ones that we use

https://drive.google.com/drive/u/0/folders/0B4SvObeEfaRyZGhlUlJOcmItTVU?resourcekey=0-3KkgfFgixEpaxCLN7g6J3w

See

training_labels/*6labels.nii.gz

Nazuna23 commented 2 years ago

Dear Nick, Dear community,

Thank you very much for your quick reply, the link is already very helpful.

Is there any possibility to also integrate the Hammersmith atlas in my case in the antslongitudinalcorticalthickness pipeline? I would like to extract regional volumetric and cortical thickness data from this Hammers atlas for the subject at timepoint 1 and timepoint 2. Are the argument pairs -a and -l /-g and -l intended to add only one label per argument pair?

Any suggestions on how to proceed would be very helpful.

Thank you very much in advance!

ntustison commented 2 years ago

All the options for the script are meant strictly for producing the cortical thickness images. The issue of how one parcellates those thickness images, e.g., Hammersmith Atlas, is completely outside the script.

Have you run the simpler antsCorticalThickness.sh script on a single image? If not, I would recommend running that as it would be an easier on-ramp to using the longitudinal version.

Nazuna23 commented 2 years ago

 Dear Nick, dear community,   Thank you very much for your reply. I now ran the antsLongitudinalCorticalThickness.sh script without the -a and -l option. The script ran through without any problems and the results look good.   For the extraction of the regional CT and volumetric data based on the atlas (e.g. Hammersmith), would the right procedure therefore be to apply the xx_T1wGroupTemplateToSubjectWarp.nii.gz to transform the atlas from template space into the space of each subject at each timepoint via antsApplyTransforms? I noticed that there is no affine.mat-file for the subject to grouptemplate-transformation, is that right to use the warp-file only?   Thank you again.

ntustison commented 2 years ago

Yes, try that.