DTI volumes: Storage formats and conversion

Hello,

I’m a bit confused about the relationship between the different softwares (FSL, MRTrix, DTI-TK) and storage formats for diffusion tensor images. Here’s what I would like to do:

After running FDTs dtifit I want to use DTI-TK in order to register my DTI data to a white matter atlas (IIT). DTI offers a command (fsl_to_dtitk) for conversion of FSL´s tensor storage format (*_L1, *_V1, *_L2, *_V2, *_L3, *_V3 files) to so called NIfTI tensor format while also doing some other preprocessing such as transforming the origin to 0,0,0.

After running fsl_to_dtitk mrinfo yields:

Dimensions:        96 x 96 x 60 x 1 x 6
  Voxel size:        2.5 x 2.5 x 2.30001 x 1 x 1
  Data strides:      [ 1 2 3 5 4 ]
  Format:            NIfTI-1.1 (GZip compressed)
  Data type:         32 bit float (little endian)
  Intensity scaling: offset = 0, multiplier = 1
  Transform:                    1           0           0          -0
                                0           1           0          -0
                                0           0           1          -0

While mrinfo on the FSL dtifit output *_tensor.nii.gz yields:

Dimensions:        96 x 96 x 60 x 6
  Voxel size:        2.5 x 2.5 x 2.30001 x 7.53
  Data strides:      [ -1 2 3 4 ]
  Format:            NIfTI-1.1 (GZip compressed)
  Data type:         32 bit float (little endian)
  Intensity scaling: offset = 0, multiplier = 1
  Transform:                    1    0.002925   -0.003186      -120.9
                        -0.002675      0.9971     0.07601      -88.98
                         0.003399      -0.076      0.9971      -34.56

As I would like to extract diffusion metrics (FA, MD, …) from the tensor files after warping them to a common space I tried to use tensor2metric and compare the results on the 2 tensor images.

While extracting ADC (aka MD) seems to give the same result (just with a small translation), extracting FA only gives reasonable data on the FSL generated tensor image. Running tensor2metric -fa on the DTI-TK generated tensor image gives an image similar to a binarized brain mask.

DTI-TK also offers a command (TVEigenSystem) to bring the (warped) tensor image back to FSL format but that gives 6 files _e1, _e2, _e3, _lambda1, _lambda2, _lambda3. I’m not really sure in which order and how (maybe mrcat?) to bring them into one volume file which I can then use with mrtrix commands.

I also found this in the DTI-TK documentation:

From the dwi2tensor page I suppose MRTrix3 uses the same format as Camino:

The tensor coefficients are stored in the output image as follows: 
volumes 0-5: D11, D22, D33, D12, D13, D23

DTI-TK offers a command to convert a Camino format stored DTI (in .hdr files) to the NIfTI tensor format but not the other way around.

I would be really glad if somehow had a short word of advice or a link where I could read up on this.

Thanks for reading,
Darius

Hi Darius,

In order for tensor2metric to work properly, I believe the tensor elements have to be stored in the 4-th dimension, so your dimensions should look like:

Dimensions:        96 x 96 x 60 x 6

The order in which MRtrix stores the tensor elements is D11, D22, D33, D12, D13, D23 and
is documented in the dwi2tensor help page.

If you need to reorder tensor elements from D11, D12, D13, D22, D23, D33 to the order used by MRtrix, you can easily do that with mrconvert:

mrconvert tensor.nii.gz -coord 3 0,3,5,1,2,4 tensor.mif

which will reorder the elements in the 4-th dimension as specified.

In general, I would avoid successive conversions with helper tools unless you absolutely trust them and know what they are doing. Too often tools like this are designed for very specific use cases and might throw away information that is not used by the target applicaiton. E.g., in your example, fsl_to_dtitk strips out the Transform from the nifti header, which can then never be recovered again upon converting back to FSL-format.

If you need to process a tensor image using MRtrix that was generated outside MRtrix, I would recommend doing the translation yourself using mrconvert as shown above (and mrcat if starting from distinct images per tensor element).

Hope that helps!

2 Likes

DTI-TK also offers a command (TVEigenSystem) to bring the (warped) tensor image back to FSL format but that gives 6 files _e1, _e2, _e3, _lambda1, _lambda2, _lambda3. I’m not really sure in which order and how (maybe mrcat?) to bring them into one volume file which I can then use with mrtrix commands.

Given that tensor2metric expects the six image volumes to correspond to six diffusivity values, concatenating the eigenvectors and eigenvalues will never be interpreted correctly; you would need a dedicated processing step to re-generate the tensor matrix from that information.

1 Like

I should have come up with that myself. Thanks!