#!/bin/tcsh -f # ver=3.0 # Read in the b-vector file that was output by dcm2nii (here called # simply 'bvec') when converting dicoms, and output a usable gradient # file for 3dDWItoDT and 3dDWUncert. There are 2 parts to this process. # --------------------------- part 1 -------------------------------- # Different scanners and software have different systems of # interpreting directionality in gradient files; for some, a negative # first column is "leftward", for others it is "rightward", etc. # Needless to say, with 3 dimensions, this can be challenging to sort # out. This is just a difference in convention, but it is important # to know that you have data in the correct convention for your # present needs (NB: even TORTOISE and AFNI have different # interpretations of these things.) # We present here an example of checking (with reasonably high # accuracy) whether you need to "flip" a gradient # https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/FATCAT/GradFlipTest.html @GradFlipTest \ -in_row_vec bvec'[0..30]' \ -in_bvals bval'[0..30]' \ -in_dwi AVEB0_DWI.nii.gz \ -mask mask_DWI+orig. \ -scale_out_1000 \ -prefix CheckGradFlips.txt \ -wdir _tmp_CheckGradFlips cat <