Refining the template using population affine alignment has failed in
our 1.5T data. The voxel intensity of mean_affine3 image is all
0.001. The mean_rigid3 image seems fine though. Here is what I did
dti_rigid_population mean.nii.gz tensorfilelist.txt EDS 3
dti_affine_population mean_rigid3.nii.gz tensorfilelist.txt EDS 3
The text file contains the names of tensor files, should I use the FA
image instead?
I have also followed the pre-processing steps beforehand.
Thanks for help.
Ping
> Unfortunately, initial rigid/affine alignment can fail at times. When it
> does, it becomes important to examine your data a bit more carefully. You
> need to look at the normalized volumes themselves to help pinpoint where the
> failures occurred.
> This is what I will suggest you do
> 1) Give me a bit more information about your dataset, i.e., voxel size,
> dimension, number of gradient directions. I can help judge if the dataset
> may work well with DTI-TK.
The dimension: 256*256*24, voxel size: 1.09*1.09*6.5 mm^3, 24 gradient
directions plus one b=0
> 2) Give me specific steps you've taken to prepare the images for DTI-TK. In
> the event that you inadvertently miss a step, I can help catch it for you.
The tensor images were reconstructed originally from the FSL , and I
resampled the data to 256*256*64 with 1*1*2.25 mm^3 in resolution
Here is what I did in the shell
cd $data_dir
subjects=`ls -d *`
for subject in $subjects; do
cd $subject
TVFromEigenSystem -basename ${subject}-ec-bet-dti -type FSL -out
${subject}_tensor.nii.gz
TVTrace -in ${subject}_tensor.nii.gz
TVAnisotropy -in ${subject}_tensor.nii.gz
TVEigs -in ${subject}_tensor.nii.gz
TVLPS -in ${subject}_tensor.nii.gz
#pdrgb ${subject}_tensor.nii.gz 1.0
#ellipsoidImageColOriAniScl ${subject}_tensor.nii.gz 0 255 0 255 11 11 1.0
#ellipsoidImageColOriAniScl ${subject}_tensor.nii.gz 0 255 128 128 0 23 1.0
#masking
TVMask -in ${subject}_tensor.nii.gz -out ${subject}_mtensor.nii.gz
-mask ${subject}_b0-bet_mask.nii.gz
TVNorm -in ${subject}_mtensor.nii.gz
SVStatistics -in ${subject}_mtensor_norm.nii.gz
TVSPD -in ${subject}_mtensor.nii.gz -out ${subject}_spd.nii.gz
VolumeInfo ${subject}_mtensor.nii.gz
TVAdjustVoxelspace -in ${subject}_mtensor.nii.gz -ox 0 -oy 0 -oz 0
cd ..
done
cd $data_dir
files=`find . -type f -a -name \*mtensor.nii.gz\*`
mkdir $work_dir
#mkdir ../results-dti_tk_group
#cp $files ../results-dti_tk_group
cp $files ${work_dir}
#cd ../results-dti_tk_group
cd ${work_dir}
for mtensorfile in `ls -f *mtensor.nii.gz`; do
echo $mtensorfile >> tensorfilelist.txt
done
#Bootstrap the initial mean "mean_initial.nii.gz".
TVMean -in tensorfilelist.txt -out mean_initial.nii.gz
#upsampling population template to 1*1*2.25
TVResample -in mean_initial.nii.gz -xs 256 -ys 256 -zs 64 -xv 1 -yv 1
-zv 2.25 -out mean.nii.gz
#Rigid Alignment with the initial mean estimate:
dti_rigid_population mean_initial.nii.gz tensorfilelist.txt EDS 3
#Affine Alignment with the final refined mean estimate from rigid alignment
dti_affine_population mean_rigid3.nii.gz tensorfilelist.txt EDS 3
#Deformable Alignment with the final refined meanestimate from affine alignment
TVTrace -in mean_affine3.nii.gz
BinaryThresholdImageFilter mean_affine3_tr.nii.gz mask.nii.gz 0.01 100 1 0
dti_diffeomorphic_population mean_affine3.nii.gz
tensorfilelist_aff.txt mask.nii.gz 0.002
> 3) Run dti_rigid_population for just one iteration. if it works for the 1st
> iteration, it should generally work just fine for additional iteration that
> further refines the template.
> Here the key is to look at the normalized volumes *_aff.nii.gz and see if
> registrations have done the expected. If you have access to a Mac OSX
> machine, you can do this inspection easily and quickly with DTI-TK Quick
> Look Plugin
> http://groups.google.com/group/dtitk/web/What%20does%20it%20do%3F
> If you don't, you can use a similar tool called ImageQuickLook in DTI-TK.
> It will generate a png from the input scalar volume. So you can write a
> script to dump out all the FA maps from the normalized DTI volumes and
> convert the FA maps to png's for quick inspection.
> 4) Run dti_affine_population for just one iteration. The idea here is the
> same as 3).
> Following these steps, we can figure out where things have gone wrong. Let
> me know how it goes.
The dti_rigid_population runs fine, but not dti_affine_population. I
have attached the snapshot of mean_affine0, the mean_affine1 is blank,
I meant all the intensity is 0.001.
Thanks a lot.
Ping
> Gary
>
Thanks for the clarification.
Should I do the factor multiplication after running the
"TVFromEigenSystem" or before, i.e. multiply the factor to the
original tensor file (V1) only or all the eigenvalues and mean
diffusivity images created by FSL?
Also is there a tensor template in MNI standard space available to use
somewhere? Is it appropriate to use the FMRIB58_FA_1mm from the JHU
instead for the tensor coregistration?
Ping
Hi Gary,
Thanks for the clarification.
Should I do the factor multiplication after running the
"TVFromEigenSystem" or before, i.e. multiply the factor to the
original tensor file (V1) only or all the eigenvalues and mean
diffusivity images created by FSL?
Also is there a tensor template in MNI standard space available to use
somewhere? Is it appropriate to use the FMRIB58_FA_1mm from the JHU
instead for the tensor coregistration?
I have some questions regarding the warping scalar volumes to the
template and standard space.
First, is mean_diffeomorphic_initial6 the final population template if
I used the following command
"dti_diffeomorphic_population mean_affine3.nii.gz
tensorfilelist_aff.txt mask.nii.gz 0.002"
I then ran "dfRightComposeAffine" and "deformationSymTensor3DVolume"
to map the subject data to the final template by
dfRightComposeAffine -aff ${subject}_mtensor.aff -df
${subject}_mtensor_aff_diffeo.df.nii.gz -out
${subject}_mtensor_combined.df.nii.gz
deformationSymTensor3DVolume -in ${subject}_mtensor.nii.gz -trans
${subject}_mtensor_combined.df.nii.gz -target mean.nii.gz -out
${subject}_mtensor_combined.nii.gz
The tensor in template space seem fine,and it created DTI scalar
measures as well, but the outputs from warping the scalar volumes to
the template screw up
it is what I did
listings="fa lambda1 lambda2 lambda3 linear planar spherical tr"
for listing in $listings; do
deformationScalarVolume -in ${subject}_tensor_${listing}.nii.gz
-trans ${subject}_mtensor_combined.df.nii.gz -target mean.nii.gz -out
${subject}_${listing}_combined.nii.gz
done
they are off the center quite a big
For mapping the population template to the standard space, you
mentioned LONI ICBM-DTI-81 atlas is not suitable, but our data is 1.5T
data, can I still use it?
I did try the following the step and got errors, Here is what I did.
factor=1000
cp $FSLDIR/data/atlases/ICBM_DTI/UCLA_avgTensor/UCLA_avgTensor.nii.gz
${work_dir}/template.nii.gz
TVMultiply -in ${work_dir}/template.nii.gz -mult ${factor} -out
${work_dir}/template.nii.gz
mean=mean_diffeomorphic_initial6
dti_rigid_reg template.nii.gz ${mean}.nii.gz EDS 4 4 4 0.001
dti_affine_reg template.nii.gz ${mean}.nii.gz EDS 4 4 4 0.001 1
dti_diffeomorphic_reg template.nii.gz ${mean}_aff.nii.gz
template_mask.nii.gz 1 6 0.002
I got error in the dti_diffeomorphic_reg
cannot open mean_diffeomorphic_initial6_aff_to_template.5.pwa
converting to the diffeomorphic deformation field: ...
reading the buffer ... ** ERROR (nifti_image_read): failed to find header file f
or 'mean_diffeomorphic_initial6_aff_to_template.5.df.nii.gz'
Thanks for the help.
Ping
First, is mean_diffeomorphic_initial6 the final population template if
I used the following command
"dti_diffeomorphic_population mean_affine3.nii.gz
tensorfilelist_aff.txt mask.nii.gz 0.002"
I then ran "dfRightComposeAffine" and "deformationSymTensor3DVolume"
to map the subject data to the final template by
dfRightComposeAffine -aff ${subject}_mtensor.aff -df
${subject}_mtensor_aff_diffeo.df.nii.gz -out
${subject}_mtensor_combined.df.nii.gz
deformationSymTensor3DVolume -in ${subject}_mtensor.nii.gz -trans
${subject}_mtensor_combined.df.nii.gz -target mean.nii.gz -out
${subject}_mtensor_combined.nii.gz
The tensor in template space seem fine,and it created DTI scalar
measures as well
but the outputs from warping the scalar volumes to
the template screw up
it is what I did
listings="fa lambda1 lambda2 lambda3 linear planar spherical tr"
for listing in $listings; do
deformationScalarVolume -in ${subject}_tensor_${listing}.nii.gz
-trans ${subject}_mtensor_combined.df.nii.gz -target mean.nii.gz -out
${subject}_${listing}_combined.nii.gz
done
they are off the center quite a big