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
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.
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
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:
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.
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.
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.
--ignore Glc Ala to the call to
fsl_mrs.--combine PCh GPC--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!