Bvecs/bvals from encoding.b, Eigenvalues with tensor2metric


#1

Hi MRTrixler,

Is it possible to convert the MRTrix encoding.b to the FSL bevecs/bvals?

I used FSL for registration and then changed the encoding.b to that registration to.
Now I need some FSL stuff to calculate something with the bevcs/bvals. How can I convert the MRTrix bValue/BVector File to bvecs/bvals?

Can I do the whole process in MRTrix? I mean the registration and then the correct the DW table for the rotation and put it back into the DWI.mif?

And another question. If I calculate the EigenValues its allways only one value with tensor2metric -vector image? But it should be three. Is there something wrong or are there any options?

thx,

Ralf


#2

Hi Ralf,

Is it possible to convert the MRTrix encoding.b to the FSL bvecs/bvals?

Yep: Both mrconvert and mrinfo have the -export_grad_fsl option, which will export to FSL-style bvecs/bvals files with appropriate conversion. Never perform this conversion by manually transposing and splitting / merging the tables.

Can I do the whole process in MRTrix? I mean the registration and then the correct the DW table for the rotation and put it back into the DWI.mif?

The main limitation at the moment is that mrregister only has a mean squared difference image similarity metric, which means that images need to have comparable contrast and intensity scaling in order to drive the registration. Once the registration has been performed, if you use mrtransform to transform your DWIs to the target space, it will detect the diffusion gradient table in the header and perform reorientation automatically.

If I calculate the EigenValues its always only one value with tensor2metric -vector image? But it should be three. Is there something wrong or are there any options?

Adding -num 1:3 should make tensor2metric provide eigenvalue / eigenvector images with all three components, rather than just the principal vector / value.

Cheers
Rob


#3

Thank you for the quick answer.
mrtransform sounds cool.
For the next study I will rethink my procedure using more MRTrix and not so much stuff by my own.
So far I am doing the reorientation and so on with the shell.

What I meant with the encoding.b to the fsl…if it is possible to do it directly with mrtrix. Is that what you meant too?

Something like:

mrinfo -export_grad_fsl encoding.b bvecs bvals

Or maybe even but the encoding.b back into the header? :slight_smile:


#4

Hi Ralf,
Just to clarify, mrtransform will only transform your gradient directions if you are applying a linear transform. Furthermore, this is really only the correct thing to do if your linear transform is rigid body (i.e. rotation and translation only, for example aligning DWI with T1). If the linear transform contains scaling or shearing then this will not only affect how equally distributed the gradients are, but it’s also the wrong transformation to apply (for more information see @ThijsDhollander’ work here) . If you try an apply a linear transform with scaling and shearing mrtransform will give you a warning.

If you are wanting to perform non-linear registration, you can reorient DWI data using @ThijsDhollander’ method. However, this is not supported in MRtrix. Currently we only provide the ability to register FOD image.
Cheers,
Dave


#5

What I meant with the encoding.b to the fsl…if it is possible to do it directly with mrtrix. Is that what you meant too?

Yes, either of those commands are capable of both importing a gradient table (in either MRtrix or FSL format) and exporting a gradient table (in either MRtrix or FSL format). If one of the import options is used in mrconvert, it will additionally embed the gradient table into the image header if one is imported and the target output image format is capable of storing it.

Something like:
mrinfo -export_grad_fsl encoding.b bvecs bvals

The usage you’re looking for is:

mrinfo image.mif -grad encoding.b -export_grad_fsl bvecs bvals

This requests information about an image, but explicitly imports the gradient table from an external file before that query is performed, and then explicitly exports information from the image (the gradient table) to external files.

Note that the DW image needs to be provided to mrinfo: This isn’t just to conform to mrinfo's expected interface; the FSL gradient table format is based on the alignment of image axes, and therefore those axes need to be defined in order for this conversion to be possible.


#6

Hi Mrtrix:
Taking advance of this post, I would like to know how to compute the eigen value and eigen vector files from a nii file

Thanks a lot in advance,

Aldo