TBSS - Tract-Based Spatial Statistics - v1.1

Voxelwise analysis of multi-subject diffusion data

Intro   -   Running TBSS   -   Using non-FA images   -   Displaying TBSS results
Transforming TBSS results back to native space   -   What's new in this version


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 were created by fitting a tensor model to the raw diffusion data using FDT, and then brain-extracted using BET [Smith 2002]. All subjects' FA data were then aligned into a common space using the nonlinear registration IRTK [Rueckert 1999, www.doc.ic.ac.uk/~dr/software]. Next, the mean FA image was 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 was then projected onto this skeleton and the resulting data 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, 31:1487-1505, 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 - create FA data from a diffusion MRI 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 tools in the FDT FSL toolbox; in brief:
1. Correct your original data for the effects of head movement and eddy currents using eddy_correct
2. Create a brain mask by running bet on one of the B=0 (no diffusion weighting) images
3. Fit the diffusion tensor model using dtifit

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. You will make later analysis easier if you name the images in a logical order, for example so that all controls are listed before all patients:
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:
fslstats CON_N00300_dti_data_FA -R
 0.000000 1.148992
If the range is close to 0:1 then the default scaling of 10000 will be 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 *
(the * expands to the list of input images). Or, if you want to apply scaling <SCALE>, instead type:
tbss_1_preproc -f <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.

Finally, the script runs slicesdir, which creates an overview webpage containing a static view of each of the preprocessed input images, so that you can then quickly view each of them for obvious problems.


2 - tbss_2_reg

The next TBSS script runs the nonlinear registration, aligning all FA images to a 1x1x1mm standard space. The target image used in the registrations can either be a pre-defined target, or can be automatically chosen to be the most "typical" subject in the study.

In general we recommend using the FMRIB58_FA standard-space image as the target in TBSS. This involves carrying out just one registration per subject and generally gives good alignment results. This option is applied by using the -T flag. Alternatively, you can supply your own target image by using the -t option.

The third option 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. This option is selected by using the -n flag, and is the recommended option if you need to generate a study-specific, for example if the subjects are all young children (and hence the adult-derived FMRIB58_FA target is inappropriate).

Direct registration to the high resolution FMRIB58_FA image takes about 5 hours x N subjects (when running on a single computer). In comparison, the all-subjects-to-all-subjects option takes about 20 minutes x N x N. Hence the latter approach can take much longer to run than the former. In either case, you can speed up the registrations by using multiple computers. This is now described in detail:

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.


3 - tbss_3_postreg

The next TBSS script applies the nonlinear transforms found in the previous stage to all subjects to bring them into standard space.

If the previous stage was run with the -n option (find the most typical subject as the target), then this script first needs to make the decision about 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).

The above 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 -S

Alternatively, if you wish to use the FMRIB58_FA mean FA image and its derived skeleton, instead of the mean of your subjects in the study, use the -T option:

tbss_3_postreg -T

In general we would recommend using the -S option (derive the mean FA and skeleton from the actual subjects you have).

