Skip to content

Constrained estimators for any model that can be cast as y=exp(A*b)

License

Notifications You must be signed in to change notification settings

bjeurissen/ciwlls

Repository files navigation

Introduction

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), ...

Usage

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:

  1. 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
  1. Applying a mask to avoid calculations in the background:
y = Volumes.mask(y,logical(mask)); % sets all voxels outside the mask to NaN
  1. 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):
    'constraints', [0 0 1 1 1]
    Note that the vector of supported constraints will depend on the specific model, please consult <Modelname>.m to obtain a models-specific list.
  1. Fitting your model:
x = model.solve(y);
  1. Obtaining scalar metrics:
m = model.metrics(x);

Reference

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).

About

Constrained estimators for any model that can be cast as y=exp(A*b)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages