Re: About "dti_diffeomorphic_reg"

249 views
Skip to first unread message

Hui Zhang

unread,
Feb 25, 2010, 2:08:10 PM2/25/10
to yi wang, dt...@googlegroups.com

Hi Yi,


Thanks for trying the toolkit!  The step 2 in the normalization tutorial (http://groups.google.com/group/dtitk/web/Registration%20of%20DTI%20Volumes) explains why you are encountering the error.  I quote the relevant text below:


===================================

One additional step, which is important for subsequent deformable registration, is to resample the initial template to have voxel dimensions that are powers of 2.  In my experience, 128x128x64 works very well.  The matching voxel spacings should be chosen such that the total physical dimension can cover the whole brain with 2-3 voxels of slack around the boundary of the brain.  In practice, it often suffices to use the same x and y voxel spacings as used in the imaging protocol, unless they are much larger than 2mm.  In many older DTI protocols, z spacing is fairly large, as large as 5mm.  This value should be adjusted to something between 2-2.5mm.  Once you determine the appropriate voxel spacings, you can resample the template with TVResample.


    $ TVResample -in mean.nii.gz -xs 128 -ys 128 -zs 64 -xv 1.5 -yv 1.75 -zv 2.25


With this command, the resampled template will have a voxel spacing of 1.5x1.75x2.25 mm.  We find this particular choice of spacing both fill enough of the volume with the brain and leave enough slack in the background.

====================================

Although the description is for bootstrapping template, the similar requirement applies to whatever existing template you choose to use.

Please be aware that you get the best performance with bootstrapped template from your own data or use an existing template built from the data acquired from the same scanner!  If you have computational constraint, you can just bootstrap from a randomly selected subset of your dataset.  In my experience, you can do fine with just 8 subjects.

Hope this helps.  Cheers.

Gary


On Thu, Feb 25, 2010 at 6:59 PM, yi wang <caroly...@gmail.com> wrote:
Hi Gary,
 
I'm a new user of you toolkit. Now I'm finding a tool that can register a subject's DT image to an existing atlas DT image. (The subject's DT image has already performed affine registration.)

I saw that there is a tool named dti_diffeomorphic_reg in your toolkit.
But when I tried it as "dti_diffeomorphic_reg AtlasTensor_QC_float.nii.gz k4_01_QCM_tensor_affine_resampleDTI_float.nii.gz mask.nii.gz 1 6 0.002"