The script finishes by telling 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 Green, 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 here (see the TBSS paper for more examples of different subjects' results underneath the skeleton). 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. Remember the skeleton threshold for the next stage.


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 - a common value that works well is 2000 (see above). To run, type:

tbss_4_prestats 2000
replacing the 2000 with another value if you need to change it.

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 all_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 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:


Displaying TBSS Results

In this section we give some hints on how to present TBSS results. You might want to use either the MNI152 background image or your mean_FA study-specific image - or you may want to show TBSS results on top of both. If you use your mean_FA image as the background, make sure that you set a good display range, for example 0:6000. For the rest of this section we'll assume that you want to show results on top of the MNI152 image and hence start by loading MNI152 into FSLView.

You will probably next want to load the mean_FA_skeleton image on top of your background image, to show where the skeleton was estimated, and which standard-space voxels were tested in the multi-subjects statistics. Load mean_FA_skeleton into FSLView and set its display range correctly. The lower threshold must be set to the threshold that you used in the TBSS analysis, for example 2000. The upper level should probably be set to something like 7000, so that you can see variation in mean FA values within the skeleton. You probably want to change the colourmap, for example to Green, and increase the transparency (with the transparency slider) so that when you load the stats image in, it is easier to see.

Finally, load the stats image in. If you have used cluster-based testing in randomise, the raw t-statistic image will be named something like tbss_tstat1 (which you could view to see raw tstats before significance testing), but the image you probably want is tbss_maxc_tstat1, which is the p-value image (actually the values in this image are 1-p for ease of display, so that bigger is "better"). Load this into FSLView, set a colourmap such as Red-Yellow, and set the display range to something like 0.95:1, which corresponds to thresholding the results at p<0.05.

All of the above (apart from setting the skeleton transparency, which has to be done by hand in the GUI) can be carried out with a single command (see first example image):

fslview MNI152 mean_FA_skeleton -l Green -b 2000,7000 tbss_maxc_tstat1 -l Red-Yellow -b 0.95,1

Alternatively, although showing the stats results on the TBSS skeleton is a true representation of the actual analysis carried out, some people find it easier to visualise the results if the skeletonised results are "thickened" somewhat. In order to make such a presentation easy, there is a script tbss_fill, which thickens the thresholded stats image, filling it out into the local "tracts" seen in mean_FA. For example, to apply this to the same example as above and then view in FSLView on top of the mean_FA image, run:

tbss_fill tbss_maxc_tstat1 0.95 mean_FA tbss_fill
fslview mean_FA -b 0,6000 mean_FA_skeleton -l Green -b 2000,7000 tbss_fill -l Red-Yellow


Transforming TBSS results back to native space

It is possible to take one or more voxels on the mean FA skeleton and show where, in each subject's Fa image, those voxels originally came from. This "back projection" is composed of up to three steps. First, the skeleton voxel is projected back from its position on the skeleton to the nearby position at the centre of the nearest tract in the subject's FA image in standard space (i.e., after the FA image had been nonlinearly registered to the target image). Second, this point can then be "inverse warped" back into the subject's native space, by inverting the nonlinear registration that was originally applied. Finally, the native space image can be padded by a single slice on each side of the image cuboid, to match the original native space data (these end slices were removed when the data in FAi was originally created). The whole process can be viewed thus:

There are two obvious reasons why you might want to back-project a skeleton-space voxel (or voxels). The first is to confirm that a given skeleton point was derived from the correct tract-centre points in all subjects. This can generally be achieve by just taking the first of the back projection steps, from the skeleton to the space of the all_FA data, and viewing the back-projected points on top of all_FA (looking at each subject, i.e., timepoint, separately). The second is to take a skeleton-space voxel or set of voxels (for example, a skeleton-space blob that is significantly different between the two groups of subjects in the study) back to the space of the original subjects' data, in order to run tractography for each subject, with that result forming the tractography seed mask.

Option 1: just deproject <skeleton-space-input-image> onto the space of each nonlinearly registered subject in all_FA

For an example of confirming the final tract-centre projection stage, first form an image containing significant voxels from a previous randomise-based statistical analysis of the skeletonised data:

fslmaths tbss_maxc_tstat1 -thr 0.95 grot
tbss_deproject grot 1
fslview all_FA grot_to_all_FA -l Red-Yellow

The 1 tells the script to just apply stage 1 of the de-projections, i.e. from skeleton space to the all_FA space. This lets you view the interesting skeleton-space voxels in the space of each subject's standard space (nonlinearly registered) FA image - as you move through the timepoints in FSLView you see each subject in turn.

Option 2: do the first step and also invert the nonlinear warping, to get back to subjects' native space in FAi

For an example of complete back-projection to the space of the native data in FAi, run the following, first making sure you run the command from within the stats directory. The 2 flag tells the script to take the back-projection back to the native space:

tbss_deproject grot 2

This results in a separate output for each subject in the stats directory. For example, if your first subject was called subject_001, you would view the results (if you are in the stats directory), with:

fslview ../FAi/subject_001_FAi subject_001_FAi_grot -l Red-Yellow

Option 3: do the first two steps and also pad the end slices to get back to the subjects' native space in orig

If, instead, you want the final output in the original subject's native space (this is very similar to the native space in FAi, just with the end slices left in):

tbss_deproject grot 3
fslview ../orig/subject_001 subject_001_orig_grot -l Red-Yellow

This is probably the space you want to transform grot into if you are going to use the result to seed tractography analysis.

Finally, you can add the -n flag to the end of the tbss_deproject command to tell the transformations of your original skeleton voxels to use nearest-neighbour interpolation instead of trilinear. The advantage of trilinear is that you get a more continuous interpolation of the skeleton voxels into native space; the advantage of nearest-neighbour is that the exact skeleton-space values are maintained, which might be important, for example, if they are cluster index numbers.


What's new in this version

v1.1

This version introduced a standard-space mean FA image (FMRIB58_FA) for use as the target in the initial nonlinear registration. This now becomes the recommended target for the nonlinear registrations, instead of registering every subject to every other subject, and choosing the most typical. All scripts are updated to allow either way of running the registrations.

Script tbss_fill is added to allow "thickening" of results for ease of display.

Script tbss_deproject is added to allow back-projection of skeleton-space voxels into all_FA and native FA spaces.

v1.0

Original TBSS release.


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