BENCH Practical

In this practical, you will discover how to use bench to investigate changes in brain microstructure between two subject groups using diffusion MRI. For an introduction to the fundamental concepts of change models, please refer to the BENCH paper or the BENCH training tutorial. Briefly, BENCH estimates the likelihood that a change in every parameter of a biophysical model can account for observed differences in the diffusion data.

Here we will employ BENCH to compare brain microstructure in 4 young subjects against 4 older subjects. Our goal is to identify regions in the brain where microstructural parameters vary with ageing. We use the standard model of white matter microstructure as our biophysical model.

Contents:

To conduct inference using BENCH, you will need to follow these steps:

Training Change Models
Using simulations to train machine learning models that can predict change in diffusion data
Extracting Summary Measurements
Estimating rotationally invariant features from cleaned diffusion MRI data
GLM
Running a General Linear Model to estimate the baseline values and changes in the summary measurements
Inference
Estimating the probability and amount of change in each parameter
digraph G { rankdir=LR node [shape=box]; 1 [label="Clean diffusion data (data)"]; 2 [label="White matter (ROI) mask in template space (mask)"]; 3 [label="List of b-values (bvals)"]; 4 [label="List of gradient orientations (bvecs)"]; 5 [label="Transformations from diffusion to template space (xfm)"]; 6 [label="bench diff-summary"]; 7 [label="Forward model (model)"]; 9 [label="bench diff-train "]; 10 [label="Summary measurements per subject"]; 11 [label="bench glm"]; 12 [label="Change models"]; 13 [label="bench inference"]; 14 [label="Baseline"]; 15 [label="Group difference"]; 16 [label="Design and contrast matrices"]; 17 [label="Change probability maps"]; 18 [label="Noise covariance"] 19 [label="Amount of change maps"]; 1 -> 6; 2 -> 6; 3 -> 6; 4 -> 6; 5 -> 6; 3 -> 9; 7 -> 9; 6 -> 10; 9 -> 12; 10 -> 11; 16 -> 11; 2 -> 11; 11 -> 14; 11 -> 15; 14 -> 13; 15 -> 13; 12 -> 13; 13 -> 17; 11 -> 18; 18 -> 13; 13 -> 19 }

Training Change Models

The first step in using BENCH is to train machine learning models known as "change models". These models aim to predict how changes in parameters of a biophysical forward model will affect diffusion MRI data. To train these models, BENCH utilizes simulations to generate the necessary training data. Once these change models are trained, they can be applied to investigate whether a specific parameter change can account for observed differences between groups. It is important to highlight that running this initial step does not require any diffusion data and only requires knowing the acquisition protocol and the forward biophysical model. To train a change model, you can execute the following command:

bench diff-train --model standard_model --bvals dataset/001/Diffusion/bvals --summarytype dt --output standard_model_dt 

In this command:

For an in-depth explanation of these options or to learn how to implement your own specific forward model, please see the BENCH training tutorial.

Training a change model can be a time-consuming process, potentially taking several hours. The duration depends on factors such as available computational resources, the specifics of the diffusion protocol, the number of samples used for training, etc. However, once the model is trained, it can be reused on any dataset that employs the same diffusion acquisition protocol, saving time in future analyses. To save time, we provide a pre-trained model for this acquisition which you can use for this tutorial.

What are the parameters of the `standard model` of diffusion and what does each parameter represent?


What does a change model estimate?
Incorrect!
Incorrect!
Correct! Bench estimates the regression weights that predict how the diffusion data may change as a result of a change in each of the parameters. This includes the average and also uncertainty of change.

Extracting summary measurements

Using diffusion MRI signals directly to investigate brain microstructural changes presents two challenges: the high dimensionality of the data and the complexity arising from tissue orientation and acquisition protocol. BENCH addresses these issues by employing signal "representations", e.g., Diffusion Tensor or Spherical Harmonics. These models transform the diffusion data into summary measurements to provide metrics that are invariant to tissue orientation, thus simplifying analysis.

For example, metrics such as mean diffusivity and fractional anisotropy can be used to summarize the diffusion data within each shell. These metrics offer the advantage of being rotationally invariant, meaning they remain consistent regardless of the tissue orientation or the orientation of head in the acquisition.

To extract summary measurements from the diffusion MRI data, use the following command after changing the directory to the bench folder:

cd ~/fsl_course_data/bench

bench diff-summary --data dataset/001/Diffusion/data.nii.gz \
                   --bvecs dataset/001/Diffusion/bvecs \
                   --bvals dataset/001/Diffusion/bvals \
                   --mask wm_mask_2mm.nii.gz \
                   --xfm dataset/001/xfms/diff2standard_warp.nii.gz \
                   --summarytype dt \
                   --output summaries/001

In this command:

An alternative option for the summary measurements is to use spherical harmonics deconvolution that is analogous to a fourier transform for signals defined on the surface of a unit sphere. To try this option you can use the --summarytype flag both in the training and in summary extraction section.

