Hi SCT team,
I am trying to compute a Jacobian determinant image from the deformation field generated by sct_register_to_template.
My registration command was approximately:
sct_register_to_template \
-i data.nii.gz \
-s seg.nii.gz \
-ldisc labels_disc.nii.gz \
-c t1 \
-ofolder reg
I then tried to compute the Jacobian determinant using ANTs:
CreateJacobianDeterminantImage \
3 \
reg/warp_anat2template.nii.gz \
spinal_jacobian.nii.gz \
0 \
0
The command runs, but the resulting spinal_jacobian.nii.gz contains many zero-valued voxels, including some entire z-slices with value 0. Some of these zero-valued areas are inside the PAM50 template signal range, and the corresponding warp_anat2template.nii.gz voxel has a non-zero value.
For example, in FSLeyes I can see a voxel where:
warp_anat2template: non-zero value
spinal_jacobian: 0.0
PAM50_t1: spinal cord area with non-zero signal
So I am wondering whether I am using the wrong command or whether the SCT warp field needs to be converted before being passed to CreateJacobianDeterminantImage.
The header of the warp field is:
dim0 5
dim1 141
dim2 141
dim3 991
dim4 1
dim5 3
datatype 16
pixdim0 -1.000000
pixdim1 0.500000
pixdim2 0.500000
pixdim3 0.500000
pixdim4 0.000000
pixdim5 0.000000
intent Vector
intent_code 1007
PrintHeader also shows:
Spacing [0.5, 0.5, 0.5]
Size : 141 141 991
Image Dimensions : [141, 141, 991]
Intensity Range : [-100000, 3.40282e+38]
Mean Intensity : 4.17588e+35
My questions are:
- Is
CreateJacobianDeterminantImagethe correct way to compute the Jacobian determinant fromwarp_anat2template.nii.gzgenerated by SCT? - Does the SCT warp field need to be converted from the 5D vector NIfTI format before Jacobian calculation?
- Are the extreme values in the warp field, such as
-100000and3.40282e+38, expected padding values? Could they explain the zero-valued Jacobian slices? - Is there an SCT-recommended way to generate a Jacobian determinant image from
sct_register_to_templateoutputs?
I have attached a minimal set of files for testing via Google Drive:
testing data
Thanks!
Xiaomin

