[Mrtrix-discussion] Error in tracking fibers orientation
Luis Concha
lconcha at unam.mx
Wed Oct 31 17:02:31 PDT 2012
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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.nitrc.org/pipermail/mrtrix-discussion/attachments/20121031/9ab0f3c7/attachment.html
More information about the Mrtrix-discussion
mailing list