Documentation‎ > ‎

Track-specific analysis and network measures


    DSI Studio provides several ways to perform along tract-specific analysis. The paradigm behind it is that the quantitative index (FA, ADC,..etc) can be sampled along the fiber trajectories, which are generated using fiber tracking algorithm. The trajectories may provide better localization of the target regions.

    The details about fiber tracking are here.

Export along track index

     The fiber trajectories are sequences of 3D coordinates. DSI Studio uses these coordinates to sample the index like FA and ADC. The along-track sampling samples one value for each coordinate in a trajectory. The data arrangement is similar to that of the tract coordinate TXT file.

    To export the sampled data, right click on the tracks (usually has a named like "Tract 1") shown in the widget to the right. Select [Save Index] and choose the index to be saved. The output example is shown in 
the following.
The tract text file output by DSI Studio

or each coordinate on a trajectory, DSI Studio calculates the index using trilinear interpolation. The calculated values of a trajectory are exported as a sequence of numbers in a line. The values are separated by space. The first value is the first coordinate of the first trajectory, as shown in the following.

    [index at 1st coordinate 1st tract] [index at 2nd coordinate 1st tract]...
    [index at 1st coordinate 2nd tract] [index at 2nd coordinate 2nd tract]...
    [index at 1st coordinate 3rd tract] [index at 2nd coordinate 3rd tract]...

Tract Report

    DSI Studio provides a report interface that visualizes the quantitative index of a generated tractography. The generated plot and data can be exported as image or text value data.

    To invoke the interface, use the main menu [Tracts][Tract Analysis Report]. The options in the interface are detailed in the following.

X direction, Y direction, and Z direction

An example of corticospinal tract viewed from the anterior

Result obtained from X-direction sampling

    For X-direction, the coordinates of all tracks are projected to X axis simultaneously, and the averaged values along the x-direction are estimated using kernel density estimator with bandwidth specified in the interface.The unit of the bandwidth in at the scale of a voxel size. The sampling strategies for y-direction and z-direction are conducted similarly.

Fiber orientation

    All fiber tracts are stretched to the same length, and the sampling starts from one end to another. The sampled values are regressed using kernel density estimator with the bandwidth specified in the interface.

Illustration of the fiber stretch strategy for index sampling.

Mean of each fiber

    The mean value of the index is calculated for each fiber tract first, and all the values are plotted.

Tract Statistics

    To get a quick statistics on the tractography, click on the main menu [Tracts][Statistics].

Tract Density Imaging

Tract density imaging (TDI)was introduced by Calamante et al. [1]. TDI was shown to achieve higher resolution and to facilitate the visualization of smaller structures. DSI Studio offers the function that exports tract density imaging after tractography is generated. The procedures are the following:

Step1: generate fiber tracts

The detail parameters used in fiber tracking is documented in another page. Although the fiber tracking procedure for TDI is identical to the commonly used practice. There are several tips that help to generate better TDI:

smaller step size
To generate TDI, a smaller step size is required to produce the good result. The default setting of step size used in DSI Studio is the half of the voxel size. This setting has to be changed to 1/8 voxel size in order to achieve a subvoxel resolution of 1/4 voxel size.  

more fiber tracts
Increase the number of fiber tract to 5,000, depending on the memory space you have in your operation system. A Larger amount of fiber tracts tends to generate better TDI. Another way to include more fiber is to generate multiple TDI and average them together. This may offer the same effect of generating a huge equivalent amount of fiber tracts. You may want to export TDI in MATLAB's mat format and use Matlab to perform the average.

turn off 3D rendering
Since the number of fiber tracts is set to a very high amount, the 3D rendering options need to be adjusted so that the fiber tracking won't be terminated due to the 3D rendering failure. In the right side rendering options, setting [tract]->[style]="line" and [tract]->[Tube detail]="coarse" may prevent premature termination of the fiber tracking.

Step 2: export TDI

To export TDI, use the function under menu->[Tracts]->[Export Tract Density]. There are three options under this submenu

TDI in diffusion space
The first option is exporting the TDI in the diffusion space, which does not use the subvoxel resolution. 

TDI in subvoxel diffusion space
The second one exports TDI in a 4-times higher spatial resolution than the current diffusion space.

TDI in current slice space
You may load a T1 images in DSI Studio. and export the TDI in the T1 space.


[1]. Calamante, F., Tournier, J.D., Jackson, G.D., Connelly, A., 2010. Track Density Imaging (TDI): Super-resolution white matter imaging using whole-brain track-density mapping. Neuroimage 53, 1233-1243.

Connectivity matrix and graph analysis

DSI Studio is able to generate a connectivity matrix and calculate network measures. The following are the steps for generating a connectivity matrix. 

STEP 1: Whole brain fiber tracking

The first step is to get a whole brain fiber track using Fiber Tracking without assigning any ROI/ROA. Please note that you may need to use a large number of seeds (usually millions) to get a stable estimate of the connectivity.

STEP 2: Define brain parcellations

