-
-
Notifications
You must be signed in to change notification settings - Fork 390
Description
Operating system and version
Linux VM in Windows,ubuntu-24.04
CPU architecture
Please select
ANTs code version
ants-2.6.1-ubuntu-24.04-X64-gcc.zip
ANTs installation type
Downloaded Github release binaries
Summary of the problem
I'm encountering a problem when trying to warp my DTI tensor image to T1 space using ANTs. Despite using antsApplyTransforms with -e 2 and -f 0.0007, the output tensor image (dti_tensor_in_T1.nii.gz) contains only zeros. Here's the context and what I’ve tried so far:
Processing pipeline:
- DTI preprocessing using FSL eddy
- Tensor fitting with dtifit --save_tensor
- Conversion to ITK format with ImageMath
- Computation of warp from b0 to T1 using antsRegistration
- Tensor warping with: antsApplyTransforms -d 3 -e 2
The b0 image aligns well with the T1 after warping. However, the output tensor image dti_tensor_in_T1.nii.gz is completely zero (confirmed by fslstats and visualization).
Commands to reproduce the problem.
#!/bin/bash
set -e
OUTDIR="preproc"
BVAL="raw_data/DWI/data.bval"
T1="raw_data/T1/T1.nii.gz"
DWI="$OUTDIR/FSL_eddy/eddy_corrected_data.nii.gz"
BVEC_ROT="$OUTDIR/FSL_eddy/eddy_corrected_data.eddy_rotated_bvecs"
BVAL="$BVAL"
DTI_OUT="DTI_FIT"
mkdir -p $DTI_OUT
mkdir -p "$DTI_OUT/Reg"
fslroi "$DWI" "$DTI_OUT/b0_from_tensor.nii.gz" 0 1
bet "$DTI_OUT/b0_from_tensor.nii.gz" "$DTI_OUT/b0_tensor_space_brain" -m -f 0.3 -g 0
MASK="$DTI_OUT/b0_tensor_space_brain_mask.nii.gz"
dtifit
-k "$DWI"
-o "$DTI_OUT/dti"
-m "$MASK"
-r "$BVEC_ROT"
-b "$BVAL"
--save_tensor
ImageMath 3 "$DTI_OUT/dti_tensor_ants.nii.gz" FSLTensorToITK "$DTI_OUT/dti_tensor.nii.gz"
antsRegistration
-d 3
-r [$T1, $DTI_OUT/b0_from_tensor.nii.gz, 1]
-m mattes[$T1, $DTI_OUT/b0_from_tensor.nii.gz, 1, 32, regular, 0.25]
-t translation[0.1]
-c [1000x500x250x0,1e-8,10]
-s 4x2x1x0vox
-f 6x4x2x1
-m mattes[$T1, $DTI_OUT/b0_from_tensor.nii.gz, 1, 32, regular, 0.25]
-t rigid[0.1]
-c [1000x500x250x0,1e-8,10]
-s 4x2x1x0vox
-f 6x4x2x1
-m mattes[$T1, $DTI_OUT/b0_from_tensor.nii.gz, 1, 32]
-t affine[0.1]
-c [1000x500x250x0,1e-8,10]
-s 4x2x1x0vox
-f 6x4x2x1
-m CC[$T1, $DTI_OUT/b0_from_tensor.nii.gz, 1, 4]
-t SyN[0.1, 3, 0]
-c [100x70x50x0,1e-9,10]
-s 3x2x1x0vox
-f 4x3x2x1
-o [$DTI_OUT/Reg/dwi_to_T1_]
antsApplyTransforms
-d 3
-i "$DTI_OUT/b0_from_tensor.nii.gz"
-r "$T1"
-t "$DTI_OUT/Reg/dwi_to_T1_1Warp.nii.gz"
-t "$DTI_OUT/Reg/dwi_to_T1_0GenericAffine.mat"
-o "$DTI_OUT/Reg/b0_to_T1.nii.gz"
-n NearestNeighbor
antsApplyTransforms
-d 3
-e 2
-i "$DTI_OUT/dti_tensor_ants.nii.gz"
-o "$DTI_OUT/dti_tensor_in_T1.nii.gz"
-t "$DTI_OUT/Reg/dwi_to_T1_1Warp.nii.gz"
-t "$DTI_OUT/Reg/dwi_to_T1_0GenericAffine.mat"
-r "$T1"
-f 0.0007
Output of the command with verbose output.
"dti_tensor_in_T1.nii.gz' in data folder
Data to reproduce the problem
https://drive.google.com/drive/folders/1uFNEyOm03e_9M_KGjZ3VvcHVVmRqXLPf?usp=sharing