AFNI Message Board

History of AFNI updates  

May 04, 2016 03:45PM
There are some updated features/functionality with AFNI DTI processing tools, as well as improved compatibility with output from TORTOISE's DIFF_CALC function. These updates refer to functionality available from (the now available) AFNI 16.1.11 and (soon to be available) TORTOISE v2.5.2.

Feel free to post/email with any questions.

Within AFNI

  • Now able to reconstruct DWIs that have multiple nonzero b-values (i.e., multiple DW factors). The information on the b-value is calculated by the function from the magnitudes of the gradients/b-matrix elements that are input. The gradient values may be scaled by the physical b-values (such as b = 400, 700, 1000 s/mm**2), or simply be scaled relatively to a unit magnitude (such as 0.4, 0.7 and 1).
  • The units of physically scaled quantities (MD, L1, L2, L3 and the diagonals of DT) will have units of 1/b, so that if a physical b-value is scaling the input gradients, then those values will be in units of mm**2/s; if the gradients are just unit-magnitude, then the units of 1/b will just be of order unity (which is the present situation; then can always be scaled by a physical value later).
  • A 'mean CSF' value is calculated as a reference diffusion value, in order to set an internal scale for checking fits-- the default csf_val is 1/(b_max); the user can set it otherwise using '-csf_val ...'.
  • To filter out annoyances from some mask edge/super-noisy voxels, a new MD-thresholding criterion is used to identify potentially bad fits. By default, voxels with really large mean diffusivity, MD > 100*(csv_val), will be treated as a bad fit and replaced with a CSF-like sphere of MD=csf_val. That value of '100' can be altered using '-min_bad_md ...'.

  • Also now handles having multiple b-values input as gradients/b-matrices.

  • In order to facilitate the non-constant grad values used by 3dDWItoDT, there are new input/output column formats for having gradient values *weighted by a bvalue*; these are called '-in_grad_cols_bwt ...' and '-out_grad_cols_bwt ...'.
  • B-values can also be output to separate files (which can then be read back in later, as necessary) in row or column format. This is done using '-out_bval_row_sep ...' or '-out_bval_col_sep ...'.

See: EXAMPLES, below.



There are a couple useful updates in the next version of TORTOISE (to
be named v2.5.2), which should be released in a couple weeks. We note
a couple very relevant points.

  • Most importantly, the b-matrix file output by DIFF_CALC in the 'AFNI format' exports (BMTXT.txt) has not been in the fully-AFNI format. The new TORTOISE will output into the fully AFNI format, calling the file BMTXT_AFNI.txt. NB: presently, the 1dDW_Grad_o_Mat calculation of gradient values from the BMTXT.txt file *has been correct* (since the formatting difficulty was having factors of 2 in matrix elements where only sign information was taken). However, direct usage of the BMTXT.txt in AFNI calculations would *not* have been correct.
  • Presently, at least in TORTOISE v 2.5.0+, the BMTXT.txt file had 'correct flips' for AFNI processing of DWI.nii. However, for those performing tensor fitting in TORTOISE, the estimated tensor quantities were likely to have a relative flip, so things like 'INPREF_V1.nii' would have been pointing in the wrong orientation within AFNI. From TORTOISE v2.5.2, both exports *should* have correct flips for AFNI.
  • **However**, you should always check for yourself, for example using @GradFlipTest-- seeing is believing! For more about fun with flipping, see:


EXAMPLES of usage in the modern (AFNI 16.1.11+ and TORTOISE 2.5.2+) world.

1) Convert TORTOISE grad table to b-value-weighted columns of
gradients, (removing the line(s) of b0s); then use that gradient
file in the tensor estimation; and, finally, calculate the
uncertainty of some DT parameters:
1dDW_Grad_o_Mat                         \
    -in_bmatA_cols      BMTXT_AFNI.txt  \
    -out_grad_cols_bwt  GRADS_BWT.dat

3dDWItoDT                               \
    -eigs  -sep_dsets  -nonlinear       \
    -mask   mask.nii.gz                 \
    -prefix DT                          \
    GRADS_BWT                           \

3dDWUncert                              \
    -inset  DWI.nii                     \
    -input  DT                          \
    -grads  GRADS_BWT.dat               \
    -iters  300                         \
    -prefix UNC

2) Just go ahead and use the (new) TORTOISE-output b-matrix directly
in the tensor estimation, and then use that again in the
uncertainty estimation:
3dDWItoDT                              \
    -eigs  -sep_dsets  -nonlinear      \
    -mask   mask.nii.gz                \
    -prefix DT                         \
    -bmatrix_Z BMTXT_AFNI.txt          \
3dDWUncert                             \
    -inset  DWI.nii                    \
    -input  DT                         \
    -bmatrix_Z  BMTXT_AFNI.txt         \
    -iters  300                        \
    -prefix UNC

Final advice on b-values:
"... Your habits become your values,
Your values become your destiny."

-- Mahatma Gandhi

Edited 3 time(s). Last edit at 06/15/2016 04:48PM by ptaylor.
Subject Author Posted

Updated features/functionality of DTI processing

ptaylor May 04, 2016 03:45PM

Re: Updated features/functionality of DTI processing

ptaylor May 04, 2016 04:55PM

Re: Updated features/functionality of DTI processing

ptaylor May 05, 2016 08:45AM

Re: Updated features/functionality of DTI processing

ptaylor June 13, 2016 01:39PM

Re: Updated features/functionality of DTI processing

ptaylor July 02, 2016 02:17AM

Re: Updated features/functionality of DTI processing

Matthew Hoptman September 11, 2019 01:34PM

Re: Updated features/functionality of DTI processing

ptaylor September 11, 2019 03:54PM

Sorry, only registered users may post in this forum.

Click here to login