It is worth mentioning that BENCH uses nearest-neighbor sampling to compute summary measurements for each voxel in the mask from the diffusion data. This approach avoids the need for spatial transformations, which can be costly for diffusion data, and also eliminates the need to adjust b-vectors.

Now open one of the subject's summary measurement files in FSLEYES using the following command:

fsleyes summaries/001/* &

What do these summary measurements represent?
Incorrect!
Correct! The summary measurements are independent of the biophysical model. They are meant to capture information from the data which is then used to see how changes in the biophysical model affect changes in the summary metrics.




Summary Extraction for Multiple Subjects

For single-subject processing, you would execute the above command. However, to compute summary measurements for all 8 subjects in our example, you can use a bash for loop:

for i in $(seq 1 8); do
    bench diff-summary --data dataset/00$i/Diffusion/data.nii.gz \
                       --bvecs dataset/00$i/Diffusion/bvecs \
                       --bvals dataset/00$i/Diffusion/bvals \
                       --mask wm_mask_2mm.nii.gz \
                       --xfm dataset/00$i/xfms/diff2standard_warp.nii.gz \
                       --summarytype dt \
                       --output summaries/00$i
done
Using a Cluster for Batch Processing:

If you have access to a computing cluster, you can employ the submit-summary sub-command to batch-submit these jobs for more efficient processing. This sub-command uses file-tree to parse the input for all subjects.

Running the GLM

After extracting these rotationally invariant summary measurements for each subject, ensuring they are all in the template space, you can proceed to run a General Linear Model (GLM) analysis. This will allow you to calculate the baseline signal, the differences between the two groups, and the covariance of the noise. Armed with this information, you will be ready to quantify how the microstructural changes relate to changes in the diffusion data between the groups.

To perform a GLM analysis, use the following command:

bench glm --summarydir summaries \
          --mask wm_mask_2mm.nii.gz \
          --designmat design.mat \
          --designcon design.con \
          --subjectlist subjlist.txt \
          --output Glm

In this command:

Now you can explore the changes in summary measurements across the brain attributed to group differences using the following command:

fsleyes Glm/change.nii.gz --cmap red-yellow --negativeCmap blue-lightblue --useNegativeCmap -dr 0 .1 &

Change the volume number and modify the data range as needed to examine how each summary measurement has changed. The corresponding names of the summary measurements can be found in the text file ./Glm/summarynames.txt.

What are the main outputs of bench glm?
Incorrect!
Correct!
Incorrect!

When training the change models, we generate simulated diffusion data. However, this simulation process doesn't account for the data's scale, which can be influenced by factors such as the scanner, bias field, etc. Therefore, it is essential to normalise the baseline measurements to align with the scale of the training data. Similarly, we must also normalise the change and the estimated noise covariance matrix. For diffusion tensor summary measurements, this process entails dividing the change's b0_mean by the baseline b0_mean. This normalisation is automatically carried out during the inference step.

Running Inference

Now we are set for the main analysis. We have estimates of how the diffusion data varies between our two groups, namely old versus young. Additionally, we have trained machine-learning models using simulations to understand how changes in microstructural parameters can influence the data. By combining these elements, we can explore which types of changes in our data across the brain best align with which of these trained change models.

To execute the inference step, use the following command:

bench inference --changemodel standard_model_dt --glmdir Glm --mask slice_mask_2mm.nii.gz --output Results

In this command:

This step generates two key outputs for each parameter of the forward model:

  1. A probability map that displays, for each voxel, the normalised likelihood that the parameter can explain the observed differences in the diffusion MRI data between the groups.
  2. An estimate of the most likely amount of change for that parameter.

These outputs help to quantify and localize where specific microstructural changes can account for observed group differences.

Now you can look at the final probability maps to see to what extent each parameter can explain the group differences in the summary measurements from diffusion MRI data using the following command:

fsleyes Results/*_probability.nii.gz --cmap red-yellow -dr 0 1 &

It is also possible to check the most likely amount of change in each parameter using the following command:

fsleyes Results/*_amount.nii.gz --cmap red-yellow --negativeCmap blue-lightblue --useNegativeCmap &

However, keep in mind that these estimates are only meaningful if the model can confidently explain the change. Also, they are mutually exclusive; i.e. only one can be true at each voxel.

Moreover, in order to see what parameter change can best explain differences between the groups you can run the following command:

fsleyes Results/inferred_change.nii.gz --cmap random &

The labels for each number are based on the order of parameters in Results/model_names.txt

What do the numbers in the s_iso_probability.nii.gz file represent?
Incorrect! The possible estimated change in the parameters are given in the s_iso_amount.nii.gz file.
Correct!
How dare you!


Is there any relationship between the numbers in "param_name"_prob.nii.gz files?

The End.