[Mrtrix-discussion] Error in tracking fibers orientation

Donald Tournier d.tournier at brain.org.au
Wed Oct 31 18:26:45 PDT 2012


Hi Eloy,

As Luis mentioned, you shouldn't have these types of issues using
mrconvert. One of the reasons I encourage people to convert the DICOM data
using mrconvert and store the images using the .mif format is that it
should avoid this kind of problem. Using mrconvert ensures the DW
directions are read directly from the DICOM headers, and produced in the
format required by MRtrix. Using the .mif format allows you to store the DW
directions in the image header, making sure that the correct gradient table
remains collocated with the corresponding data and removing the risk of
using the wrong table.

Using NIfTI images is of course possible, but these do not contain the
gradient table in the header, so the gradient table needs to be supplied
separately. The issue is that the convention used by MRtrix to store the DW
directions is different to that used by most other software packages.
MRtrix stores directions relative to the real/scanner coordinate system
(essentially DICOM's patient-centered coordinate system), whereas most
other packages store them with respected to the image axes. Sometimes the
inconsistencies are obvious, which is a good thing since you can at least
tell that there is a problem. In many cases they might not be so obvious: a
slight oblique angle of the image axes will introduce inconsistencies that
might not be so clear-cut, and you might happily process a number of data
sets before coming across one that is sufficient tilted for the
inconsistencies to become obvious.

The reason I mention all this is that even if you invert some of the
columns as suggested by Luis, there is still potential for inconsistency
depending on exactly how the gradient table was generated in the first
place, and whether your data were acquired tilted or not...   For all of
these reasons, I would urge people to always process data directly from the
raw DICOM if at all possible. I realise this is not always possible (for
example if you need to do motion and eddy-current correction in FSL, etc),
but otherwise it will make the process much less error-prone.

That said, if you did use mrconvert or mrinfo to get the gradient table,
then that would be a software bug and I'd need to fix it!

Cheers,

Donald.


On 1 November 2012 11:02, Luis Concha <lconcha at unam.mx> wrote:

> Seems like you have to flip your vectors in the encoding.b table. If you
> use mrconvert to get from dicoms to .mif you should not have this problem.
>
> However, if you used dcm2nii or something else, the direction of the
> gradient diffusions may be flipped. You can fix this by multiplying the
> first, second or third column of your encoding.b table by -1 (combinations
> of xy, yz or even xyz are allowed). This is a trial and error process, for
> the most part, but once you get it right (and assuming you do not modify
> your scanning parameters) you can apply the same modification to all your
> gradient tables.
>
> An example script for flipping your bvecs is below. Use the arguments
> -flip_x, -flip_y and/or -flip_z to taste. I recommend that you perform CSD
> with lmax=2 then display your ODFs in mrview iteratively until you find a
> combination of flips that works for your data.
>
> Good luck.
>
> Luis
>
> #!/bin/bash
>
> bvecsIN=$1
> bvecsOUT=$2
>
>
> print_help()
> {
>   echo ""
>   echo "`basename $0` <bvecsIN> <bvecsOUT> [-options]"
>   echo ""
>   echo "Options:"
>   echo "  -flip_x"
>   echo "  -flip_y"
>   echo "  -flip_z"
>   echo ""
>   echo "Luis Concha - INB, UNAM"
>   echo "July 2010"
>   echo ""
>
> }
>
>
>
> for arg in "$@"
> do
>
>     case "$arg" in
>         -h|-help)
>         print_help
>         exit 1
>         ;;
>       esac
> done
>
>
>
>
> x=`head -n 1 $bvecsIN | tail -n 1`
> y=`head -n 2 $bvecsIN | tail -n 1`
> z=`head -n 3 $bvecsIN | tail -n 1`
>
>
> xx=$x
> yy=$y
> zz=$z
> for arg in "$@"
> do
>
>     case "$arg" in
>        -flip_x)
>         echo "Will flip x component"
>         xx=""
>         for v in $x
>         do
>           vv=`echo "$v * -1" | bc -l`
>           xx="$xx $vv"
>         done
>         ;;
>        -flip_y)
>         echo "Will flip y component"
>         yy=""
>         for v in $y
>         do
>           vv=`echo "$v * -1" | bc -l`
>           yy="$yy $vv"
>         done
>         ;;
>        -flip_z)
>         echo "Will flip z component"
>         zz=""
>         for v in $z
>         do
>           vv=`echo "$v * -1" | bc -l`
>           zz="$zz $vv"
>         done
>         ;;
>     esac
>     index=$[$index+1]
> done
>
> echo $xx > $bvecsOUT
> echo $yy >> $bvecsOUT
> echo $zz >> $bvecsOUT
>
>
>
>
>
>
> Dr. Luis Concha
> Instituto de Neurobiología
> Laboratorio C-12
> UNAM, Campus Juriquilla
> Boulervard Juriquilla 3001
> Juriquilla, Querétaro.
> C.P. 76230
> México
> Tel (442) 2 38 10 53
> Fax (442) 2 38 10 46
> www.inb.unam.mx
>
>
>
>>
>
> _______________________________________________
> Mrtrix-discussion mailing list
> Mrtrix-discussion at www.nitrc.org
> http://www.nitrc.org/mailman/listinfo/mrtrix-discussion
>
>


-- 
*Dr Jacques-Donald Tournier
*
Research Fellow

The Florey Institute of Neuroscience and Mental Health
Melbourne Brain Centre - Austin Campus
245 Burgundy Street
Heidelberg  Vic  3084
Ph:  +61 3 9035 7033
Fax:  +61 3 9035 7307
www.florey.edu.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.nitrc.org/pipermail/mrtrix-discussion/attachments/20121101/ad8777af/attachment-0001.html


More information about the Mrtrix-discussion mailing list