Recent Changes - Search:


This is the old Camino website, please visit our new page to download the code and get the latest documentation.



UCL Home

edit SideBar

Tutorial: Connectivity Mapping

This tutorial uses Camino to generate a graph representing the connections between the different cortical regions of the brain. The connectivity mapping involves the following steps:

  • Fiber Tracking
  • Cortical Segmentation
  • Registration of Segmentation and Diffusion Weighted Image
  • Construction of Cortical Connectivity

1. Fiber Tracking

Seed File

The seed file for the tracking has to cover the whole brain region. This can be done using for e.g. MRICro (Select 'ROI -> Apply intensity filter to volume'. Specify the minimum and the maximum thresholds such that the filter covers the whole brain and 'Save as Analyze').


Run track and create a raw binary track file.

track -seedfile roi -inputfile brain_DT.Bdouble -outputfile brain_track.Bdouble

Using PICo tractography algorithm:

dtlutgen -schemefile tensorPoints.scheme -snr 16.0 -inversion 1 > picoTable.dat
cat brain_DT.Bdouble | picopdfs -inputmodel dt -luts picoTable.dat > brainpdfs.Bdouble
track -inputmodel pico -seedfile roi -inputfile brainpdfs.Bdouble -outputfile brain_ptrack.Bdouble -iterations 2

Detailed explanation of various tracking algorithms is explained in the Tractography tutorial.

2. Cortical Segmentation

Segmentation of the cortical regions of the brain can be performed using freesurfer. The segmentation is done on the T1-weighted image (brain_T1.nii). After installing freesurfer, use the following code to start the segmentation process, which could take 20-40 hrs to complete.

recon-all -i brain_T1.nii -subjid brain1 -all

If the FOV of the T1-weighted image is more than 256, then use -cw256 parameter in the above code. During the segmentation process, verify the registration of the T1-image with the atlas image in the freesurfer. (i.e) After the -talairach operation, execute

tkregister2 --mgz --s brain1 --fstal

and check if the MOVABLE and the TARGET are registered properly.

After the execution of -skullstrip, check if the skull has been removed properly from the T1 image using the following code.

tkmedit -f brain1/mri/brainmask.mgz

The cortical segmentation image will be stored as wmparc.mgz in brain1/mri. This can be converted into the Nifti or Analyze format using

mri_convert wmparc.mgz wmparc.nii

The segmented image can be viewed using tkmedit or Slicer.

3. Registration of Segmentation and Diffusion Weighted Image

If the resolution of the T1-weighted image, over which the segmentation is performed, is different from that of the diffusion-weighted image, then the images have to be registered. This can be done using FSL's FLIRT tool. The brain region can be extracted from the b0 image using, BET.

bet /home/fsl/brain/brain_b0 /home/fsl/brain/brain_b0_strip -f 0.5 -g 0

The output of the BET tool is used for the registration with the T1 image. The skull striped version of the T1 image is generated by freesurfer as brain1/mri/brain.mgz. The higher resolution T1 image, is taken as the reference image and the skull stripped b0 image as the input image. Use the 'Advanced' options to set the 'Cost function' to be 'Mutual Information'.

flirt -in /home/fsl/brain/brain_b0_strip.nii.gz -ref /home/fsl/brain/brain.nii -out /home/fsl/brain/brain_out.nii.gz -omat /home/fsl/brain/brain_out.mat -bins 256 -cost corratio -searchx -90 90 -searchy -90 90 -searchz -90 90 -dof 12 -interp trilinear

Obtain the inverse transformation matrix using 'Misc->Invert FLIRT Transform' in the FSL GUI.

convert_xfm -omat /home/fsl/brain/brain_inverse.mat -inverse /home/fsl/brain/brain_out.mat

Apply the inverse matrix over the segmentation image with the 'Interpolation Method' as 'Nearest Neighbour'.

flirt -in /home/fsl/brain/wmparc.nii -ref /home/fsl/brain/brain_b0_strip.nii.gz -out /home/fsl/brain/wm_undersampled.nii -init /home/fsl/brain/brain_inverse.mat -interp nearestneighbour

4. Construction of Cortical Connectivity

The graph representing the connections between the regions in the segmented image can be obtained using

conmap -inputfile brain_track.Bdouble -roifile wm_undersampled.nii.gz

Figure 1. The graph visualization output by conmap.

This creates 'Connectivity.png', shown in figure 1, with the graph representing the ROIs and the connections between them. The thickness of the connections is proportional to the number of fibers connecting those two regions. The vertices of the graph indicate the ROI and their diameter is proportional to the number of tracts reaching that vertex or ROI. Another file, 'ConnectionMatrix.txt', containing a matrix of the number of tracts connecting different regions, is created at the same location.

If the mapping between few segments in the brain is required, the indices of those regions can be given separately. The labels and the indices of the different segments in wmparc.mgz can be found at brain1/stats/wmparc.stats. Create a file, say indices.txt with comma-separated indices of the required segments.


where 1001,1002.. are the indices of the segments for which graph has to be drawn. The labels of the different vertices can be specified, by creating a file say indices-labels.txt in the following format.


These files can be specified as optional parameters.

conmap -inputfile brain_track.Bdouble -roifile wm_undersampled.nii.gz -indexfile indices.txt -labelfile indices-labels.txt -threshold 100

where threshold indicates the minimum number of fiber connections that has to be drawn in the graph.


[1]. Patric Hagmann et al. (2007) Mapping Human Whole-Brain Structural Networks with Diffusion MRI PLoS ONE 2(7): e597. doi:10.1371/journal.pone.0000597
[2]. Patric Hagmann et al. (2008) Mapping the Structural Core of Human Cerebral Cortex PLoS Biol 6(7): e159. doi:10.1371/ journal.pbio.0060159

Edit - History - Print - Recent Changes - Search
Page last modified on June 24, 2010, at 01:58 PM