QMRTools : a Mathematica toolbox for quantitative MRI analysis

QMRITools is written in Mathematica using Wolfram Workbench and Eclipse and contains a collection of tools and functions for processing quantitative magnetic resonace imaging (qMRI) data. The toolbox does not provide a GUI and its primary goal is to allow for fast and batch data processing, and facilitate development and prototyping of new functions. The core of the toolbox contains various functions for data manipulation and restructuring.

The toolbox includes some demo data that is used in the demo file demo.nb.In this notebook, most of the functionality of the toolbox is demonstrated.A full list of functions and packages can be found in the file All-Functions.nb (also availible as pdf).For all functions and toolboxes, help files and guides are available and the documentation is built using workbench making it available in the Wolfram documentation.

Toolboxes CardiacTools
A collection of tools to analyze cardiac data.The main features are cardiac shape analysis that defines the heart in a local myocardial coordinate system which allows quantifying and analyzing data.When the cardiac geometry is known there are functions to analyze qMRI parameters in the AH17 model (Cerqueira et al., 2002) or perform transmural sampling of quantitative MRI parameters.Most of the functionality is demonstrated in the demo.nb.

CoilTools
A collection of tools to evaluate complex multi-coil data.The functions are specific for analysis of multi-coil magnitude and noise data which allows quantifying per channel signal to noise ratio (SNR).Furthermore, if complex coil sensitivity maps are available it allows performing SENSE g-factor maps simulations.This toolbox is not demonstrated in the demo.nb.

DenoiseTools
The toobox provides two algorithms that allow denoising of DWI data.The first is based on and linear min-imum mean square error (LMMSE) framework (Aja-Fernandez et al., 2008), the second is based on a random matrix theory and Principal component analysis framework (Veraart et al., 2016a(Veraart et al., , 2016b)).Furthermore, it provides an anisotropic filter for denoising the estimated diffusion tensor which provides more reliable fiber orientation analysis (Lee, Chung, & Alexander, 2006).Most of the functionality is demonstrated in the demo.nb.

DixonTools
An iterative decomposition of water and fat with echo asymmetry and least-squares estimation (IDEAL) based Dixon reconstruction algorithm (Reeder et al., 2005;Yu et al., 2008).The method provides multi-peak fitting B0 field and T2* correction.The toolbox also provides a function for unwrapping phase data in 2D and 3D based on a best path method (Abdul-Rahman et al., 2007;Herraez et al., 2002).It also contains a function that allows simulating gradient echo Dixon data.Most of the functionality is demonstrated in the demo.nb.

ElastixTools
A wrapper that calls the Elastix registration framework (Klein et al., 2010;Shamonin, 2013).The toolbox determines what registration or transformations need to be performed, exports the related data to a temp folder and calls an automatically generated command line script that performs the registration.After registration is completed the data is again loaded into Mathematica.Most of the functionality is demonstrated in the demo.nb.

GeneralTools
This toolbox provides core functions used in many other functions and features.The functions comprise amongst others: data cropping, mathematical and statistical operators that ignore zero values, and data rescaling, transformation and padding.Most of the functionality is demonstrated in the demo.nb.

GradientTools
The main feature is an algorithm that uses static repulsion (M.Froeling et al., 2017;Jones, Horsfield, & Simmons, 1999) to generate homogeneously distributed gradient directions for DWI experiments.It also provides functions to convert bval and bvec files to bmatrix and vice versa.Most of the functionality is demonstrated in the demo.nb.

ImportTools
Allows importing Dicom data or Dicom header attributes.These functions are rarely used since the toolbox mostly uses the NIfTI data format and provides tools to convert Dicom to NIfTI via dcm2niix.This toolbox is not demonstrated in the demo.nb.

IVIMTools
The toolbox includes functions to perform intra voxel incoherent motion (IVIM) fitting of diffusion weighted imaing (DWI) data.There are two main functions: non linear fitting and Bayesian fitting (Orton, Collins, Koh, & Leach, 2014).Some of the functionality is demonstrated in the demo.nb.

JcouplingTools
A toolbox that allows simulation of NMR spectra using Hamiltonians based on methods from FID-A.It allows simulating large spin systems (Castillo, Patiny, & Wist, 2011) and was mainly implemented to investigate fat spectra in multi echo spin echo acquisition (Stokes, Feng, Mitropoulos, & Warren, 2013).Most of the functionality is demonstrated in the demo.nb.

MaskingTools
Tools for masking and homogenization of data.It provides functions for smoothing cutting and merging masks and functions for the evaluation of data within masks.Most of the functionality is demonstrated in the demo.nb.

NiftiTools
Import and export of the NIfTI file format.Part of the code is based on previously implemented nii-converter.For converting DICOM data to the NIfTI file format the toolbox uses dcm2niix.It also provides some specialized NIfTI import functions for specific experiments which are probably not generalizable.Most of the functionality is demonstrated in the demo.nb.

PhysiologyTools
Functions for importing and analyzing Philips physiology logging and RespirAct trace files.The functions are rarely used and not well supported.This toolbox is not demonstrated in the demo.nb.

PlottingTools
A variety of functions for visualization of various data types.The main functions are 'PlotData' and 'PlotData3D' which allow viewing 2D, 3D and 4D data.Most of the functionality is demonstrated in the demo.nb.

ProcessingTools
The toolbox comprises a variety of functions that allow data manipulation and analysis.The main functions allow joining multiple data sets into one continuous data set (M. Froeling et al., 2015) or to split data of two legs into two separate data-sets.Furthermore, it contains a collection of functions for data evaluation and analysis.Most of the functionality is demonstrated in the demo.nb.

RelaxometryTools
A collection of tools to fit T2, T2*, T1rho and T1 relaxometry data.The main function of this toolbox is an extended phase graph (EPG) (Weigel, 2015) method for multi-compartment T2 fitting of multi-echo spin echo data (Marty et al., 2016).Therefore it provides functions to simulate and evaluate EPG.Some of the functionality is demonstrated in the demo.nb.

SimulationTools
The main purpose of this toolbox is to simulate diffusion tensor imaging (DTI) based DWI data and contains some functions to easily perform analysis of the fit results of the simulated signals (M.Froeling et al., 2013).Some of the functionality is demonstrated in the demo.nb.

TensorTools
The original toolbox where the project started.The main functions in this toolbox are to fit and evaluate the diffusion tensor model.Various fitting methods are implemented (e.g.LLS, NLS, WLLS, and iWLLS).The default method is an iterative weighted linear least squares approach (Veraart, Sijbers, Sunaert, Leemans, & Jeurissen, 2013).The tensor fitting also includes outlier detections using REKINDLE (C.M. Tax, Otte, Viergever, Dijkhuizen, & Leemans, 2015) and data preparation includes drift correction (Vos et al., 2017).Most of the functionality is demonstrated in the demo.nb.

VisteTools
Import and export functions for tensor data which can be used in the vIST/e tractography tool.None of the functionality is demonstrated in the demo.nb.

Figure 1 :
Figure 1: An overview of some of the functionality in the QMRITools Mathematica add-on.

Figure 2 :
Figure 2: IDEAL based Dixon reconstruction: fitted fat fractions as a function of the imposed fat fraction, SNR and B0 field offset.

Figure 3 :
Figure 3: The graphical user interface of the gradient generation tool.

Figure 5 :
Figure 5: Demonstration of EPG based T2 fitting: the fitted water T2 relaxation as a function of B1, SNR and fat fraction.

Figure 6 :
Figure 6: MD and FA as a function of SNR and fat fraction.Results are from simulated data using an iWLLS algorithm with outlier rejection.