The following manual introduces the reconstruction processes implemented on DSI Studio. The method to parse DICOM images parsing is detailed in parsing DICOM/Analyze/2dseq images, which generate ".src" files for further reconstruction.
Open DSI Studio and press the "step 2: reconstruction" button in the main project window to select the .src file. DSI Studio will present a reconstruction window as shown in the figure to the right.
The DTI was proposed by Basser et.al. . It is able to characterize the major diffusion direction of the fiber in human brains. The DTI implementation detail in DSI Studio is following the paper , the same as DTI Studio, which is a powerful tool developed by the Johns Hopkins MRI team. The reconstruction performs eigenanalysis on the calculated tensor, and the indices such as FA, MD (in 10-3 mm2/s), and three eigenvalues are also exported.
The ball-and-sticks model is provided by FSL Diffusion Toolkit (bedpostx) to estimate fiber orientations. At the bottom of this webpage are the Matlab codes (please download bs_recon.m and read_src.m) to reconstruct the DSI Studio src file using this model. This code uses trust-region-reflective to optimize the ball-and-sticks model.
You may also use FSL's bedpostx to process the diffusion data. The resulting files can be converted to DSI Studio readable format, as detailed in here.
The QBI reconstruction method proposed in the Tuch's MRM paper has two major parameters. One is the width of the Gaussian smoothing kernel, and another is the width of the interpolation kernel. The recommended values for the parameters is 5 degree for interpolation kernel and 15 for the smoothing kernel. Moreover, it is recommended that the sampling directions of the ODF be less than the number of sampling points in ODFs; otherwise, the noise will be amplified during the convolution/deconvolution processes.
In the newer version of DSI Studio, Tuch's version of QBI reconstruction is no longer supported since the spherical harmonics (below) can provide much better reconstruction results. Users are recommended to use SH-based QBI or GQI instead.
QBI can also be reconstructed by using spherical harmonics based transformation . There are three different versions proposed by Anderson, Hess et. al. and Descoteaux et.al, respectively. DSI Studio adopted Descoteaux 's method , since it is much easier to implement. A regularization parameter is required for the reconstruction. The recommended value is 0.006 .
One should note that QBI can be applied to multiple b-value datasets, and to make use of multiple b-value, users are recommended to use GQI.
DSI reconstruction method  is based on the Fourier transform relation between q-space signals and the diffusion PDF (or the "averaged propagator"). The detailed processing flow is listed as follows:
The Matlab code for DSI reconstruction is the follows:
% Thanks Jiaying Zhang for sharing this DSI code
% the dimension of data used here is n*1, and n refers to the number of
% images, including the image of b0 .
% odf_vertices matrix can be downloaded from the odf8.mat file in this page
% the dimension of q table is n*3.
% Note that your q table loaded here is the same as the mgh_dsi_q.txt.
% alternatively, q=load('dsi_q_vector_203.txt');
% The download link for this file is at the bottom of this page
% Hanning filter
hanning_filter=zeros(size(b_table,1),1);% b_table is 203*4,515*4 etc
% the signal after hanning filter
value=s.*hanning_filter; %s, n*1, the modulus of the signal
% to get the q space index
% To value sq
%To calculate PDF of each voxel
% To calculate the ODF of each voxel
A parameter for Hanning filter is required. The recommended value is 16 for the 16x16x16 window. The obtained ODF can be visualized, as shown in here.
One should note that the "fa" generated with DSI reconstruction in DSI Studio is an index called quantitative index (QA), which is defined in GQI paper .
DSI reconstruction does not consider the "image orientation" information in the DICOM header, and the tilted slice may result in incorrect reconstruction. Here is the solution to correct slice tilting for DSI.
1. After loading DICOM images, replace the b-table by the table you used to acquire the DICOM.
2. perform DSI reconstruction to get the fib file.
3. uncompress the .fib.gz file to .fib file. rename it to .mat file and load it in Matlab.
4. use dicominfo command to get slice orientation matrix from one of your DICOM files. The group element number is (0x0020,0x0037)
5. The 6 values in (0x0020,0x0037) are the first and second rows of the orientation matrix, and the third row can be calculated by the cross product of the first and second rows. If the sum of the third row is negative, you may need to multiply -1 to it.
6. Multiple the slice orientation matrix to the odf_vertices matrix (perform reorientation here)
7. save the fib file use save xxx.fib -v4
Limitation and drawbacks
In addition to the re-orientation problem, DSI also suffers from the interpolation and discrete estimation error in radial projection. This error can be better handled by GQI, which provides an analytical relation that converts DWI data to diffusion ODF directly. Furthermore, the effect of the Hanning filter is not fully investigated, whereas, in GQI, it is replaced by a well-defined smoothing parameter called the diffusion sampling distance.
DSI reconstruction is limited to DWI acquired by grid sampling scheme. It cannot be applied to HARDI or multi-shell sampling. This limitation is overcome by GQI.
Implementation difference from TrackVis
DSI Studio uses the minimum non-zero b-value as the reference of the grid distance, and the grid coordinate of other DWI are then calculated by floor(sqrt(b_value/min_b_value)*gradient_direction+0.5).The final grid size is always 16x16x16. TracVis (or more precisely the diffusion Toolkit), however, uses its built-in q vector table and does not use the b-table in the DICOM header.
Generalized q-sampling imaging (GQI) is a model-free reconstruction method that quantifies the density of diffusing water at different orientations. This measurement, termed spin distribution function (SDF), is an orientation distribution function of diffusing spins. Studies have shown its greater sensitivity and specificity to white matter characteristics and pathology.
GQI can calculate SDF from a variety of diffusion data sets, including DSI dataset, HARDI, multiple-shell, combined DTI dataset or even body center cubic (BCC) dataset . GQI provides an analytical relation to compute SDF, and the reconstruction requires only a simple matrix multiplication:
The value 0.018 is the 6D, where D is the self-diffusion coefficient of water at the body temperature (3.00*10^-3 mm^2/s), [Nature Reviews Neuroscience 4, 469-480, 2003 ]. In DSI Studio, the GQI implementation uses 0.015 for 6D, and thus the diffusion length ratio appears longer. (e.g., a ratio 1.25 is in fact 1.145).
The following is the Matlab code for GQI reconstruction. The reconstruction codes require users to input the preferred "diffusion sampling length ratio" (e.g. 1.2). This length ratio defines the radius of the diffusion spins included in the ODF estimation. For example, one may need to calculate the number of spins within a displacement radius of 40 microns, but this radius should be considered with respect to the diffusion time (short diffusion time => smaller radius, longer diffusion =>larger radius). A way to consider diffusion time is dividing this radius by the mean diffusion distance of free water diffusion. The resulting is this "diffusion sampling length ratio". Thus, a ratio of 1.2 means that GQI detects diffusion spins within a displacement radius of 1.2 mean diffusion distance of free water. For most of the application, we are observing restricted diffusion, and a ratio 1.2 should cover most of the diffusion.
% S is an Nx1 vector, storing the diffusion MR signals of a voxel. N is the number of the diffusion images acquired.
ODF = sinc(odf_vertices'*b_vector*mean_diffusion_distance_ratio/pi)*S;
Use Case Example:
To show the reconstructed odf, use the example code in ODF visualization page. The test example is also available in the attachment file provided at the bottom of this web page.
GQI reconstruction offers quantitative anisotropy (QA) to replace FA. The definition for QA is documented in GQI paper .
QA at u = Z(ODF(u)-iso(ODF))
where u is the fiber orientation. iso(ODF) calculates the isotropic component of the ODF. In the implementation, the minimum value of an ODF function is used as the isotropic component. Z is a scaling constant that makes the maximum of all iso(ODF) in the space equal to one. More discussions about this ODF scaling can be found in  and . In QSDR reconstruction, Z is estimated using two ventricle voxels that contain free water diffusion.
Normalized QA is calculated by normalizing the maximum QA value to one.
CSF calibration uses spatial normalization to identify the location of CSF and use it as the free water diffusion to unify the amount of diffusion with respect to it.
RDI is a model-free method to quantify the density of restricted diffusion given a diffusion displacement range (e.g. 10 microns). Its calculation utilizes using different diffusion sensitization strengths to separate non-restricted diffusion from restricted diffusion by their difference in the diffusion displacement.This feature allows for selective quantification of restricted diffusion while ignoring non-restricted diffusion, leading to higher sensitivity and specificity to the structural change due to pathological condition.
RDI can be used to detect increased cellularity caused by inflammation or a tumor mass. It can be used to study any pathological condition that leads to a change in restricted diffusion.
RDI also provides its counterpart: non-restricted diffusion imaging (nRDI), which allows for quantifying diffusion with displacement greater than a specified length. nRDI can be used to visualize edematous tissues.
*To calculate RDI, first select GQI as the reconstruction method and in the advanced options, click on a check box labeled with "restricted diffusion imaging". This will calculate RDI indices along with GQI reconstruction. The indices include rdi02L, rdi04L, ...as well as nrdi04L, nrdi 04L. "rdi02L" quantified the restricted diffusion within "0.2 L", where L is the diffusion distance. "nrdi02L" quantifies non-restricted diffusion with displacement greater than "0.2 L".
The calculation is a simple linear combination of the DWI signals acquired by long diffusion time:
rho(L) is the density of diffusing spins restricted with a displacement distance of L. In DSI Studio, the L value is a ratio with respect to diffusion distance (squared root of 6Dt). For example, rdi02L quantifies the diffusion restricted within 0.2*diffusion distance.
To acquire RDI, the DWI should be ideally acquired using multiple b-values. The optimal setting is using a grid sampling scheme (e.g., DSI scheme) with a long diffusion time. Stimulated echo is the best choice to achieve a long diffusion time without increase the echo time. Nonetheless, this does not mean that RDI cannot be applied to DTI or HARDI, which can be viewed as a partial sampling in the q-space. The only concern is that RDI calculated from DTI, HARDI, or multishell scheme may be biased toward fast or slow diffusion due to parital sampling in the q-space.
Q-Space diffeomorphic reconstruction (QSDR)  is the generalization of GQI that allows users to construct spin distribution functions (SDFs, a kind of ODF) in any given template space (e.g. MNI space). QSDR can be applied to DTI data, multi-shell data, DSI data, none-shell-none-grid data, or a combination of the above-mentioned data sets.
By reconstructing SDFs in the template space, QSDR provides a direct way to analyze the group difference (see Group connectometry analysis). QSDR can potentially work with any spatial registration method such as SPM normalization, fnirt, ..., etc. Currently the spatial normalization used here is an enhanced version of the SPM-like normalization. The parameter 7-9-7 means that there are 7, 9, and 7 transformation parameters (Fourier basis) used for deforming x, y, and z axis. Higher numbers give better accuracy, but it comes with a dramatically increased demand on computation time and memory. The original SPM routine cannot use a larger number of parameters, but the enhanced version used in DSI Studio breaks this limit to 21-27-21.
The reconstruction equation for QSDR is the following:
The bounding box information for QSDR output:
To convert the reconstruction coordinate (2mm output) to MNI coordinate:
mni_x = 78.0-2.0*x
mni_y = 76.0-2.0*y
mni_z = -50.0+2.0*z
The 2mm output image has the following sform information:
Users can assign arbitrary output resolution (integer) and perform reconstruction without resorting to external normalization tools. DSI Studio first calculates the quantitative anisotropy (QA) mapping in the native space and then normalizes it to the MNI QA map. QSDR also records the R-squared value between the subject QA and MNI QA map in the filename (e.g. .R72.fib.gz means a R-squared value of 0.72). A value greater than 0.6 suggests good registration results, whereas a low value may indicate possible error in the registration. The most common cause for low R2 value is a flipping of the slice order at the Z direction, which causes the brain volume to be placed up side down. This can be corrected using the [Edit][Flip z] function provided in the reconstruction window.
You may warp subject T1W/T2W together with QSDR. To add these images, click on the "Add T1WT2W" button at the right side of the output resolution box. If you have T1W-based ROI to be transformed along with the T1W, you may add the T1W first and then the ROI. DSI Studio will prompt you to apply for the previous transform. Once the QSDR reconstruction is done, the added image volume will be stored in the FIB file. You can open the FIB file in DSI Studio and switch the imaging modality from "qa" to whatever images you have added in QSDR reconstruction.
Occasionally we may encounter huge diffusion datasets, e.g. a high spatial resolution DSI dataset, and it is impossible for DSI Studio to process the images in the memory since the image volume may have a size of several gigabytes. To reconstruct such images, here I offer the following MATLAB codes that conduct direct GQI reconstruction from a huge image file. This skips the src file creation and directly obtains fib file that can be used to conduct fiber tracking.
The following codes assume that the image pixels are arranged in an order of x - y - z - d, where d represents the serial number of the diffusion weighted image. You may also need to download find_peak.m and odf8.mat (both provided at the bottom of this page) to run this code.
DSI Studio detects fiber directions by searching for local maximum on an ODF. This is implemented in DSI Studio.
The following is the Matlab codes for getting the local maximum:
The return vector p stores the "index" of the peak orientations. To access the orientation, use odf_vertices(:,p);
The images volume in the SRC file can be exported to a 4D nifti file. The function is under the [File] Menu.
The checkbox in the reconstruction window enables this checking problem. If the b-table is flipped, the generated fib file will have ".fx", ".fy", or ".fz" added to the file extension. The default setting is having this function enabled. Users can disable this b-table checking by unchecking this checkbox.
DSI Studio provides functions to flip or rotate DWI data and also corrects the b-table accordingly. To use this function, open the SRC file using "STEP2 Reconstruction". In the main menu on the top, click on [Edit] and select the function. DSI Studio will then transform the DWI accordingly and also correct the b-table. You can then choose a reconstruction method and proceed with the processing.
DSI Studio provides a function to linearly transform DWI data to the T1W or T2W space (also correct the b-table accordingly). To use this function, open the SRC file using "STEP2 Reconstruction". In the main menu on the top, click on [Edit][To T1W/T2W space] and select the T1W or T2W nifti file. DSI Studio will then transform the DWI to the T1W or T2W space and also correct the b-table. You can then choose a reconstruction method and proceed with the processing.
DTI: For DTI, at least 6 diffusion images with different sampling directions and a b0 image are needed. Images with multiple b-value are also supported.
The FIB file generated during the reconstruction will include several extension. Here is a list of the explanation
odf8: An 8-fold ODF tessellation was used
f5: For each voxel, a maximum of 5 fiber directions were resolved
rec: ODF information was output in the FIB file
csfc: quantitative diffusion MRI was conducted using CSF location as the free water calibration
hs: A half sphere scheme was used to acquired DSI
reg0i2: the spatial normalization was conducted using (reg0: 7-9-7 reg1: 14-18-14 reg2: 21-27-21) and the images were interpolated using (i0: trilinear interpolation, I1: Guassian radial basis i2: cubic spine)
bal: The diffusion scheme was resampled to ensure balance in the 3D space
fx, fy, fz: The b-table was automatically flipped by DSI Studio in x-, y-, or z- direction.
rdi: The restricted diffusioin imaging metrics were calculated
de: deconvolution was used to sharpen the ODF
dec: decomposition was used to sharpen the ODF
gqi: The images were reconstructed using generalized q-sampling imaging
qsdr: The images were reconstructed using q-space diffeomorphic reconstruction
R72: The goodness-of-fit between the subject's data and the template has a R-squared value of 0.72
 P.J. Basser, J. Mattiello and D. LeBihan, Estimation of the effective self-diffusion tensor from the NMR spin-echo, J Magn Reson 1994;B 103(3):247-254.
 Jiang H, van Zijl PC, Kim J, Pearlson GD, Mori S. DtiStudio: resource program for diffusion tensor computation and fiber bundle tracking. Comput Methods Programs Biomed. 2006;81:106–116.
 Tuch D.S. Q-ball imaging. Magn. Reson. Med. 2004;52:1358–1372.
 Descoteaux, M., Angelino, E., Fitzgibbons, S., Deriche, R., 2007. Regularized, fast, and robust analytical Q-ball imaging. Magn Reson Med 58, 497-510.
 Van J. Wedeen, Patric Hagmann, Wen-Yih Isaac Tseng, Timothy G. Reese, Robert M. Weisskoff, Mapping complex tissue architecture with diffusion spectrum magnetic resonance imaging, MRM 2005 54:1377–1386
 F-C. Yeh, V. J. Wedeen, and W-Y. I. Tseng "Dataset-independent reconstruction of high angular resolution diffusion sampling schemes by generalized q-space imaging" Electronic poster, proc: 17th Scientific Meeting & Exhibition, Honolulu, Hawai'i, USA 18-24 April 2009.
 F-C. Yeh, V. J. Wedeen, and W-Y. I. Tseng "Practical crossing fiber imaging with combined DTI datasets and generalized reconstruction algorithm" Oral presentation, proc: 17th Scientific Meeting & Exhibition, Honolulu, Hawai'i, USA, 18-24 April 2009. (link)
 Fang-Cheng Yeh, Van J. Wedeen, Wen-Yih Isaac Tseng. “A recursive algorithm to decompose orientation distribution function and resolve intra-voxel fiber directions." Proc 16th Scientific Meeting & Exhibition, Toronto, Ontario, Canada, May 3-9, 2008. (link)
 Yeh, Fang-Cheng, Van Jay Wedeen, and Wen-Yih Isaac Tseng, "Generalized-sampling imaging."Medical Imaging, IEEE Transactions on 29.9 (2010): 1626-1635. [pdf]
 Yeh, F.C., Wedeen, V.J., Tseng, W.Y., 2011. Estimation of fiber orientation and spin density distribution by diffusion deconvolution. Neuroimage 55, 1054-1062. (pdf)
 Yeh, Fang-Cheng, and Wen-Yih Isaac Tseng, "NTU-90: a high angular resolution brain atlas constructed by q-space diffeomorphic reconstruction." Neuroimage 58.1 (2011): 91-99. [pdf]
 Yeh, F.C., Tseng, W.Y.Sparse Solution of Fiber Orientation Distribution Function by Diffusion Decomposition”, PLoS One. 2013 Oct 11;8(10):e75747. doi: 10.1371/journal.pone.0075747. (link).
 Yeh, Fang-Cheng, Li Liu, T. Kevin Hitchens, and Yijen L. Wu, "Mapping Immune Cell Infiltration Using Restricted Diffusion MRI", Magn Reson Med. accepted, (2016) [pdf]