Closed dbrennan44 closed 3 years ago
The priors need to be pre-aligned to the target image.
Okay, thanks. I need the GM/WM probability maps in subject-space, so:
it doesn't appear antsBrainExtraction needs pre-aligned priors. Is there a way to utilize a transformation matrix from this step to not have to co-register again? Another better way of approaching this?
Thanks in advance.
Yes, you can use the same transformation files obviously as long as they correspond to the same template/subject you're using for brain extraction and tissue segmentation.
There is another way of doing this---use antsCorticalThickness.sh
specifically using the -y
option to designate which stages
you want to run.
Another possibility is experimental (I just finished the first draft of the paper) but it works well in my experience. You can do the same thing using our deep learning libraries ANTsRNet or ANTsPyNet and it's obviously much faster. Everything is done for you including building the network architecture and downloading/installing the weights.
excellent, this is really helpful. I think I will try antsCorticalThickness.sh since that seems well encapsulated.
just for my own interest, is the deep learning approach just an approximation of the current registration/segmentation algorithms, or something new altogether?
Thanks again, looking forward to reading the paper
Just a deep learning analog to what we already have---simply to see what kind of improvement gains we could see in terms of accuracy and speed.
a weird quirk, but not tragic of course, is that the stages must be fed in reverse to antsCorticalThickness.sh ; e.g.:
antsCorticalThickness.sh -d 3 -a ${sub_dir}/STRUC/000?_t1_mpr_AX_MPRAGE.nii \ -e ${pdir}/T_template0.nii.gz \ -m ${pdir}/T_template0_BrainCerebellumProbabilityMask.nii.gz \ -y 3 \ -y 2 \ -y 1 \ -z 1 \ -x skullstrip_BrainExtractionMask.nii.gz \ -p ${pdir}/Priors2/priors%d.nii.gz \ -c 3 -w 0.25 -o ${sub_dir}/STRUC/output
I see, I didn't realize we had to loop over steps. Thanks!
The priors need to be pre-aligned to the target image.
hello,i also have met the same problem,which was“ Inputs do not occupy the same physical space! ”.
i have a question that how to do "The priors need to be pre-aligned to the target image" , to use antsRegistrationSyn.sh ?
is this antsRegistrationSyNQuick.sh -d 3 -f template.nii.gz -m prior.nii.gz -n 8 -t s -o prior_warp_
?
When using ANTs for registration, relying solely on the gray matter probability map usually does not result in good registration. Issues such as the misidentification of white matter and gray matter may occur.
and other question , Is it necessary to have prior1-4, including the fourth deep cortical probability map, for antsCorticalThickness.sh? I am working with animal MRI images and do not have the fourth deep cortical probability map.
Thanks in advance
is this antsRegistrationSyNQuick.sh -d 3 -f template.nii.gz -m prior.nii.gz -n 8 -t s -o priorwarp ?
Your priors should be aligned to template.nii.gz already. If you want to segment a target t1w.nii.gz, then
antsRegistrationSyNQuick.sh -d 3 -f template.nii.gz -m t1w.nii.gz -n 8 -t s -o t1w_to_template_
for i in 1 2 3 4; do
antsApplyTransforms -d 3 -i prior${i}.nii.gz -t [ t1w_to_template_0GenericAffine.mat, 1 ] -t t1w_to_template_1InverseWarp.nii.gz -r t1w.nii.gz -o t1w_prior${i}.nii.gz` ]
done
Is it necessary to have prior1-4, including the fourth deep cortical probability map, for antsCorticalThickness.sh? I am working with animal MRI images and do not have the fourth deep cortical probability map.
Yes, it is required for that script. However, if you do a 3-class segmentation, you can call the thickness program KellyKapowski
directly without the fourth class.
is this antsRegistrationSyNQuick.sh -d 3 -f template.nii.gz -m prior.nii.gz -n 8 -t s -o priorwarp ?
Your priors should be aligned to template.nii.gz already. If you want to segment a target t1w.nii.gz, then
antsRegistrationSyNQuick.sh -d 3 -f template.nii.gz -m t1w.nii.gz -n 8 -t s -o t1w_to_template_ for i in 1 2 3 4; do antsApplyTransforms -d 3 -i prior${i}.nii.gz -t [ t1w_to_template_0GenericAffine.mat, 1 ] -t t1w_to_template_1InverseWarp.nii.gz -r t1w.nii.gz -o t1w_prior${i}.nii.gz` ] done
Is it necessary to have prior1-4, including the fourth deep cortical probability map, for antsCorticalThickness.sh? I am working with animal MRI images and do not have the fourth deep cortical probability map.
Yes, it is required for that script. However, if you do a 3-class segmentation, you can call the thickness program
KellyKapowski
directly without the fourth class. thank you ,i get this code and method ,and i will try to do it
Thanks in advance
Describe the problem ITK failure on antsAtroposN4.sh:
Description: itk::ERROR: N4BiasFieldCorrectionImageFilter(0x2df2770): Inputs do not occupy the same physical space! InputImage Origin: [1.0000000e+00, 2.9250000e+02, -1.0000000e+00], InputImageMaskImage Origin: [9.1966103e+01, 8.0550140e+01, -5.7974781e+01]
Command run:
antsAtroposN4.sh
-d 3 -a 0007_t1_mpr_AX_MPRAGE.nii -x skullstrip_BrainExtractionMask.nii.gz -p ../../../MICCAI2012-Multi-Atlas-Challenge-Data/Priors2/priors%d.nii.gz -c 3 -y 2 -y 3 -w 0.25 -o /data/dbrennan/raw/c001_s1/STRUC/output_test`where "skullstrip...Mask.nii.gz" was created with antsBrainExtraction.sh, and did not have an issue with physical space.
I've just rebuilt ANTs from scratch so latest ITK etc shouldn't be an issue.
Does antsAtroposN4.sh need co-registered images?