-
-
Notifications
You must be signed in to change notification settings - Fork 389
Regarding the Issue of Jacobian and CorticalThickness Generation #1883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm working on Jacobians right now. There may be bugs. I would recommend following antsCorticalThickness and using the "geometric" option |
For the antsCorticalThickness.sh script, which option should I select? I might have missed the geometric option you mentioned. |
The last flag
|
ok, i have received . |
Is it confirmed that a bug actually exists? |
I'm trying to confirm, can discuss more in #1884 |
I recalculated the total voxels of |
If you want to know the total volume change (linear + nonlinear), then yes you need both transforms. It may be more accurate to record the linear volume change separately, and multiply it by the volume change from the deformation field. antsTransformInfo will now output the determinant of an affine transform. It's just printed to the screen, not the most helpful but good for proof of concept |
I may have partially understood your point – it seems parameters related to linear positional transformations are indeed required. I also attempted to inspect the matrix of |
Your code looks good. The caveat is that you are collapsing both the affine and the warp field into a single field, so it may be less precise. The affine transform is global and continuous, while the warp fields are discretely sampled fairly coarsely (ie, at the resolution of your data). So the Jacobian calculation, based on derivatives around these discrete sample points, may be less precise. I haven't quantified this, so maybe it's a negligible difference, particularly if your scaling is small. For longitudinal studies, it's probably small. In the other approach, you would do
This would give you a determinant d_aff
This would give you d_def, and you would multiply this by d_aff. If ${sub2sst_affine} is purely rigid, then its determinant should be 1, and the composite should be very similar to ${sub2sst_warp} alone. |
I tried this out on a T1w brain registered to MNI space, and there is very little difference - the determinant from the composed warp is almost identical to that from the affine + warp considered separately. Always good to verify independently in your own data, but I'm optimistic that you will be fine to use the composed warp. |
Thank you very much for your response, I am verifying it using my own understanding #the affine + warp considered separately
I believe that (the affine + warp considered separately) and (composed warp) might yield identical results. |
antsTransformInfo has the determinant in its output. |
Operating system and version
ubuntu20
CPU architecture
x86_64 (PC, Intel Mac, other Intel/AMD)
ANTs code version
ANTs-2.4.4
ANTs installation type
Compiled from source
Summary of the problem
I need to generate a modulated tissue segmentation map using a method that involves transforming a standard space tissue segmentation map and multiplying it by a Jacobian image, which is generated through warp transformation. In theory, the total voxel count (i.e., volume) of the modulated image after extraction should match the total voxel count in the individual space. However, I observed discrepancies in the statistical results.
I noticed that in
antsApplyTransforms -d 3 -o [${result_dir}/sub2sst_composite.nii.gz,1],
this option suggests that not only should the warp file be applied, but the linear displacement (i.e., _0GenericAffine.mat) should also be included. Following this approach, I combined the transformations into a single file, recalculated the Jacobian, and found that the voxel counts of the modulated standard space image and the individual space image were nearly identical, with minimal differences.
Question1: Is this method correct?
Question2: about CorticalThickness .
During the analysis of cortical thickness maps, certain gyral regions appear artificially merged due to algorithmic miscalculations, resulting in localized thickness overestimations. Could you recommend potential solutions for this topological inaccuracy in sulcal-gyral differentiation?
best wishes
For instance, the region indicated in this figure exhibits...

Commands to reproduce the problem.
antsApplyTransforms-d 3 -o [${result_dir}/sub2sst_composite.nii.gz,1] -r ${sst_template} -t ${sub2sst_warp} -t ${sub2sst_affine}
CreateJacobianDeterminantImage 3 ${result_dir}/sub2sst_composite.nii.gz ${result_dir}/${output_name}_sub2sst_jacobian.nii.gz 0 0
interpolation=Linear
antsApplyTransforms-d 3 -i ${sub_gm} -o ${result_dir}/${output_name}_gm2sst.nii.gz -r ${sst_template} -n $interpolation -t ${sub2sst_warp} -t ${sub2sst_affine}
fslmaths ${result_dir}/${output_name}_gm2sst.nii.gz -mul ${result_dir}/${output_name}_sub2sst_jacobian.nii.gz ${result_dir}/m${output_name}_gm2sst.nii.gz
antsAtroposN4.sh -d 3 -a ${brain} -x ${brain_mask} -p ${result_dir}/${output_name}_tpm_%d.nii.gz -c 3 -y 2 -y 3 -w 0.25 -o ${result_dir}/${output_name}_
I will proceed with subcortical tissue removal
KellyKapowski -d 3 \ -s [ ${result_dir}/${output_name}_Segmentation_nosub.nii.gz,2,3 ] \ --verbose 1 \ -g ${result_dir}/${output_name}_SegmentationPosteriors2_nosub.nii.gz \ -w ${case_wm} \ -o ${result_dir}/${output_name}_ct.nii.gz \ -c [ 45,0.0,10 ] \ -r 0.025 \ -m 1.5 \ -n 10 \ -b 0
Output of the command with verbose output.
msub1_gm2sst.nii.gz
sub1_ct.nii.gz
sub1_SegmentationPosteriors2.nii.gz
Data to reproduce the problem
.
The text was updated successfully, but these errors were encountered: