Home

Fitting Single Voxel Data

This mini practical does not cover a particular example box, but it aims to consolidate a lot ot the material introduced in Chapter 4. As with all these mini-practicals, instructions on how to run FSL commands can be found on the Getting Started page.

Please download the dataset for this example here:

Data download

Once it is downloaded, move it to your preferred working directory and unzip it there.

unzip data_ch4_svs.zip
cd  data_ch4_svs

Fitting

This is where we use the set of simulated metabolite spectra, alongside a model, to fit our SVS data. We will use data that has already been processed (cleaned up). See the processing practicals if you want to learn how to do that.

FSL-MRS has a command-line interface (fsl_mrs) that allows for fitting. Let us begin with a simple call to the program, we need to provide the SVS water-suppressed data, the basis spectra, and an output folder name. Here we will also ask the program to output a HTML interactive report to easily and interactively visualise the output.

fsl_mrs --data metab.nii.gz \
        --basis basis \
        --output fsl_mrs_fit \
        --report

The fitting should not take too long. After it has finished, open the report in a web browser (you can replace "firefox" with your favourite browser).

firefox fsl_mrs_fit/report.html

Take a few minutes to look through all the sections in the report. You should be able to interact with all the plots/figures. For example, starting with the spectral fitting (the first plot), try to zoom in and out, toggle the different traces on and off. You should be able to see that the fitting is good within a specific spectral range, but bad outside of this range (hint: use the 'Autoscale' button on the top-right of the plot). This range can be chosen in the command line tool, and what you can see is the default value for this range.

Try also to look at the table and understand the different columns.

Which metabolite is fitted with the highest certainty (lowest uncertainty)?
Incorrect! GABA is typically difficult to fit, although it is not so bad in this high SNR 7T data, it is still not as good as NAA or Cr.
Correct! NAA has the lowest %CRLB, which is relative uncertainty. We could also tell by looking at the QC table (SNR column)
Incorrect! Comparing the CRLB, %CRLB, or SNR we can see that different metabolites are fitted with different degrees of confidence. This is due to a combination of how abundant they are and what their spectral profile looks like relative to other metabolites.

Looking at the first table in the report, you may notice that the metabolite concentrations have no units. This doesn't look very quantitative... We do have relative concentrations (relative to total creatine), but ideally we would like to have absolute concentration. For this, we need to use the water spectrum as a reference (the file wref.nii.gz).

But to get even more accurate absolute concentrations, we need to account for the fact that our single voxel might contain different tissue types with different relaxation properties.

To account for these partial volume effects, usually a T1-weighted structural image is acquired and processed to segment grey/white/csf. This has already been done for you using fsl_anat, an FSL tool for processing anatomical data.

To provide the fitting script with information on partial volume, we need to run svs_segment. This can take as an input the result of running fsl_anat as well as the SVS data so as to figure out how much partial volume there is in the MRS voxel. Look at the help for svs_segment to figure out how to run it (the diagram below might help). Or click below to reveal the command.

*Reveal command

digraph G { rankdir=LR node [shape=box]; 1 [label="SVS file"]; 2 [label="ANAT folder"]; 3 [label="OUTPUT"]; 4 [label="svs_segment: calculate partial volume within SVS voxel"]; 1 -> 4; 2 -> 4; 4 -> 3; }

Now you should have a segmentation.json file with the partial volume information. We could also have specified our own name for this file (--filename) instead of, or in addition to, specifying the output folder.

We are ready to do the quantitative fitting. Here is a graph summarising the input/output to the fitting:

digraph G { rankdir=LR node [shape=box]; 1 [label="SVS file"]; 2 [label="basis folder"]; 3 [label="output folder"]; 4 [label="t1 image"]; 5 [label="water reference"]; 6 [label="tissue fractions"]; 7 [label="fsl_mrs"]; 1 -> 7; 2 -> 7; 4 -> 7; 5 -> 7; 6 -> 7; 7 -> 3; }

Run the command below which implements the graph above:

fsl_mrs --data metab.nii.gz \
        --basis basis \
        --output fsl_mrs_quant \
        --t1 T1.nii.gz --tissue_frac segmentation.json \
        --h2o wref.nii.gz \
        --report

Note that we added the H2O data for quantification as well as the tissue fractions. We also included a T1 but that is only used for display in the report. Now let us look at the report.

firefox fsl_mrs_quant/report.html

You should be able to see some new sections in the report, such as the location of the SVS voxel in the brain, information on the volume fractions, and on the water referencing. Importantly, you should be able to see that the concentrations now come with a physical unit (mMol/kg).

Browse through the output folder to see the different output files. In particular, note that all the parameters that are listed as tables in the report are also stored as CSV files for further automated processing.


Interpreting SVS Fits

Let us dive into a little bit more details in the fitting results. For example, we might want to ask how correlated the metabolite concentration parameters are. A high correlation means that, given the data, the metabolites predict very similar looking spectra, and so it is difficult to disentangle them and they might better be considered jointly.

Which two metabolites appear to be highly correlated?
Incorrect!
Incorrect!
Correct!

To answer the question above, it is useful to look at the section in the report called "Uncertainty". The matrix shown represents correlations between the various metabolite concentration parameters.

Now let us look at the section called "Individual metabolite estimates". The different colour traces represent the model prediction of the spectra arising from individual metabolites (including the baseline). These are summed to form the full model prediction.

In the legend, double-click on the (black / grey) data entry. Then single-click on Cr and PCr to display their estimated contributions. Can you see why these metabolites were highly negatively correlated? Reveal answer

At this point you could do several things to refine the fit.

  1. If you suspect that there is no sensitivity to a particular metabolite due to very high uncertainty, you could exclude it from the fitting process altogether. For example in this data Ala and Glc have high uncertainty, and they could be excluded by adding --ignore Glc Ala to the call to fsl_mrs.
  2. Other peaks apart from Cr&PCr have high negative correlation, particularly PCh and GPC. You can make the results combine these peaks by adding --combine PCh GPC
  3. Finally, the baseline could be made more or less flexible, depending on the quality of fit. This can be done by using the --baseline flag. You can increase the order of the polynomial baseline (which is the default), or you can try one of the more flexible spline baselines. This is not particularly needed in this dataset, but can be useful e.g. when you have lipid contamination.


The End!