Shape analysis and tract statistics [Step T3 Fiber Tracking][Tracts][Statistics] provides values extracted from shape analysis and diffusion metrics. Shape analysis uses the topology information from tractography streamlines to derive length, area, volume, and shape descriptors. The analysis quantifies macroscopic structural features of fiber pathways. The details of the shape metrics are documented at https://www.sciencedirect.com/science/article/pii/S1053811920308156 The details of the diffusion metrics are documented at Diffusion MRI Metrics Connectivity matrix and graph analysisDSI Studio is able to generate a connectivity matrix and calculate network measures. The following are the steps for generating a connectivity matrix. There are several approaches to get the network measures:
This approach is the most straightforward one, but may a higher variance due to atlassubject misalignment and tracking bias due to brain morphology. This approach first uses GQI to reconstruct data in the subject's DWI space and then runs wholebrain fiber tracking. DSI Studio will do a background normalization to bring atlas to the subject space to calculate network measures.
The following is the stepbystep details STEP 1: ReconstructionYou may use GQI or QSDR reconstruction to get the FIB files for fiber tracking. The GQI reconstruction can be reconstructed to subjects T1W space following the instruction here. STEP 2: Whole brain fiber trackingThe first step is to get a whole brain fiber track using Fiber Tracking without assigning any ROI/ROA. To do this, open the FIB file in [STEP1 Fiber Tracking] and change the number of seed points using the windows to the right upper corner. Under [Tracking Parameter] change [Terminate If] to 10,000,000 [Seeds] and then click on the [Fiber Tracking] button. DSI Studio will generate a large amount of whole brain tracks in this step. STEP 3: Brain parcellationsA brain parcellation map is required to generate the connectivity matrix. If you would like to use builtin 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 dsi_studio.app 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 wholebrain 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 4: Connectivity matrixThe 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) or multiplied by the sum of the inverse of the length (select "ncount2"). 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 dropdown 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 matrix entries with a small number of connecting track. It is a ratio to the maximum connecting tracks in the connectivity matrix. Network measures will be calculated and listed in the second tab for further analysis (group comparison, regression...etc.) STEP 5: Network analysisIn 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 graphbased measures to analyze 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 follow the implementation of the brain connectivity toolbox (https://sites.google.com/site/bctnet/). 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): 186198. 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. After getting the network measures in the text file, you may use python scripts to extract information. e.g., https://github.com/frankyeh/DSIStudio/issues/61 STEP 6: Graph VisualizationDSI Studio provides a 3D graph presentation to visualize the graph structure. There are two ways to present this graph Approach1: using MAT file generated from DSI Studio 1. Save the connectivity matrix from the connectivity dialog using the "save matrix" button. The output will be a MATLAB mat file. 2. Back to the fiber tracking window, on the top menu, use [View][Visualize Graph] to load the connectivity matrix mat file. Approach2: using customized MAT file or Text file with userdefined regions 1. In [step T3 Fiber tracking], load regions using [Region][Open Region]. If your matrix is 100 by 100, then there should be 100 regions. 2. Prepare connectivity matrix in a text file (spaceseparated or tabseparated values) or a mat file (use v4 to save the mat file, and the matrix should be named "connectivity") 3. Load the matrix using [View][Visualize Graph] *TIP: You can assign positive and negative values to the matrix, DSI Studio will show them in red and blue colors. *TIP: There are rendering options for graph under [Step T3c: Option][Region Rendering] STEP 7: Plot connectogramTo create the connectogram, in the connectivity dialog, click on the button named "save connectogram" and save a text file. Open the website: http://mkweb.bcgsc.ca/tableviewer/visualize/. In "2A. UPLOAD YOUR FILE", choose the text file and check "col with row size" and "row with col size" (see below). Click on visualize table to get the connectogram figure. source: http://circos.ca/tutorials/lessons/recipes/cortical_maps/img/02.png Batch processingHere'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. path=C:\WHERE_YOUR_DSI_STUDIO_FOLDER_IS\dsi_studio_64 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 measure files 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);... repmat('d',length(d_values(i,:)),1)]; boxplot(values,labels,'whisker',10); [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]); print(gcf,'dtiff','r300',strcat(int2str(i),'.tif')); end Loading connectivity matrix in MATLABThe calculated matrix can be exported as mat file or figures file. In the mat file, the connectivity matrix is stored as an nbyn "connectivity" 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 scipy.io.matlab import loadmat m = loadmat("connectivity.mat") names = "".join(m["name"].view("S4")[ 0]).split("\n")
The fiber trajectories are sequences of 3D coordinates. DSI Studio uses these coordinates to sample the index like FA and ADC. The alongtrack 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
[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 Profile To invoke the interface, use the main menu [Tracts][Tract Profile]. The options in the interface are detailed in the following.
X direction, Y direction, and Z directionAn example of corticospinal tract viewed from the anterior Result obtained from Xdirection sampling
For Xdirection, the coordinates of all tracks are projected to X axis simultaneously, and the averaged values along the xdirection 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 ydirection and zdirection 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.
The mean value of the index is calculated for each fiber tract first, and all the values are plotted.
Tract Density ImagingTract density imaging (TDI) was introduced by Calamante et al. [1]. TDI was shown to achieve higher resolution and facilitate the visualization of smaller structures. DSI Studio offers the function under [Tracts][Save Tract Density] to export tract density imaging after tractography is generated. Step 1: generate fiber tractsThe first step is to generate tractography as described on another page. In addition, here additional tips that help to generate better TDI:
1) smaller step size
To generate TDI, a smaller step size is required to produce a good result. The default setting of step size used in DSI Studio is 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.
2) more fiber tracts
A Larger amount of fiber tracts (e.g. 10,000 for human study) 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.
Step 2: export TDI
Use [Tracts][Save Tract Density] to save TDI. 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 4times higher spatial resolution than the current diffusion space.
TDI in current slice space
You may load a T1w image in DSI Studio. and export the TDI in the T1 space.
Reference:
[1]. Calamante, F., Tournier, J.D., Jackson, G.D., Connelly, A., 2010. Track Density Imaging (TDI): Superresolution white matter imaging using wholebrain trackdensity mapping. Neuroimage 53, 12331243.