A brain parcellation map is required to generate the connectivity matrix. If you would like to use built-in atlas provided in DSI Studio to generate connectivity matrix, there is nothing you need to do after fiber tracking. You can open connectivity matrix dialog at [Tracts][Connectivity matrix]. DSI Studio will conduct a spatial normalization to ensure that the atlas is registered with the subject data. To check whether the linear transformation agrees well, you may open up the registration result using [View][Background registration].

If you would like to use your own parcellation map, and the map is in the MNI space, you may place the the map NIFTI file in the /atlas subfolder under DSI Studio package (In Mac, you may need to open the package to see the folder). The ROIs will be included in the atlas database for you to calculate the connectivity matrix.

If your ROIs are in the native space, you can load the NIFTI file in the region list using [Regions][Open Region] (This steps should be done AFTER you have whole-brain fiber tracking done) and then check all ROIs using [Regions][Check all]. Once the ROIs are loaded in the region, you can bring up the connectivity windows by [Tracts][Connectivity matrix].

STEP 3: Setup parameters

The connectivity matrix dialog allows users to change the parameters for calculating the connectivity matrix. 
The connectivity matrix can be calculated by accounting the number of tracts that pass two ROIs (select "count" as matrix value). This number can be normalized by the median length (select "ncount" as matrix value). The FA, QA, or ADC sampled by the tracks can also be used as the matrix entry (e.g. select "fa", "qa", or "adc" as the matrix value). There is a drop-down list in the connectivity window. One is "end in region", which counts only the final connecting region. Another one is "pass region", which counts all the regions passed.

The threshold is used to filter out small value in the connectivity matrix (by assigning zero). It is a ratio to the maximum value entry in the connectivity matrix.

STEP 4 (Optional): Export the connectivity matrix or create a connectogram

The calculated matrix can be exported as mat file or figures file. In the mat file, the connectivity matrix is stored as an n-by-n matrix, whereas the region labels are stored in the "name" matrix. To recover the list of the region labels, use the following command in Matlab

labels = textscan(char(name),'%s');

Here's the python code for getting the labels:

from import loadmat
m = loadmat("connectivity.mat")
names = "".join(m["name"].view("S4")[0]).split("\n")

To create the connectogram, click on the button named "save connectogram" and save a text file. Open the website: In "2A. UPLOAD YOUR FILE", choose the text file and check  "col with row size" and "row with col size". Click on visualize table to get the connectogram figure.

STEP 5: Graph theoretical analysis

In the connectivity matrix dialog, switch to the "network measures" tab (as shown in the figure) to view the results of graph theoretical analysis.

Graph theoretical analysis views brain connections as a graph and applied graph-based measures to analysis it. A graph is defined as a set of nodes or vertices and the edges or lines between them. Its topology can be quantitatively described by a wide variety of measures, including network characteristic path length, clustering coefficient, global efficiency, and local efficiency.

The network measures in DSI Studio follows the implementation of brain connectivity toolbox ( The explanation of the network measures can be found here.  You may also refer to Bullmore, E. and O. Sporns (2009). "Complex brain networks: graph theoretical analysis of structural and functional systems." Nat Rev Neurosci 10(3): 186-198. for details.

For binary measures, the connectivity matrix will be thresholded by a track count in proportional to the max count in the connectivity matrix to make it binary. For example, if the largest count in the connectivity matrix is 100,000 and the threshold is 0.01, then an entry with at least 1,000 track count will be set to 1, and any value fewer will be zeroed.

For weighted measures, the connectivity matrix will be normalized so that the maximum value of the matrix is one.

To do the graph theoretical anlysis, please follow

Batch processing

* I would recommend using command line to generate network measures for large amount of subjects:    

Here's the script I used in the Windows system. Save this as a *.bat file and put it inside a folder where the FIB files are placed and execute it.

for /f "delims=" %%x in ('dir *.fib.gz /b /d /s') do (
    call dsi_studio.exe --action=trk --source="%%x" --seed_count=1000000 --thread_count=8 --output=no_file --connectivity=AAL > "%%x.log.txt"

Once the network measures file are generated. You can use [Tool: Batch Processing][Parse Network Measure Text Files] and select all *.AAL.count.end.network_measures.txt files to collect all results into one single data sheet.

The following MATLAB code can be used to plot boxplots for each network measure: The c_values and d_values are matrices retrieved from the collected network measures.

clear figure;
for i=1:18
values = [c_values(i,:);d_values(i,:)];
labels = [repmat('c',length(c_values(i,:)),1);...

[h,p,ci,stats] = ttest(c_values(i,:),d_values(i,:))
set(gcf, 'Position', [200, 200, 400, 600]);
set(gcf, 'PaperSize', [2 3]);
set(gcf, 'PaperPosition', [0 0 2 3]);

Fang-Cheng Yeh,
Mar 20, 2013, 9:37 AM
Fang-Cheng Yeh,
Apr 10, 2013, 2:38 PM
Fang-Cheng Yeh,
Mar 20, 2013, 9:37 AM
Fang-Cheng Yeh,
Mar 20, 2013, 9:37 AM