This repository contains code for the manuscript:
Ahmed, Z., & Levesque, I. R. (2019). Pharmacokinetic modeling of dynamic contrast‐enhanced MRI using a reference region and input function tail. Magnetic Resonance in Medicine
A preprint is available in this gitlab repository.
The manuscript uses the constrained extended reference region model (CERRM) which is implemented in ./mfiles/CERRM.m while the reference region and input function tail (RRIFT) equation is implemented in ./mfiles/RRIFT.m.
The linearized extended Tofts model (ETM), which is used for comparison, is in ./mfiles/Tofts_LLSQ.m.
A short example on simulated data is in a00_quickExample.m.
The simulation scripts have filenames starting from b00 to b05.
Since some of the simulation steps are time consuming (~30 minutes), the resulting .mat files have been uploaded into an OSF repository.
If the four .mat files (begining with the filename sim) are downloaded from the OSF repository and placed in the data folder, then all of the even-numbered scripts can be skipped---i.e. you can run b01, b03, and b05 to produce the figures in the manuscript.
b00_makeSimMap.mmakes the 2D virtual phantom which contains 100 parameter combinations. This is used as a starting point for all the simulation.- The output file
simMap.matis in the OSF repository and should be placed in thedatadirectory
- The output file
b01_sketchOverview.mwill produce Fig. 1 in the manuscript- This script also performs a quick comparison with the reference tissue plus vessel (RTPV) technique and displays the results in the console/terminal
b02_mainSimAnalysis.mwill fit RRIFT and the ETM to the simulated data under a range of noise levels and temporal resolutions- The output file
simResults.matis in the OSF repository and should be placed in thedatadirectory
- The output file
b03_mainSimFigures.mwill produce Figs. 2 & 3 in the manuscriptb04_secondarySimAnalysis.mis similar tob02except the reference tissue parameters are also allowed to vary. For speed, only a temporal resolution of 15 s and noise of 0.02 mM is used, but this can be changed in the code- The output files are:
simResultsTRes15-varKtRR.matandsimResultsTRes15-varVeRR.mat. They should be placed in thedatadirectory.
- The output files are:
b05_secondarySimFigures.mwill produce Fig. 4 in the manuscript
The data can be downloaded from the cancer imaging archive under the TCGA-GBM collection, but since only a small subset of collection contains DCE-MRI data, the subset has been uploaded online on the OSF.
The OSF repository can be used in one of two ways:
- Download the DICOM data in the
TCGA-GBMfolder from the OSF repository, and then use the scriptx01_dicomReader.mto perform the T1 mapping and convert signal to concentration. - Alternatively, the results from the previous step can be downloaded by selecting the
TCGA-GBM-MATfolder from the same OSF repository and clicking on theDownload as zipbutton. Unzip the contents of the downloaded.zipinto the./data/TCGA-GBM-Matfolder---make the folder if it doesn't exist.
After either of the above two options, the final directory tree should resemble:
RRIFT/
├── data/
│ ├── Results/
│ ├── TCGA-GBM-Masks/
│ └── TCGA-GBM-Mat/
│ ├── Ct/
│ ├── DCE/
│ ├── hdr/
│ └── T1/
├── mfiles/
:
where the subfolders contain:
Ct/- the concentration-time dataDCE/- the signal-time data (i.e. acquired DCE-MRI data)hdr/- the DICOM headers for the DCE-MRI dataT1/- the T1 map computed from the variable flip angle data
For convenience, the output of most of the scripts is included within the github repository.
This means that the c01 script can be skipped, and all the other scripts should work without any additional steps.
c01_preprocessDCE.mgrabs the relevant information---e.g. AIF, tumour curves, muscle curve---and saves them as a.matfile for future steps- The output is stored in
./data/TCGA-GBM-Results/c01_preprocessed/
- The output is stored in
c02_doRRIFT.mfits RRIFT and the ETM to the in-vivo data and saves the results- The output is stored in
./data/TCGA-GBM-Results/c02_postprocessed/
- The output is stored in
c03_showResultsmakes Figs. 5, 8, S1, & S2 while additional features, such as noise, are reported in the consolec04_showResults_SinglePatientwas used for Figs. 6 & 7c05_doRRIFT_smallerTailslooks at the effect of reducing the tail duration, and produces a figure which was ultimately not included in the manuscriptc06_doRRIFT_downsampleddownsampled the in-vivo data and fits RRIFT and the ETM- The output is stored in
./data/TCGA-GBM-Results/c06_downsampled/
- The output is stored in
c07_showResults_downsampledmakes Fig. 10c08_showMaps_downsampled.mmakes Fig. 9