This repository contains constrained weighted linear least squares and nonlinear solvers for problems that can be cast as y = exp(A*x).
This includes, but is not limited to, T2(*) mapping, Diffusion Tensor Imaging (DTI), Diffusion Kurtosis Imaging (DKI), Q-space Trajectory Imaging (QTI), ...
Modality-specific demonstrations can be found at: demo_{t2,dti,dki,qti}.m
The general work-flow is demonstrated below using QTI as an example:
- Reading data (this example uses MRtrix .mif files):
[y,vox,v2w,grad] = MRtrix.readToMatlab('dwi.mif'); % DWI data
mask = MRtrix.readToMatlab('mask.mif'); % processing mask
- Applying a mask to avoid calculations in the background:
y = Volumes.mask(y,logical(mask)); % sets all voxels outside the mask to NaN
- Creating a model instance. Note that this can be any of T2, DTI, DKI and QTI:
model = QTI(grad);
Note that the above constructor creates a model instance backed by a constrained iteratively reweighted linear least squares solver with default constraints, which is fine for most applications. The solver/constraints can be modified by supplying additional name/value pairs to the constructor (default in bold):
- to set the type of estimator to be used:
'estimator', 'lls/wlls/nls'
- to set the type of initialization for WLLS weights (log of the raw data (data) or unweighted (ones)):
'init_weight', 'data/ones'
- to set the number of iterative reweightings for WLLS:
'iter', 2
- to modify the constraints that are enforced (non-neg diffusivity, non-neg total kurtosis, non-neg isotropic kurtosis, non-neg anisotropic kurtosis, monotonic signal decay): Note that the vector of supported constraints will depend on the specific model, please consult
'constraints', [0 0 1 1 1]
<Modelname>.m
to obtain a models-specific list.
- Fitting your model:
x = model.solve(y);
- Obtaining scalar metrics:
m = model.metrics(x);
When using the estimators in this repository, please cite the associated paper:
Morez J, Szczepankiewicz F, den Dekker AJ, Vanhevel F, Sijbers J, Jeurissen B. Optimal experimental design and estimation for q-space trajectory imaging. Hum Brain Mapp. 2023;44: 1793–1809 (link).