There are errors showed as followed:
 /home/work/dtitk/scripts/dti_diffeomorphic_reg: line 28: [: : integer expression expected
registering k4_01_QCM_tensor_affine_resampleDTI_float.nii.gz to AtlasTensor_QC_float.nii.gz ...
starting at Thu Feb 25 13:48:04 EST 2010

iteration 1 begins ...
Similarity Measure : DDS, Reorient Option : FS
reading the buffer ... time consumed = 0.12
converting the buffer ... time consumed = 0.21
reading the buffer ... time consumed = 0.1
converting the buffer ... time consumed = 0.2
reading the buffer ... time consumed = 0.01
converting the buffer ... time consumed = 0.01
template dimension 2 not an integer powers of 2
size is currently determined internally.
vsize = 1, 1, 1
origin is currently default to [0, 0, 0].
outFile = k4_01_QCM_tensor_affine_resampleDTI_float_to_AtlasTensor_QC_float.5.df.nii.gz
cannot open k4_01_QCM_tensor_affine_resampleDTI_float_to_AtlasTensor_QC_float.5.pwa
converting to the diffeomorphic deformation field: ...
reading the buffer ... ** ERROR (nifti_image_read): failed to find header file for 'k4_01_QCM_tensor_affine_resampleDTI_float_to_AtlasTensor_QC_float.5.df.nii.gz'
time consumed = 0
fail to load k4_01_QCM_tensor_affine_resampleDTI_float_to_AtlasTensor_QC_float.5.df.nii.gz
reading the buffer ... time consumed = 0
converting the buffer ... time consumed = 0.02
input volume mask.nii.gz
size: 128x128x68, voxel size: 2x2x2, origin: [-0, 0, -0]
reading output volume specification from k4_01_QCM_tensor_affine_resampleDTI_float_to_AtlasTensor_QC_float.5.df.nii.gz
** ERROR (nifti_image_read): failed to find header file for 'k4_01_QCM_tensor_affine_resampleDTI_float_to_AtlasTensor_QC_float.5.df.nii.gz'
Couldn't open file: k4_01_QCM_tensor_affine_resampleDTI_float_jac_mask.nii.gz
ExceptionObject caught !

itk::ImageFileReaderException (0x1a956d90)
Location: "void itk::ImageFileReader<TOutputImage, ConvertPixelTraits>::GenerateOutputInformation() [with TOutputImage = main(int, char**)::InputImageType, ConvertPixelTraits = itk::DefaultConvertPixelTraits<float>]"
File: /usr/local/include/InsightToolkit/IO/itkImageFileReader.txx
Line: 144
Description:  Could not create IO object for file k4_01_QCM_tensor_affine_resampleDTI_float_jac_mask.nii.gz
The file doesn't exist.
Filename = k4_01_QCM_tensor_affine_resampleDTI_float_jac_mask.nii.gz



inFile = k4_01_QCM_tensor_affine_resampleDTI_float_to_AtlasTensor_QC_float.5.df.nii.gz
reading the buffer ... ** ERROR (nifti_image_read): failed to find header file for 'k4_01_QCM_tensor_affine_resampleDTI_float_to_AtlasTensor_QC_float.5.df.nii.gz'
time consumed = 0
fail to load k4_01_QCM_tensor_affine_resampleDTI_float_to_AtlasTensor_QC_float.5.df.nii.gz
** ERROR (nifti_image_read): failed to find header file for 'k4_01_QCM_tensor_affine_resampleDTI_float_to_AtlasTensor_QC_float.5.df_jac.nii.gz'
fail to load k4_01_QCM_tensor_affine_resampleDTI_float_to_AtlasTensor_QC_float.5.df_jac.nii.gz
JACOBIAN STATISTICS: after current iteration
(standard_in) 1: parse error
(standard_in) 1: parse error
/home/work/dtitk/scripts/dti_diffeomorphic_reg: line 100: [: too many arguments
iteration 1 done, not accepted ...
ending at Thu Feb 25 13:48:05 EST 2010


Could you please help me to find out what's wrong?

Thank you.

Best,
Yi


mitz

unread,
Feb 18, 2013, 12:10:44 AM2/18/13
to dt...@googlegroups.com

Title: Error "template dimension 2 not an integer powers of 2" while running dti_diffeomorphic_population


Hi Gary,

 

Thank you very much for providing the nice toolkit! I'm new to DTITK. I have a question related with this discussion.

I ran the processes for registration and spatial normalization with an existing DTI template. dti_template_bootstrap and dti_affine_population worked well without encountering errors. However, in the process of the dti_diffeomorphic_population, I found the following error.


 

iteration 1 begins ... 

Similarity Measure : DDS, Reorient Option : FS 

Reading mean_diffeomorphic_initial.nii.gz ... Done in 0.089024s 

Reading <subject ID>_aff_diffeo.nii.gz ... Done in 0.076278s 

Reading mask.nii.gz ... Done in 0.005715s 

template dimension 2 not an integer powers of 2 

Terminating due to error 

<subject ID>_aff.nii.gz 

registering <subject ID>_aff.nii.gz to mean_diffeomorphic_initial.nii.gz ... 

starting at Mon Feb 18 13:14:46 2013

 

Since I did not find the details of the arguments in the outputs, I do not have a clue to solve this issue.

Before progressing to the registration and normalization processes, I completed the preprocessing (http://dti-tk.sourceforge.net/pmwiki/pmwiki.php?n=Documentation.BeforeReg) and resampled the standard-space DTI templace (http://dti-tk.sourceforge.net/pmwiki/pmwiki.php?n=Documentation.StdSpace), as you suggested on this discussion.  

Could you help me to figure out what's wrong with me?

 

Many thanks,

 

Mitsu

Hui Zhang

unread,
Feb 18, 2013, 1:20:18 PM2/18/13
to DTI ToolKit (DTI-TK)
Hi Mitsu,

The error message means that the z dimension is not an integer powers of 2, i.e., it is not 64 or 128 or 256, etc.  Can you check the number of voxels along z axis?  It is reported as dimension 2 because internally we index the dimension from 0 (for x).

You can send the output from VolumeInfo

VolumeInfo mean_diffeomorphic_initial.nii.gz

Gary



--
 
---
You received this message because you are subscribed to the Google Groups "DTI-TK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dtitk+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

MITSUNARI ABE

unread,
Feb 19, 2013, 2:58:22 AM2/19/13
to dt...@googlegroups.com
Hi Gary,

Thank you very much for your help!
I saw the information of the mean_diffeomorphic_initial0.nii.gz:

NIFTI Intent Code: NIFTI_INTENT_SYMMATRIX

NIFTI Orientation Code: LPI

Volume Info of mean_diffeomorphic_initial0.nii.gz

size: 128x128x60, voxel size: 1.875x1.875x2.5, origin: [0, 0, 0]


As you expected, the size along z axis is not 64.


I used the resampled DTI template like this. 


NIFTI Intent Code: NIFTI_INTENT_SYMMATRIX

NIFTI Orientation Code: LPI

Volume Info of IIT2mean_dtitk_resampled.nii.gz

size: 128x128x64, voxel size: 1.42188x1.70312x2.5, origin: [0, 0, 0]


Should I resample the DTI template again so that the z size become 64 in the mean_diffeomorphic_initial.nii.gz?


Thanks,


Mitsu


2013/2/19 Hui Zhang <garyhu...@gmail.com>

Hui Zhang

unread,
Feb 19, 2013, 4:55:21 AM2/19/13
to DTI ToolKit (DTI-TK)
Hi Mitsu,

It seems like that you might have executed the pipeline incorrectly.  If it is done correctly, all the subsequent intermediate templates, i.e., the files whose names start with "mean", such as mean_diffeomorphic_initial0.nii.gz and mean_affine0.nii.gz, should have the same VolumeInfo output as the resampled IIT2 template.

I can't tell where along the way an error crept in.  My advice is to go through the intermediate templates and see when they begin to have different VolumeInfo output from your resampled IIT2 template.

Gary
Reply all
Reply to author
Forward
0 new messages