TBSS - Tract-Based Spatial Statistics - v1.0

Voxelwise analysis of multi-subject diffusion data

Intro   -   Running TBSS   -   Using non-FA images in TBSS


Introduction

There has been much recent interest in using magnetic resonance diffusion imaging to provide information about anatomical connectivity in the brain, by measuring the anisotropic diffusion of water in white matter tracts. One of the measures most commonly derived from diffusion data is fractional anisotropy (FA), which quantifies how strongly directional the local tract structure is. Many imaging studies are starting to use FA images in voxelwise statistical analyses, in order to localise brain changes related to development, degeneration and disease. However, optimal analysis is compromised by the use of standard registration algorithms; there has not been a satisfactory solution to the question of how to align FA images from multiple subjects in a way that allows for valid conclusions to be drawn from the subsequent voxelwise analysis. Furthermore, the arbitrariness of the choice of spatial smoothing extent has not been resolved. TBSS aims to solve these issues via a) carefully tuned nonlinear registration, followed by b) projection onto an alignment-invariant tract representation (the "mean FA skeleton"). TBSS aims to improve the sensitivity, objectivity and interpretability of analysis of multi-subject diffusion imaging studies.

For more information on TBSS, including a technical report, see the TBSS web page. If you use TBSS in your research, please make sure that you reference at least the first of the articles listed below, and ideally the complete list.


Referencing TBSS

Brief summary text: Voxelwise statistical analysis of the FA data was carried out using TBSS (Tract-Based Spatial Statistics, [Smith 2006]), part of FSL [Smith 2004]. TBSS projects all subjects' FA data onto a mean FA tract skeleton, before applying voxelwise cross-subject statistics.

More detailed summary text: Voxelwise statistical analysis of the FA data was carried out using TBSS (Tract-Based Spatial Statistics, [Smith 2006]), part of FSL [Smith 2004]. First, FA images are created by fitting the diffusion tensor to the raw diffusion data using FDT, and then brain-extracted using BET [Smith 2002]. All subjects' FA data are then aligned into a common space using the nonlinear registration IRTK [Rueckert 1999, www.doc.ic.ac.uk/~dr/software]. The mean FA image is then created and thinned to create a mean FA skeleton which represents the centres of all tracts common to the group. Each subject's aligned FA data is then projected onto this skeleton and the resulting data is fed into voxelwise cross-subject statistics.

[Smith 2006] S.M. Smith, M. Jenkinson, H. Johansen-Berg, D. Rueckert, T.E. Nichols, C.E. Mackay, K.E. Watkins, O. Ciccarelli, M.Z. Cader, P.M. Matthews, and T.E.J. Behrens.
   Tract-based spatial statistics: Voxelwise analysis of multi-subject diffusion data.
   NeuroImage, in press, 2006.

[Smith 2004] S.M. Smith, M. Jenkinson, M.W. Woolrich, C.F. Beckmann, T.E.J. Behrens, H. Johansen-Berg, P.R. Bannister, M. De Luca, I. Drobnjak, D.E. Flitney, R. Niazy, J. Saunders, J. Vickers, Y. Zhang, N. De Stefano, J.M. Brady, and P.M. Matthews.
   Advances in functional and structural MR image analysis and implementation as FSL.
   NeuroImage, 23(S1):208-219, 2004.

[Smith 2002] S.M. Smith.
   Fast robust automated brain extraction.
   Human Brain Mapping, 17(3):143-155, November 2002.

[Rueckert 1999] D. Rueckert, L. I. Sonoda, C. Hayes, D. L. G. Hill, M. O. Leach, and D. J. Hawkes.
   Non-rigid registration using free-form deformations: Application to breast MR images.
   IEEE Transactions on Medical Imaging, 18(8):712-721, 1999.


Running TBSS - Overview

Running TBSS first involves running a few simple steps/scripts:

We now go through the TBSS steps in detail.

0 - creating FA data from a DTI/DWI study

In order to run TBSS you need to create a single FA image from each subject in the study. We recommend that you do this using the dtifit tool in the FDT FSL toolbox.

1 - tbss_1_preproc

You now need to create a new, empty directory (folder) in which you will run the TBSS analysis, for example:
mkdir mytbss
Then copy into there all of your subjects' FA images, giving each subject's FA image a different name, for example resulting in:
cd mytbss
ls
  CON_N00300_dti_data_FA.nii.gz
  CON_N00302_dti_data_FA.nii.gz
  CON_N00499_dti_data_FA.nii.gz
  PAT_N00373_dti_data_FA.nii.gz
  PAT_N00422_dti_data_FA.nii.gz
  PAT_N03600_dti_data_FA.nii.gz
