User Tools

Site Tools


mirecc:mireccanat:make_dti
#!/bin/bash 
 
SUBJ=$1 
ANATDIR=~/net/selye/data/MIRECC.03/Data/Anat/$SUBJ 
 
FSLDATADIR=/data/mireccAnat/data/$SUBJ/dti 
 
mkdir -p $FSLDATADIR 
 
#### converts dti and orient as LAS #### 
bxhreorient --orientation=LAS $ANATDIR/series005/*bxh $ANATDIR/temp.bxh 
bxh2analyze -s --niigz $ANATDIR/temp.bxh $ANATDIR/dti 
rm $ANATDIR/temp.* 
 
 
#### skull strip the dti 
bet $ANATDIR/dti $FSLDATADIR/dti_brain -F -f .25 
 
rm -r $ANATDIR/dti* 
 
#### eddy current correction 
eddy_correct $FSLDATADIR/dti_brain $FSLDATADIR/data 0    
rm $FSLDATADIR/dti_brain.nii.gz 
mv $FSLDATADIR/dti_brain_mask.nii.gz $FSLDATADIR/nodif_brain_mask.nii.gz 
fslsplit $FSLDATADIR/data $FSLDATADIR/tmp -t 
mv $FSLDATADIR/tmp0000.nii.gz $FSLDATADIR/nodif_brain.nii.gz  
rm $FSLDATADIR/tmp* 
 
##copy the bv-files to the directory 
cp -r /data/mireccAnat/scripts/dif_files/* $FSLDATADIR/. 
 
##run dtifit 
dtifit -k $FSLDATADIR/data -m $FSLDATADIR/nodif_brain_mask -o $FSLDATADIR/dti -r $FSLDATADIR/bvecs -b $FSLDATADIR/bvals
  • note of caution, if you view the data and there are parts of brain missing, you need to reduce the skull stripping threshold (-f .25) and re-run.
  • lower numbers mean a more lenient threshold
mirecc/mireccanat/make_dti.txt · Last modified: 2014/08/04 16:03 (external edit)