Post edited 2:40 am – October 20, 2010 by pguillod
I'm sure someone already did this, but if you're still trying to convert bvals and bvecs from the diffusion toolbox in FSL to the format used for DTK just write the following lines into a script (i.e. bvecs2grad), add it to your bin folder, and then when you're in the folder containing bvals and bvecs execute something per below. Then when you're in the DTK GUI under the gradient file click import, select the file, and name the table accordingly.
:: bvecs2grad mygradfile.something
#!/bin/sh
if [ $# = 1 ] ; then out=$1 ; else out=default.dat ; fi
if [ -f $out ] ; then rm $out ; fi #remove old file
x=(`sed -n '1p' bvecs`)
y=(`sed -n '2p' bvecs`)
z=(`sed -n '3p' bvecs`)
i=0
for bv in $(cat bvals) ; do
echo ${x[$i]}, ${y[$i]}, ${z[$i]}, $bv >> $out
i=`echo $i+1|bc`
done
Also, if you have multiple acquisitions for one set you can merge the files into a single image set using the fslmerge command. If my images are part1.nii and part2.nii then you can merge them by typing
fslmerge -t allofthem part1 part2