You are now nearly ready to run the first TBSS script, which will scale the FA values to be between 0 and 10000 and convert the format to uncompressed Analyze with positive voxel dimensions (because the nonlinear registration software IRTK requires this format). Before running the first TBSS script, you need to know approximately what the values in your FA data are (e.g. roughly in the range 0:1). If you created your FA data using dtifit in FDT then the data will indeed be roughly in the range 0:1. You can check this, for example, by:
avwstats CON_N00300_dti_data_FA -R
 0.000000 1.148992
If the range is close to 0:1 then the scaling applied by default by the first TBSS script (10000) is already correct. Otherwise, you need to tell the script what scaling to apply; for example, if your data is in the range 0:1000 then you need a scaling of 10, etc. Now run the script, from inside your working TBSS directory:
tbss_1_preproc
or, if you want to apply scaling <SCALE>, instead type:
tbss_1_preproc <SCALE>
The script will now scale and convert the data, placing it in a newly-created sub-directory called FAi. It will also create a sub-directory called origdata and place all your original images in there for posterity. At this point you can move onto the next script, but first it is probably worth checking the images as created in FAi. A quick way of doing this is with slicesdir, which allows you to create an overview webpage of a series of images, for quick checking of them all: type
slicesdir FAi/*.hdr
When it finishes running it gives you a link to open in a web browser to see quick views of all images, for checking that they look reasonable.

Note that the first 3 TBSS scripts (tbss_1_preproc, tbss_2_reg and tbss_3_postreg must all be run on computers of the same "type" (e.g. all 32-bit linux, or all 64-bit Apple); this is because the files used by the IRTK registration software don't always work the same on different computer hardware.


2 - tbss_2_reg

The next TBSS script runs the nonlinear registration, aligning all FA images to a 1x1x1mm standard space. The default behaviour of the script is to align every FA image to every other one, identify the "most representative" one, and use this as the target image. This target image is then affine-aligned into MNI152 standard space, and every image is transformed into 1x1x1mm MNI152 space by combining the nonlinear transform to the target FA image with the affine transform from that target to MNI152 space.

By default, therefore, this process can take a very long time, as you will have NxN nonlinear alignments, each of which can take 30 minutes or more on a typical computer. There are two ways of speeding this up - use multiple computers, and/or pre-specify which FA image to use as the target, in which case you just need N alignments.

To just run the script in default mode, type:

tbss_2_reg

Don't worry about warnings that say "Final transformation ERROR:: Empty image" - these occur when the script is registering an image to itself.

Running in parallel on multiple computers

If you have several computers that you can run the registration on, this is straightforward as long as they can all see the working data directory and are all of the same "type" (e.g. all 32-bit linux, or all 64-bit Apple); this is because the files used by the IRTK registration software don't always work the same on different computer hardware. In order to use multiple computers, simply log on to each (in a separate terminal window for each), cd to the TBSS working directory, and run the tbss_2_reg script. Each time the script is run it looks for registrations which still need running and, one at a time, runs those which haven't yet been done. Note that if you have computers with more than one CPU, you can open as many terminals as you have CPUs, and run the script in each one.

Once all the scripts have finished running, you are ready to move onto the next step.

Alternatively, if your lab has a batch submission system (e.g., SGE) then you may want to amend the TBSS script to take advantage of this - then all the registration jobs get submitted to the batch system for optimal processing. In this case, ask your system administrator to edit $FSLDIR/bin/tbss_2_reg and possibly edit the two lines starting with the one testing for "SGE_ROOT", in order to make the necessary submission to your batch system. In this case you only need to run the TBSS script once; this submits all the registrations to your batch system, and you need to watch for them all to complete before moving on to the next stage of TBSS.

Running with a pre-specified target FA image

The other thing you can do if you want to speed up the registrations is to pre-specify the target FA image, in which case you just have to run a single registration for each subject's FA image, i.e. each to the specified target. You also might choose to do this if for any other reason you have a particular wish to specify the target. We supply an example good quality target FA image with TBSS - it can be found in $FSLDIR/etc/standard/example_FA_target. To tell the TBSS registration script to use a target, copy the desired file into the FAi subdirectory in uncompressed Analyze format, calling it target.hdr / target.img and then run the registration script. (This target does not already need to be in standard space - that will be taken care of for you.) For example:

export FSLOUTPUTTYPE=ANALYZE
avwmaths_16SI $FSLDIR/etc/standard/example_FA_target FAi/target
tbss_2_reg

In this case the script will just register each subject's FA to the chosen target.


3 - tbss_3_postreg

The next TBSS script starts by deciding which of your FA images is the most "typical", for selection as the target image to apply all nonlinear transformations into the space of. (The script does this by taking each FA image in turn, and estimating the average amount of warping that was necessary to align all other images to it; it then finds the one that had the smallest amount of average warping when used as a target.) Obviously if you pre-specified the FA target image then this step is automatically skipped.

The script then takes the target and affine-aligns it into 1x1x1mm MNI152 space - this resolution is chosen as the later skeletonisation and projection steps work well at this resolution, and the choice of working in MNI152 space is chosen for convenience of display and coordinate reporting later. Once this is done, each subject's FA image has the nonlinear transform to the target and then the affine transform to MNI152 space applied, resulting in a transformation of the original FA image into MNI152 space (actually the two transformations are combined before being applied, to avoid having to resample the image twice).

This results in a standard-space version of each subject's FA image; next these are all merged into a single 4D image file called all_FA, created in a new subdirectory called stats. Next, the mean of all FA images is created, called mean_FA, and this is then fed into the FA skeletonisation program to create mean_FA_skeleton.

All of the above is done simply by running the script:

tbss_3_postreg

This finishes by reminding you to check whether a suitable threshold for the mean FA skeleton is 2000 (i.e., mean FA of 0.2 in the skeleton - the default used by the next script). For example, load the 4D FA data and the skeleton into FSLView:

cd stats
fslview all_FA mean_FA_skeleton

Then change the colourmap for the skeleton to say Red-Yellow, and set its display range to be 2000:8000. Now turn on the movie loop; you will see the mean FA skeleton on top of each different subject's aligned FA image. If all the processing so far has worked ok the skeleton should look like the examples shown in the TBSS paper. If the registration has worked well you should see that in general each subject's major tracts are reasonably well aligned to the relevant parts of the skeleton. If you set the skeleton threshold (in FSLView, the lower of the display range settings) much lower than 2000, it will extend away towards extremes where there is too much cross-subject variability and where the nonlinear registration has not been able to attain good alignments.


4 - tbss_4_prestats

The last TBSS script carries out the final steps necessary before you run the voxelwise cross-subject stats. It thresholds the mean FA skeleton image at the chosen threshold - it defaults to 2000 if you do not tell it an alternative one to use - hence either type:

tbss_4_prestats
or, if you want an alternative threshold <THRESH>, type:
tbss_4_prestats <THRESH>

The resulting binary skeleton mask defines the set of voxels used in all subsequent processing. Next a "distance map" is created from the skeleton mask. This is used in the projection of FA onto the skeleton (see the TBSS paper for more detail). Finally, the script takes the 4D FA image (containing all subjects' aligned FA data) and, for each "timepoint" (i.e., subject ID), projects the FA data onto the mean FA skeleton. This results in a 4D image file containing the (projected) skeletonised FA data. It is this file that you will feed into voxelwise statistics in the next, final, section.


5 - voxelwise statistics on the skeletonised FA data

The previous step resulted in the 4D skeletonised FA image all_FA_skeletonised (in the stats subdirectory). It is this that you now feed into voxelwise statistics, that, for example, tells you which FA skeleton voxels are significantly different between two groups of subjects.

One recommended way of doing the stats is to use the randomise tool. For more detail see the randomise manual. Before running randomise you will need to generate a design matrix file, e.g., design.mat and contrasts file, e.g., design.con. You can use the script design_ttest2 in the simple case of a two-group comparison. Alternatively you can use the Glm GUI to generate these design matrix and contrast files. Note that the order of the entries (rows) in your design matrix must match the alphabetical order of your original FA images, as that determines the order of the aligned FA images in the final 4D file all_FA_skeletonised; check this with:

cd FAi
ls -1 *FAi.hdr

For example, say you have 7 controls (with original filenames CON_001_dti_FA.nii.gz etc.) and 11 patients (with original filenames PAT_001_dti_FA.nii.gz etc.). You can generate design files and run voxelwise statistics and inference using randomisation, including cluster-based thresholding, using:

cd ../stats
design_ttest2 design 7 11

randomise -i all_FA_skeletonised -o tbss -m mean_FA_skeleton_mask -d design.mat -t design.con -n 5000 -c 3 -V

fslview MNI152 mean_FA_skeleton -l Green -b 2000,8000 tbss_tstat1 -l Red-Yellow -b 3,6 tbss_tstat2 -l Blue-Lightblue -b 3,6

In this case, contrast 1 gives the control>patient test and contrast 2 gives the control<patient test. The raw (unthresholded) tstat images are tbss_tstat1 and tbss_tstat2 respectively. The cluster p-value images (fully corrected for multiple comparisons across space) are tbss_maxc_tstat1 and tbss_maxc_tstat2 (note, these are actually 1-p for convenience of display, so thresholding at .95 gives significant clusters).


Using non-FA Images in TBSS

It is straightforward to apply TBSS to other diffusion-derived data than FA images. For example, you may be interested in how MD (mean diffusivity) or the first diffusion tensor eigenvalue varies between different subjects.

To achieve this we recommend using the FA images to achieve the nonlinear registration and skeletonisation stages, and also to estimate the projection vectors from each individual subject onto the mean FA skeleton. The nonlinear warps and skeleton projection can then also be applied to other images such as the second eigenvalue. The following instructions assume that you want to run TBSS on the second eigenvalue, named L2 by dtifit:


Copyright © 2005-2006, University of Oxford. Written by S. Smith.