CREDITS:
If you use the programs on this page for your analysis,
an acknowledgment to Ona Wu, Timothy L. Davis and
Thomas Benner for assistance in data analysis would be much
appreciated.
If you find this page helpful in developing your own programs, a reference to the following paper would be appreciated.
PROGRAMS:
The following programs were developed and tested for diffusion
imaging using the Stejskal-Tanner PFGSE sequence and have not been
validated for balanced or refocused diffusion sequences. They work on
both Solaris and Linux systems.
The conventions used are words in italics are arguments that you specify at run time and all other text, including < and > need to be included. Arguments in [] are optional.
This program assumes the data has been acquired using the following diffusion gradients:
Shot | Gx | Gy | Gz |
1. | 1 | 1 | 0 |
2. | 1 | -1 | 0 |
3. | 0 | 1 | 1 |
4. | 0 | -1 | 1 |
5. | 1 | 0 | 1 |
6. | -1 | 0 | 1 |
7. | 0 | 0 | 0 |
It assumes the files are ordered with 7 shots for each slice arranged sequentially. That is:
Shot 1 for Slice 2
...
Shot 7 for Slice N
If your files are not in that order or in bshort format, you may be able to use repack to reslice your files into the right order.
If you use ~ona/bin/Diff/bin/ideal.dat for your bval_data file, you will need to supply the -B argument with the b-value you used since the ideal.dat file assumes an input matrix of magnitude 1.
~ona/bin/Diff/bin/bcoeffs.dat is the inverse matrix file customized for the sequence that ran on the ANMR systems with b-value=1221. The -B argument is not necessary in this case. This matrix also compensates for cross-term gradient effects in the ANMR system.
This program can be used for any sequence provided the correct bval_data file is used. The bval_data file is a binary file containing the elements in double precision of the 7x7 inverse matrix that can be used to solve the diffusion equations assuming each row represents the elements used for each image acquisition. Also mktensorsb populates the D tensor as [Dxx,Dyy,Dzz,Dxy,Dyz,Dxz,ln(So)]. For example for the above diffusion sequence, assuming the magnitude of Gx=Gy=Gz=1/sqrt(2) and b-value=1, the ASCII representation of ideal.dat would be:
+0.5 | +0.5 | -0.5 | -0.5 | +0.5 | +0.5 | -1.0 |
+0.5 | +0.5 | +0.5 | +0.5 | -0.5 | -0.5 | -1.0 |
-0.5 | -0.5 | +0.5 | +0.5 | +0.5 | +0.5 | -1.0 |
+0.5 | -0.5 | +0.0 | +0.0 | +0.0 | +0.0 | +0.0 |
+0.0 | +0.0 | +0.5 | -0.5 | +0.0 | +0.0 | +0.0 |
+0.0 | +0.0 | +0.0 | +0.0 | +0.5 | -0.5 | +0.0 |
+0.0 | +0.0 | +0.0 | +0.0 | +0.0 | +0.0 | -1.0 |
The structure of the tenout file consists of nrows*ncolumns*nslices+1 TensorType elements. The structure of TensorType is described in the tensordata.h file:
#ifndef _tensordata_h #define _tensordata_h /* Outgoing data format */ struct fvec_struct {float x, y, z;}; typedef struct tensordata_struct { float e1, e2, e3; /* Eigenvalues */ struct fvec_struct v1, v2, v3; /* Eigenvectors */ } TensorType; #endifThe first TensorType structure in the file contains the ncols, nrows and nslices in e1, e2 and e3 elements respectively. The next few programs assume this format for their analysis.
This program takes the output of mktensorsb and generates various scalar metrices of the diffusion tensor. The order of the images are:
Eigenmap[0]: Lambda 1 Eigenmap[1]: Lambda 2 Eigenmap[2]: Lambda 3 Eigenmap[3]: Lambda 1 - Lambda 2 Eigenmap[4]: Lambda 2 - Lambda 3 Eigenmap[5]: Lambda 1 - Lambda 3 Eigenmap[6]: Dxx Eigenmap[7]: Dyy Eigenmap[8]: Dzz Eigenmap[9]: Trace Eigenmap[10]: Eccentricity Eigenmap[11]: Condition Number (Lambda1/Lambda3) Eigenmap[12]: Relative Anisotropy Eigenmap[13]: Fractional Anisotropy Eigenmap[14]: Lattice Anisotropy Eigenmap[15]: Volume RatioThe sequence is repeated for each slice. The user still needs to create the appropriate eigmap.hdr file with the correct inplane dimensions and number of images (= number of slices * 16).
-e specifies the eigenvector for weighting images (Defaults to principal eigenvector) -s specifies scaling (Defaults to 1) 0 for none 1 for variance 2 for FA 3 for LI 4 for eigenvalues 5 for std dev 6 for E1-E2 7 for E2-E3
Output are .ppm files specified by -o argument and can be viewed with your favorite graphics viewer, e.g. xv.
ADDITIONAL INFORMATION:
DISCLAIMER:
This page is not guaranteed to be up-to-date and
is worth what you paid for it. The programs described on this
page are for research purposes only. Please send all bug reports to ona_at_nmr.mgh.harvard.edu.