>> res=moxunit_runtests('Test/MoxUnitCompatible/BatchExample_test.m')
suite: 3 tests
.Warning: Directory already exists.
> In BatchExample_test>test_batch (line 19)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: Directory already exists.
> In BatchExample_test>test_batch (line 21)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
===============================================================
Testing: charmed BATCH...
===============================================================
Model =
charmed with properties:
MRIinputs: {'DiffusionData' 'SigmaNoise' 'Mask'}
xnames: {1×7 cell}
voxelwise: 1
st: [0.5000 0.7000 6 0 0 3 1.4000]
lb: [0 0.3000 3 0 0 1 0.3000]
ub: [1 3 10 1 8 4 3]
fx: [0 0 0 1 1 1 1]
Prot: [1×1 struct]
buttons: {1×13 cell}
options: [1×1 struct]
Sim_Single_Voxel_Curve_buttons: {'SNR' [50]}
Sim_Sensitivity_Analysis_buttons: {'# of run' [5]}
Sim_Optimize_Protocol_buttons: {1×8 cell}
version: [2 0 10]
ModelName: 'charmed'
Please wait. Downloading data ...
Data has been downloaded ...
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'fr', 'Dh', 'diameter_mean', 'fcsf', 'lc', 'Dcsf', 'Dintra'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
EXAMPLE:
Model = charmed
x = struct;
x.fr = 0.5;
x.Dh = 0.7;
x.diameter_mean = 6;
x.fcsf = 0;
x.lc = 0;
x.Dcsf = 3;
x.Dintra = 1.4;
% Get all possible options
Opt = button2opts(Model.Sim_Single_Voxel_Curve_buttons,1);
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'fr', 'Dh', 'diameter_mean', 'fcsf', 'lc', 'Dcsf', 'Dintra'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
EXAMPLE:
Model = charmed
x = struct;
x.fr = 0.5;
x.Dh = 0.7;
x.diameter_mean = 6;
x.fcsf = 0;
x.lc = 0;
x.Dcsf = 3;
x.Dintra = 1.4;
% Get all possible options
Opt = button2opts(Model.Sim_Single_Voxel_Curve_buttons,1);
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Sensitivity_Analysis
Simulates sensitivity to fitted parameters:
(1) vary fitting parameters from lower (lb) to upper (ub) bound in 10 steps
(2) run Sim_Single_Voxel_Curve Nofruns times
(3) Compute mean and std across runs
USAGE:
SimVaryResults = Model.Sim_Sensitivity_Analysis(OptTable, Opt);
INPUT:
OptTable: [struct] nominal value and range for each parameter.
st: [vector] nominal values for 'fr', 'Dh', 'diameter_mean', 'fcsf', 'lc', 'Dcsf', 'Dintra'
fx: [binary vector] do not vary this parameter?
lb: [vector] vary from lb...
ub: [vector] up to ub
Opt: [struct] Options of the simulation with fields:
struct with fields:
SNR: 50
Nofrun: 5
EXAMPLE:
Model = charmed
% fr Dh diameter_mean fcsf lc Dcsf Dintra
OptTable.st = [0.5 0.7 6 0 0 3 1.4]; % nominal values
OptTable.fx = [0 1 1 1 1 1 1]; %vary fr...
OptTable.lb = [0 0.3 3 0 0 1 0.3]; %...from 0
OptTable.ub = [1 3 10 1 8 4 3]; %...to 1
% Get all possible options
Opt = button2opts([Model.Sim_Single_Voxel_Curve_buttons, Model.Sim_Sensitivity_Analysis_buttons],1);
% run simulation using options `Opt(1)`
SimResults = Model.Sim_Sensitivity_Analysis(OptTable,Opt(1));
figure('Name','Sensitivity Analysis');
SimVaryPlot(SimResults, 'fr' ,'fr' );
------------------------------
SAVED: charmed_batch.m
Demo is ready at: /private/tmp/qMRLab/charmed_demo
------------------------------
charmed: Composite Hindered and Restricted Model for Diffusion
Pulse Sequence Diagram
Assumptions:
Diffusion gradients are applied perpendicularly to the neuronal fibers.
Neuronal fibers model:
geometry cylinders
Orientation dispersion NO
Permeability NO
Diffusion properties:
intra-axonal restricted in cylinder with Gaussian
Phase approximation
diffusion coefficient (Dr) fixed by default. this assumption should have
little impact if the average
propagator is larger than
axonal diameter (sqrt(2*Dr*Delta)>8?m).
extra-axonal Gaussian
diffusion coefficient (Dh) Constant by default. Time dependence (lc)
can be added
Inputs:
DiffusionData 4D DWI
(SigmaNoise) map of the standard deviation of the noise per voxel
(Mask) Binary mask to accelerate the fitting
Outputs:
fr Fraction of water in the restricted compartment.
Dh Apparent diffusion coefficient of the hindered compartment.
diameter_mean Mean axonal diameter weighted by the axonal area --> biased toward the larger axons
fixed to 0 --> stick model (recommended if Gmax < 300mT/m).
fcsf Fraction of water in the CSF compartment. (fixed to 0 by default)
lc Length of coherence. If > 0, this parameter models the time dependence
of the hindered diffusion coefficient Dh.
Els Fieremans et al. Neuroimage 2016.
Interpretation is not perfectly known.
Use option "Time-Dependent Models" to get different interpretations.
(fh) Fraction of water in the hindered compartment, calculated as: 1 - fr - fcsf
(residue) Fitting residuals
Protocol:
Various bvalues
diffusion gradient direction perpendicular to the fibers
DiffusionData Array [NbVol x 7]
Gx Diffusion Gradient x
Gy Diffusion Gradient y
Gz Diffusion Gradient z
Gnorm (T/m) Diffusion gradient magnitude
Delta (s) Diffusion separation
delta (s) Diffusion duration
TE (s) Echo time
Options:
Rician noise bias Used if no SigmaNoise map is provided.
'Compute Sigma per voxel' Sigma is estimated by computing the STD across repeated scans.
'fix sigma' Use scd_noise_std_estimation to measure noise level. Use 'value' to fix Sigma.
Display Type
'q-value' abscissa for plots: q = gamma.delta.G (?m-1)
'b-value' abscissa for plots: b = (2.pi.q)^2.(Delta-delta/3) (s/mm2)
S0 normalization
'Use b=0' Use b=0 images. In case of variable TE, your dataset requires a b=0 for each TE.
'Single T2 compartment' In case of variable TE acquisition:
fit single T2 using data acquired at b<1000s/mm2 (assuming Gaussian diffusion))
Time-dependent models
'Burcaw 2015' XXX
'Ning MRM 2016' XXX
Example of command line usage (see showdemo charmed_batch):
Model = charmed; % Create class from model
Model.Prot.DiffusionData.Mat = txt2mat('Protocol.txt'); % Load protocol
data = struct; % Create data structure
data.DiffusionData = load_nii_data('DiffusionData.nii.gz'); % Load data
data.Mask=load_nii_data('Mask.nii.gz'); % Load mask
FitResults = FitData(data,Model,1); % Fit each voxel within mask
FitResultsSave_nii(FitResults,'DiffusionData.nii.gz'); % Save in local folder: FitResults/
For more examples: qMRusage(charmed)
Author: Tanguy Duval, 2016
References:
Please cite the following if you use this module:
Assaf, Y., Basser, P.J., 2005. Composite hindered and restricted model of diffusion (charmed) MR imaging of the human brain. Neuroimage 27, 48?58.
In addition to citing the package:
Cabana J-F, Gu Y, Boudreau M, Levesque IR, Atchia Y, Sled JG, Narayanan S, Arnold DL, Pike GB, Cohen-Adad J, Duval T, Vuong M-T and Stikov N. (2016), Quantitative magnetization transfer imaging made easy with qMTLab: Software for data simulation, analysis, and visualization. Concepts Magn. Reson.. doi: 10.1002/cmr.a.21357
Reference page for charmed
Warning: Environment Variable 'ISTRAVIS'=1: close window immediatly. run
>>setenv('ISTRAVIS','') to change this behavior.
> In Custom_OptionsGUI>OptionsGUI_OutputFcn (line 162)
In gui_mainfcn (line 262)
In Custom_OptionsGUI (line 32)
In charmed_batch (line 32)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Fitting voxel 3/962
...done 0%
Warning: Directory already exists.
> In FitResultsSave_nii (line 9)
In charmed_batch (line 103)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Elapsed time is 42.645827 seconds.
===============================================================
Testing: dti BATCH...
===============================================================
Model =
dti with properties:
MRIinputs: {'DiffusionData' 'SigmaNoise' 'Mask'}
xnames: {'L1' 'L2' 'L3'}
voxelwise: 1
st: [2 0.7000 0.7000]
lb: [0 0 0]
ub: [5 5 5]
fx: [0 0 0]
Prot: [1×1 struct]
buttons: {1×9 cell}
options: [1×1 struct]
version: [2 0 10]
ModelName: 'dti'
Please wait. Downloading data ...
Data has been downloaded ...
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'L1', 'L2', 'L3'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
EXAMPLE:
Model = dti
x = struct;
x.L1 = 2;
x.L2 = 0.7;
x.L3 = 0.7;
Opt.SNR = 50;
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'L1', 'L2', 'L3'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
EXAMPLE:
Model = dti
x = struct;
x.L1 = 2;
x.L2 = 0.7;
x.L3 = 0.7;
Opt.SNR = 50;
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Sensitivity_Analysis
Simulates sensitivity to fitted parameters:
(1) vary fitting parameters from lower (lb) to upper (ub) bound in 10 steps
(2) run Sim_Single_Voxel_Curve Nofruns times
(3) Compute mean and std across runs
USAGE:
SimVaryResults = Model.Sim_Sensitivity_Analysis(OptTable, Opt);
INPUT:
OptTable: [struct] nominal value and range for each parameter.
st: [vector] nominal values for 'L1', 'L2', 'L3'
fx: [binary vector] do not vary this parameter?
lb: [vector] vary from lb...
ub: [vector] up to ub
Opt: [struct] Options of the simulation with fields:
struct with fields:
SNR: 50
EXAMPLE:
Model = dti
% L1 L2 L3
OptTable.st = [2 0.7 0.7]; % nominal values
OptTable.fx = [0 1 1]; %vary L1...
OptTable.lb = [0 0 0]; %...from 0
OptTable.ub = [5 5 5]; %...to 5
Opt.SNR = 50;
Opt.Nofrun = 5;
% run simulation using options `Opt(1)`
SimResults = Model.Sim_Sensitivity_Analysis(OptTable,Opt(1));
figure('Name','Sensitivity Analysis');
SimVaryPlot(SimResults, 'L1' ,'L1' );
------------------------------
SAVED: dti_batch.m
Demo is ready at: /private/tmp/qMRLab/dti_demo
------------------------------
dti: Compute a tensor from diffusion data
Assumptions:
Anisotropic Gaussian diffusion tensor
Valid at relatively low b-value (i.e. ~< 2000 s/mm2)
Inputs:
DiffusionData 4D DWI
(SigmaNoise) map of the standard deviation of the noise per voxel
(Mask) Binary mask to accelerate the fitting
Outputs:
D [Dxx Dxy Dxz Dxy Dyy Dyz Dxz Dyz Dzz] Difffusion Tensor
L1 1rst eigenvalue of D
L2 2nd eigenvalue of D
L3 3rd eigenvalue of D
FA Fractional Anisotropy: FA = sqrt(3/2)*sqrt(sum((L-L_mean).^2))/sqrt(sum(L.^2));
S0_TEXX Signal at b=0 at TE=XX
(residue) Fitting residuals
Protocol:
At least 2 shells (e.g. b=1000 and b=0 s/mm2)
diffusion gradient direction in 3D
DiffusionData Array [NbVol x 7]
Gx Diffusion Gradient x
Gy Diffusion Gradient y
Gz Diffusion Gradient z
Gnorm (T/m) Diffusion gradient magnitude
Delta (s) Diffusion separation
delta (s) Diffusion duration
TE (s) Echo time
Options:
fitting type
'linear' Solves the linear problem (ln(S/S0) = -bD)
'non-linear (Rician Likelihood)' Add an additional fitting step,
using the Rician Likelihood.
Rician noise bias only for non-linear fitting
SigmaNoise map is prioritary.
'Compute Sigma per voxel' Sigma is estimated by computing the STD across repeated scans.
'fix sigma' Use scd_noise_std_estimation to measure noise level. Use 'value' to fix Sigma.
Example of command line usage (see dti_batch.html):
Model = dti
%% LOAD DATA
data.DiffusionData = load_nii_data('DiffusionData.nii.gz');
data.SigmaNoise = load_nii_data('SigmaNoise.nii.gz');
data.Mask = load_nii_data('Mask.nii.gz');
%% FIT A SINGLE VOXEL
% Specific voxel: datavox = extractvoxel(data,voxel);
% Interactive selection: datavox = extractvoxel(data);
voxel = round(size(data.DiffusionData(:,:,:,1))/2); % pick FOV center
datavox = extractvoxel(data,voxel);
FitResults = Model.fit(datavox);
Model.plotModel(FitResults, datavox); % plot fit results
%% FIT all voxels
FitResults = FitData(data,Model);
% SAVE results to NIFTI
FitResultsSave_nii(FitResults,'DiffusionData.nii.gz'); % use header from 'DiffusionData.nii.gz'
For more examples: qMRusage(dti)
Author: Tanguy Duval, 2016
References:
Please cite the following if you use this module:
Basser, P.J., Mattiello, J., LeBihan, D., 1994. MR diffusion tensor spectroscopy and imaging. Biophys. J. 66, 259?267.
In addition to citing the package:
Cabana J-F, Gu Y, Boudreau M, Levesque IR, Atchia Y, Sled JG, Narayanan S, Arnold DL, Pike GB, Cohen-Adad J, Duval T, Vuong M-T and Stikov N. (2016), Quantitative magnetization transfer imaging made easy with qMTLab: Software for data simulation, analysis, and visualization. Concepts Magn. Reson.. doi: 10.1002/cmr.a.21357
Reference page for dti
Warning: Environment Variable 'ISTRAVIS'=1: close window immediatly. run
>>setenv('ISTRAVIS','') to change this behavior.
> In Custom_OptionsGUI>OptionsGUI_OutputFcn (line 162)
In gui_mainfcn (line 262)
In Custom_OptionsGUI (line 32)
In dti_batch (line 32)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Fitting voxel 3/164005
...done 0%
Warning: Directory already exists.
> In FitResultsSave_nii (line 9)
In dti_batch (line 103)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Elapsed time is 44.601598 seconds.
===============================================================
Testing: noddi BATCH...
===============================================================
Model =
noddi with properties:
MRIinputs: {'DiffusionData' 'Mask'}
xnames: {'ficvf' 'di' 'kappa' 'fiso' 'diso' 'b0' 'theta' 'phi'}
voxelwise: 1
st: [0.5000 1.7000 0.0500 0 3 1 0.2000 0]
lb: [0 1.3000 0.0500 0 1 0 0 0]
ub: [1 2.1000 0.8000 1 5 1000 3.1416 3.1416]
fx: [0 1 0 0 1 1 0 0]
Prot: [1×1 struct]
buttons: {'model name' {1×2 cell}}
options: [1×1 struct]
version: [2 0 10]
ModelName: 'noddi'
Please wait. Downloading data ...
Data has been downloaded ...
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'ficvf', 'di', 'kappa', 'fiso', 'diso', 'b0', 'theta', 'phi'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
EXAMPLE:
Model = noddi
x = struct;
x.ficvf = 0.5;
x.di = 1.7;
x.kappa = 0.05;
x.fiso = 0;
x.diso = 3;
x.b0 = 1;
x.theta = 0.2;
x.phi = 0;
Opt.SNR = 50;
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'ficvf', 'di', 'kappa', 'fiso', 'diso', 'b0', 'theta', 'phi'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
EXAMPLE:
Model = noddi
x = struct;
x.ficvf = 0.5;
x.di = 1.7;
x.kappa = 0.05;
x.fiso = 0;
x.diso = 3;
x.b0 = 1;
x.theta = 0.2;
x.phi = 0;
Opt.SNR = 50;
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Sensitivity_Analysis
Simulates sensitivity to fitted parameters:
(1) vary fitting parameters from lower (lb) to upper (ub) bound in 10 steps
(2) run Sim_Single_Voxel_Curve Nofruns times
(3) Compute mean and std across runs
USAGE:
SimVaryResults = Model.Sim_Sensitivity_Analysis(OptTable, Opt);
INPUT:
OptTable: [struct] nominal value and range for each parameter.
st: [vector] nominal values for 'ficvf', 'di', 'kappa', 'fiso', 'diso', 'b0', 'theta', 'phi'
fx: [binary vector] do not vary this parameter?
lb: [vector] vary from lb...
ub: [vector] up to ub
Opt: [struct] Options of the simulation with fields:
struct with fields:
SNR: 50
EXAMPLE:
Model = noddi
% ficvf di kappa fiso diso b0 theta phi
OptTable.st = [0.5 1.7 0.05 0 3 1 0.2 0]; % nominal values
OptTable.fx = [0 1 1 1 1 1 1 1]; %vary ficvf...
OptTable.lb = [0 1.3 0.05 0 1 0 0 0]; %...from 0
OptTable.ub = [1 2.1 0.8 1 5 1e+03 3.1 3.1]; %...to 1
Opt.SNR = 50;
Opt.Nofrun = 5;
% run simulation using options `Opt(1)`
SimResults = Model.Sim_Sensitivity_Analysis(OptTable,Opt(1));
figure('Name','Sensitivity Analysis');
SimVaryPlot(SimResults, 'ficvf' ,'ficvf' );
------------------------------
SAVED: noddi_batch.m
Demo is ready at: /private/tmp/qMRLab/noddi_demo
------------------------------
noddi: Neurite Orientation Dispersion and Density Imaging
Three-compartment model for fitting multi-shell DWI
Pulse Sequence Diagram
ASSUMPTIONS:
Neuronal fibers model:
geometry sticks (Dperp = 0)
Orientation dispersion YES (Watson distribution). Note that noddi is more robust to
crossing fibers that DTI (Campbell, NIMG 2017)
Permeability NO
Diffusion properties:
intra-axonal totally restricted
diffusion coefficient (Dr) fixed by default.
extra-axonal Tortuosity model. Parallel diffusivity is equal to
intra-diffusivity.Perpendicular diffusivity is
proportional to fiber density
diffusion coefficient (Dh) Constant
Inputs:
DiffusionData 4D diffusion weighted dataset
(Mask) Binary mask to accelerate the fitting (OPTIONAL)
Outputs:
di Diffusion coefficient in the restricted compartment.
ficvf Fraction of water in the restricted compartment.
fiso Fraction of water in the isotropic compartment (e.g. CSF/Veins)
fr Fraction of restricted water in the entire voxel (e.g. intra-cellular volume fraction)
fr = ficvf*(1-fiso)
diso (fixed) diffusion coefficient of the isotropic compartment (CSF)
kappa Orientation dispersion index
b0 Signal at b=0
theta angle of the fibers
phi angle of the fibers
Protocol:
Multi-shell diffusion-weighted acquisition
at least 2 non-zeros bvalues
at least 5 b=0 (used to compute noise standard deviation
DiffusionData Array [NbVol x 7]
Gx Diffusion Gradient x
Gy Diffusion Gradient y
Gz Diffusion Gradient z
Gnorm (T/m) Diffusion gradient magnitude
Delta (s) Diffusion separation
delta (s) Diffusion duration
TE (s) Echo time
Options:
Model Model part of noddi.
Available models are:
-WatsonSHStickTortIsoVIsoDot_B0 is a four model compartment used for ex-vivo datasets
Example of command line usage (see also showdemo noddi_batch):
For more examples: qMRusage(noddi)
Author: Tanguy Duval
References:
Please cite the following if you use this module:
Zhang, H., Schneider, T., Wheeler-Kingshott, C.A., Alexander, D.C., 2012. noddi: practical in vivo neurite orientation dispersion and density imaging of the human brain. Neuroimage 61, 1000?1016.
In addition to citing the package:
Cabana J-F, Gu Y, Boudreau M, Levesque IR, Atchia Y, Sled JG, Narayanan S, Arnold DL, Pike GB, Cohen-Adad J, Duval T, Vuong M-T and Stikov N. (2016), Quantitative magnetization transfer imaging made easy with qMTLab: Software for data simulation, analysis, and visualization. Concepts Magn. Reson.. doi: 10.1002/cmr.a.21357
Reference page for noddi
Warning: Environment Variable 'ISTRAVIS'=1: close window immediatly. run
>>setenv('ISTRAVIS','') to change this behavior.
> In Custom_OptionsGUI>OptionsGUI_OutputFcn (line 162)
In gui_mainfcn (line 262)
In Custom_OptionsGUI (line 32)
In noddi_batch (line 32)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Fitting voxel 3/164005
...done 0%
Warning: Directory already exists.
> In FitResultsSave_nii (line 9)
In noddi_batch (line 102)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Elapsed time is 67.513655 seconds.
===============================================================
Testing: b0_dem BATCH...
===============================================================
Model =
b0_dem with properties:
MRIinputs: {'Phase' 'Magn'}
xnames: {'B0 (Hz)'}
voxelwise: 0
Prot: [1×1 struct]
buttons: {'Magn thresh' [0.0500]}
options: [1×1 struct]
version: [2 0 10]
ModelName: 'b0_dem'
Please wait. Downloading data ...
Data has been downloaded ...
------------------------------
SAVED: b0_dem_batch.m
Demo is ready at: /private/tmp/qMRLab/b0_dem_demo
------------------------------
b0_dem map : Dual Echo Method for B0 mapping
Assumptions:
Compute B0 map based on 2 phase images with different TEs
Inputs:
Phase 4D phase image, 2 different TEs in time dimension
Magn 3D magnitude image
Outputs:
B0map B0 field map [Hz]
Protocol:
TimingTable
deltaTE Difference in TE between 2 images [ms]
Options:
Magn thresh relative threshold for the magnitude (phase is undefined in the background
Example of command line usage (see also showdemo b0_dem_batch):
Model = b0_dem; % Create class from model
Model.Prot.TimingTable.Mat = 1.92e-3; % deltaTE [s]
data.Phase = double(load_nii_data('Phase.nii.gz'));%Load 4D data, 2 frames with different TE
data.Magn = double(load_nii_data('Magn.nii.gz'));
FitResults = FitData(data,Model);
FitResultsSave_nii(FitResults,'Phase.nii.gz'); %save nii file using Phase.nii.gz as template
For more examples: qMRusage(b0_dem)
Author: Ian Gagnon, 2017
References:
Please cite the following if you use this module:
Maier, F., Fuentes, D., Weinberg, J.S., Hazle, J.D., Stafford, R.J.,
2015. Robust phase unwrapping for MR temperature imaging using a
magnitude-sorted list, multi-clustering algorithm. Magn. Reson. Med.
73, 1662?1668. Schofield, M.A., Zhu, Y., 2003. Fast phase unwrapping
algorithm for interferometric applications. Opt. Lett. 28, 1194?1196
In addition to citing the package:
Cabana J-F, Gu Y, Boudreau M, Levesque IR, Atchia Y, Sled JG,
Narayanan S, Arnold DL, Pike GB, Cohen-Adad J, Duval T, Vuong M-T and
Stikov N. (2016), Quantitative magnetization transfer imaging made
easy with qMTLab: Software for data simulation, analysis, and
visualization. Concepts Magn. Reson.. doi: 10.1002/cmr.a.21357
Reference page for b0_dem
Warning: Environment Variable 'ISTRAVIS'=1: close window immediatly. run
>>setenv('ISTRAVIS','') to change this behavior.
> In Custom_OptionsGUI>OptionsGUI_OutputFcn (line 162)
In gui_mainfcn (line 262)
In Custom_OptionsGUI (line 32)
In b0_dem_batch (line 32)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
...done
Warning: Directory already exists.
> In FitResultsSave_nii (line 9)
In b0_dem_batch (line 90)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Elapsed time is 2.334252 seconds.
===============================================================
Testing: b1_dam BATCH...
===============================================================
Model =
b1_dam with properties:
MRIinputs: {'SF60' 'SF120'}
xnames: {}
voxelwise: 0
ProtFormat: {}
Prot: []
buttons: {}
options: [1×1 struct]
version: [2 0 10]
ModelName: 'b1_dam'
Please wait. Downloading data ...
Data has been downloaded ...
------------------------------
SAVED: b1_dam_batch.m
Demo is ready at: /private/tmp/qMRLab/b1_dam_demo
------------------------------
b1_dam map: Double-Angle Method for B1+ mapping
Assumptions:
Compute a B1map using 2 SPGR images with 2 different flip angles (60, 120deg)
Inputs:
SF60 SPGR data at a flip angle of 60 degree
SF120 SPGR data at a flip angle of 120 degree
Outputs:
B1map Excitation (B1+) field map
Protocol:
NONE
Options
NONE
Example of command line usage (see also showdemo b1_dam_batch):
Model = b1_dam;% Create class from model
data.SF60 = double(load_nii_data('SF60.nii.gz')); %load data
data.SF120 = double(load_nii_data('SF120.nii.gz'));
FitResults = FitData(data,Model); % fit data
FitResultsSave_nii(FitResults,'SF60.nii.gz'); %save nii file using SF60.nii.gz as template
For more examples: qMRusage(b1_dam)
Author: Ian Gagnon, 2017
References:
Please cite the following if you use this module:
Insko, E.K., Bolinger, L., 1993. Mapping of the Radiofrequency Field.
J. Magn. Reson. A 103, 82?85.
In addition to citing the package:
Cabana J-F, Gu Y, Boudreau M, Levesque IR, Atchia Y, Sled JG,
Narayanan S, Arnold DL, Pike GB, Cohen-Adad J, Duval T, Vuong M-T and
Stikov N. (2016), Quantitative magnetization transfer imaging made
easy with qMTLab: Software for data simulation, analysis, and
visualization. Concepts Magn. Reson.. doi: 10.1002/cmr.a.21357
Reference page for b1_dam
Warning: Environment Variable 'ISTRAVIS'=1: close window immediatly. run
>>setenv('ISTRAVIS','') to change this behavior.
> In Custom_OptionsGUI>OptionsGUI_OutputFcn (line 162)
In gui_mainfcn (line 262)
In Custom_OptionsGUI (line 32)
In b1_dam_batch (line 32)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
...done
Warning: Directory already exists.
> In FitResultsSave_nii (line 9)
In b1_dam_batch (line 83)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Elapsed time is 0.922826 seconds.
===============================================================
Testing: mt_sat BATCH...
===============================================================
Model =
mt_sat with properties:
MRIinputs: {'MTw' 'T1w' 'PDw' 'B1map' 'Mask'}
xnames: {}
voxelwise: 0
Prot: [1×1 struct]
buttons: {'B1 correction factor' [0.4000]}
options: [1×1 struct]
version: [2 0 10]
ModelName: 'mt_sat'
Please wait. Downloading data ...
Data has been downloaded ...
------------------------------
SAVED: mt_sat_batch.m
Demo is ready at: /private/tmp/qMRLab/mt_sat_demo
------------------------------
mt_sat : Correction of Magnetization transfer for RF inhomogeneities and T1
Assumptions:
MTsat is a semi-quantitative method. MTsat values depend on protocol parameters.
Inputs:
MTw 3D MT-weighted data. Spoiled Gradient Echo (or FLASH) with MT
pulse
T1w 3D T1-weighted data. Spoiled Gradient Echo (or FLASH)
PDw 3D PD-weighted data. Spoiled Gradient Echo (or FLASH)
(B1map) B1+ map. B1map = 1 : perfectly accurate flip angle. Optional.
(Mask) Binary mask. DOES NOT ACCELERATE FITTING. Just for visualisation
Outputs:
MTSAT MT saturation map (%), T1-corrected
T1 T1 map (s)
Options:
B1 correction factor Correction factor (empirical) for the transmit RF. Only
corrects MTSAT, not T1.
Weiskopf, N., Suckling, J., Williams, G., CorreiaM.M., Inkster, B., Tait, R., Ooi, C., Bullmore, E.T., Lutti, A., 2013. Quantitative multi-parameter mapping of R1, PD(*), MT, and R2(*) at 3T: a multi-center validation. Front. Neurosci. 7, 95.
Protocol:
MTw [FA TR Offset] flip angle [deg], TR [s], Offset Frequency [Hz]
T1w [FA TR] flip angle [deg], TR [s]
PDw [FA TR] flip angle [deg], TR [s]
Example of command line usage (see also showdemo mt_sat_batch):
Model = mt_sat; % Create class from model
Model.Prot.MTw.Mat = txt2mat('MT.txt'); % Load protocol
Model.Prot.T1w.Mat = txt2mat('T1.txt');
Model.Prot.PDw.Mat = txt2mat('PD.txt');
data = struct; % Create data structure
data.MTw = load_nii_data('MTw.nii.gz');
data.T1w = load_nii_data('T1w.nii.gz');
data.PDw = load_nii_data('PDw.nii.gz'); % Load data
FitResults = FitData(data,Model); %fit data
FitResultsSave_nii(FitResults,'MTw.nii.gz'); % Save in local folder: FitResults/
For more examples: qMRusage(mt_sat)
Author: Pascale Beliveau ([email protected])
References:
Please cite the following if you use this module:
Helms, G., Dathe, H., Kallenberg, K., Dechent, P., 2008. High-resolution maps of magnetization transfer with inherent correction for RF inhomogeneity and T1 relaxation obtained from 3D FLASH MRI. Magn. Reson. Med. 60, 1396?1407.
In addition to citing the package:
Cabana J-F, Gu Y, Boudreau M, Levesque IR, Atchia Y, Sled JG, Narayanan S, Arnold DL, Pike GB, Cohen-Adad J, Duval T, Vuong M-T and Stikov N. (2016), Quantitative magnetization transfer imaging made easy with qMTLab: Software for data simulation, analysis, and visualization. Concepts Magn. Reson.. doi: 10.1002/cmr.a.21357
Reference page for mt_sat
Warning: Environment Variable 'ISTRAVIS'=1: close window immediatly. run
>>setenv('ISTRAVIS','') to change this behavior.
> In Custom_OptionsGUI>OptionsGUI_OutputFcn (line 162)
In gui_mainfcn (line 262)
In Custom_OptionsGUI (line 32)
In mt_sat_batch (line 32)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
...done
Warning: Directory already exists.
> In FitResultsSave_nii (line 9)
In mt_sat_batch (line 105)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Elapsed time is 4.257172 seconds.
===============================================================
Testing: qmt_bssfp BATCH...
===============================================================
Model =
qmt_bssfp with properties:
MRIinputs: {'MTdata' 'R1map' 'Mask'}
xnames: {'F' 'kr' 'R1f' 'R1r' 'T2f' 'M0f'}
voxelwise: 1
st: [0.1000 30 1 1 0.0400 1]
lb: [1×6 double]
ub: [0.3000 100 3 3 0.2000 2]
fx: [0 0 1 1 0 0]
Prot: [1×1 struct]
buttons: {1×25 cell}
options: [1×1 struct]
Sim_Single_Voxel_Curve_buttons: {1×6 cell}
Sim_Sensitivity_Analysis_buttons: {'# of run' [5]}
version: [2 0 10]
ModelName: 'qmt_bssfp'
Please wait. Downloading data ...
Data has been downloaded ...
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'F', 'kr', 'R1f', 'R1r', 'T2f', 'M0f'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
Method: 'Analytical equation'
ResetMz: 0
EXAMPLE:
Model = qmt_bssfp
x = struct;
x.F = 0.1;
x.kr = 30;
x.R1f = 1;
x.R1r = 1;
x.T2f = 0.04;
x.M0f = 1;
% Get all possible options
Opt = button2opts(Model.Sim_Single_Voxel_Curve_buttons,1);
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'F', 'kr', 'R1f', 'R1r', 'T2f', 'M0f'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
Method: 'Analytical equation'
ResetMz: 0
EXAMPLE:
Model = qmt_bssfp
x = struct;
x.F = 0.1;
x.kr = 30;
x.R1f = 1;
x.R1r = 1;
x.T2f = 0.04;
x.M0f = 1;
% Get all possible options
Opt = button2opts(Model.Sim_Single_Voxel_Curve_buttons,1);
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Sensitivity_Analysis
Simulates sensitivity to fitted parameters:
(1) vary fitting parameters from lower (lb) to upper (ub) bound in 10 steps
(2) run Sim_Single_Voxel_Curve Nofruns times
(3) Compute mean and std across runs
USAGE:
SimVaryResults = Model.Sim_Sensitivity_Analysis(OptTable, Opt);
INPUT:
OptTable: [struct] nominal value and range for each parameter.
st: [vector] nominal values for 'F', 'kr', 'R1f', 'R1r', 'T2f', 'M0f'
fx: [binary vector] do not vary this parameter?
lb: [vector] vary from lb...
ub: [vector] up to ub
Opt: [struct] Options of the simulation with fields:
struct with fields:
SNR: 50
Method: 'Analytical equation'
ResetMz: 0
Nofrun: 5
EXAMPLE:
Model = qmt_bssfp
% F kr R1f R1r T2f M0f
OptTable.st = [0.1 30 1 1 0.04 1]; % nominal values
OptTable.fx = [0 1 1 1 1 1]; %vary F...
OptTable.lb = [0.0001 0.0001 0.2 0.2 0.01 0.0001]; %...from 0.0001
OptTable.ub = [0.3 1e+02 3 3 0.2 2]; %...to 0.3
% Get all possible options
Opt = button2opts([Model.Sim_Single_Voxel_Curve_buttons, Model.Sim_Sensitivity_Analysis_buttons],1);
% run simulation using options `Opt(1)`
SimResults = Model.Sim_Sensitivity_Analysis(OptTable,Opt(1));
figure('Name','Sensitivity Analysis');
SimVaryPlot(SimResults, 'F' ,'F' );
------------------------------
SAVED: qmt_bssfp_batch.m
Demo is ready at: /private/tmp/qMRLab/qmt_bssfp_demo
------------------------------
qmt_bssfp : qMT using Balanced Steady State Free Precession acquisition
-----------------------------------------------------------------------------------------------------
Assumptions:
Inputs:
MTdata 4D Magnetization Transfer data
(R1map) 1/T1map (optional)
(Mask) Binary mask to accelerate the fitting (optional)
Outputs:
F Ratio of number of restricted pool to free pool, defined
as F = M0r/M0f = kf/kr.
kr Exchange rate from the free to the restricted pool
(note that kf and kr are related to one another via the
definition of F. Changing the value of kf will change kr
accordingly, and vice versa).
R1f Longitudinal relaxation rate of the free pool
(R1f = 1/T1f).
R1r Longitudinal relaxation rate of the restricted pool
(R1r = 1/T1r).
T2f Tranverse relaxation time of the free pool (T2f = 1/R2f).
M0f Equilibrium value of the free pool longitudinal
magnetization.
Additional Outputs
M0r Equilibrium value of the restricted pool longitudinal
magnetization.
kf Exchange rate from the restricted to the free pool.
resnorm Fitting residual.
Protocol:
MTdata Array [nbVols x 2]:
Alpha Flip angle of the RF pulses (degrees)
Trf Duration of the RF pulses (s)
Options:
RF Pulse
Shape Shape of the RF pulses.
Available shapes are:
- hard
- gaussian
- gausshann (gaussian pulse with Hanning window)
- sinc
- sinchann (sinc pulse with Hanning window)
- singauss (sinc pulse with gaussian window)
- fermi
Nb of RF pulses Number of RF pulses applied before readout.
Protocol Timing
Fix TR Select this option and enter a value in the text
box below to set a fixed repetition time.
Fix TR - Trf Select this option and enter a value in the text
box below to set a fixed free precession time
(TR - Trf).
Prepulse Perform an Alpha/2 - TR/2 prepulse before each
series of RF pulses.
R1
Use R1map to By checking this box, you tell the fitting
constrain R1f algorithm to check for an observed R1map and use
its value to constrain R1f. Checking this box
will automatically set the R1f fix box to true in
the Fit parameters table.
Fix R1r = R1f By checking this box, you tell the fitting
algorithm to fix R1r equal to R1f. Checking this
box will automatically set the R1r fix box to
true in the Fit parameters table.
Global
G(0) The assumed value of the absorption lineshape of
the restricted pool.
References:
Please cite the following if you use this module:
In addition to citing the package:
Cabana J-F, Gu Y, Boudreau M, Levesque IR, Atchia Y, Sled JG, Narayanan S, Arnold DL, Pike GB, Cohen-Adad J, Duval T, Vuong M-T and Stikov N. (2016), Quantitative magnetization transfer imaging made easy with qMTLab: Software for data simulation, analysis, and visualization. Concepts Magn. Reson.. doi: 10.1002/cmr.a.21357
Reference page for qmt_bssfp
Warning: Environment Variable 'ISTRAVIS'=1: close window immediatly. run
>>setenv('ISTRAVIS','') to change this behavior.
> In Custom_OptionsGUI>OptionsGUI_OutputFcn (line 162)
In gui_mainfcn (line 262)
In Custom_OptionsGUI (line 32)
In qmt_bssfp_batch (line 32)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Fitting voxel 3/4354
...done 0%
Warning: Directory already exists.
> In FitResultsSave_nii (line 9)
In qmt_bssfp_batch (line 95)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Elapsed time is 4.300731 seconds.
===============================================================
Testing: qmt_sirfse BATCH...
===============================================================
Model =
qmt_sirfse with properties:
MRIinputs: {'MTdata' 'R1map' 'Mask'}
xnames: {'F' 'kr' 'R1f' 'R1r' 'Sf' 'Sr' 'M0f'}
voxelwise: 1
st: [0.1000 30 1 1 -0.9842 0.6564 1]
lb: [1×7 double]
ub: [1 100 10 10 0 1 2]
fx: [0 0 0 1 0 1 0]
Prot: [1×1 struct]
buttons: {1×21 cell}
options: [1×1 struct]
Sim_Single_Voxel_Curve_buttons: {1×6 cell}
Sim_Sensitivity_Analysis_buttons: {'# of run' [5]}
Sim_Optimize_Protocol_buttons: {1×6 cell}
version: [2 0 10]
ModelName: 'qmt_sirfse'
Please wait. Downloading data ...
Data has been downloaded ...
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'F', 'kr', 'R1f', 'R1r', 'Sf', 'Sr', 'M0f'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
Method: 'Analytical equation'
T2fUsedinBlockequation: 0.0400
EXAMPLE:
Model = qmt_sirfse
x = struct;
x.F = 0.1;
x.kr = 30;
x.R1f = 1;
x.R1r = 1;
x.Sf = -0.98419;
x.Sr = 0.65638;
x.M0f = 1;
% Get all possible options
Opt = button2opts(Model.Sim_Single_Voxel_Curve_buttons,1);
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'F', 'kr', 'R1f', 'R1r', 'Sf', 'Sr', 'M0f'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
Method: 'Analytical equation'
T2fUsedinBlockequation: 0.0400
EXAMPLE:
Model = qmt_sirfse
x = struct;
x.F = 0.1;
x.kr = 30;
x.R1f = 1;
x.R1r = 1;
x.Sf = -0.98419;
x.Sr = 0.65638;
x.M0f = 1;
% Get all possible options
Opt = button2opts(Model.Sim_Single_Voxel_Curve_buttons,1);
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Sensitivity_Analysis
Simulates sensitivity to fitted parameters:
(1) vary fitting parameters from lower (lb) to upper (ub) bound in 10 steps
(2) run Sim_Single_Voxel_Curve Nofruns times
(3) Compute mean and std across runs
USAGE:
SimVaryResults = Model.Sim_Sensitivity_Analysis(OptTable, Opt);
INPUT:
OptTable: [struct] nominal value and range for each parameter.
st: [vector] nominal values for 'F', 'kr', 'R1f', 'R1r', 'Sf', 'Sr', 'M0f'
fx: [binary vector] do not vary this parameter?
lb: [vector] vary from lb...
ub: [vector] up to ub
Opt: [struct] Options of the simulation with fields:
struct with fields:
SNR: 50
Method: 'Analytical equation'
T2fUsedinBlockequation: 0.0400
Nofrun: 5
EXAMPLE:
Model = qmt_sirfse
% F kr R1f R1r Sf Sr M0f
OptTable.st = [0.1 30 1 1 -0.98 0.66 1]; % nominal values
OptTable.fx = [0 1 1 1 1 1 1]; %vary F...
OptTable.lb = [0.0001 0.0001 0.05 0.05 -1 0.0001 0.0001]; %...from 0.0001
OptTable.ub = [1 1e+02 10 10 0 1 2]; %...to 1
% Get all possible options
Opt = button2opts([Model.Sim_Single_Voxel_Curve_buttons, Model.Sim_Sensitivity_Analysis_buttons],1);
% run simulation using options `Opt(1)`
SimResults = Model.Sim_Sensitivity_Analysis(OptTable,Opt(1));
figure('Name','Sensitivity Analysis');
SimVaryPlot(SimResults, 'F' ,'F' );
------------------------------
SAVED: qmt_sirfse_batch.m
Demo is ready at: /private/tmp/qMRLab/qmt_sirfse_demo
------------------------------
qmt_sirfse: qMT using Inversion Recovery Fast Spin Echo acquisition
Pulse Sequence Diagram
ASSUMPTIONS:
(1) FILL
(2)
(3)
(4)
Inputs:
MTdata Magnetization Transfert data
(R1map) 1/T1map (OPTIONAL but recommended)
(Mask) Binary mask to accelerate the fitting (OPTIONAL)
Outputs:
F Ratio of number of restricted pool to free pool, defined
as F = M0r/M0f = kf/kr.
kr Exchange rate from the free to the restricted pool
(note that kf and kr are related to one another via the
definition of F. Changing the value of kf will change kr
accordingly, and vice versa).
R1f Longitudinal relaxation rate of the free pool
(R1f = 1/T1f).
R1r Longitudinal relaxation rate of the restricted pool
(R1r = 1/T1r).
Sf Instantaneous fraction of magnetization after vs. before
the pulse in the free pool. Starting point is computed using Block
simulation.
Sr Instantaneous fraction of magnetization after vs. before
the pulse in the restricted pool. Starting point is computed using block
simulation.
M0f Equilibrium value of the free pool longitudinal
magnetization.
(M0r) Equilibrium value of the restricted pool longitudinal
magnetization. Computed using M0f = M0r * F.
(kf) Exchange rate from the restricted to the free pool.
Computed using kf = kr * F.
(resnorm) Fitting residual.
Protocol:
MTdata
Ti Inversion times (s)
Td Delay times (s)
FSEsequence
Trf Duration of the pulses in the FSE sequence (s)
Tr Delay between the pulses in the FSE sequnece (s)
Npulse Number of refocusing pulses in the FSE sequence
Options:
Inversion Pulse
Shape Shape of the inversion pulse.
Available shapes are:
- hard
- gaussian
- gausshann (gaussian pulse with Hanning window)
- sinc
- sinchann (sinc pulse with Hanning window)
- singauss (sinc pulse with gaussian window)
- fermi
Duration Duration of the inversion pulse (s)
Fitting
Use R1map to By checking this box, you tell the fitting
constrain R1f algorithm to check for an observed R1map and use
its value to constrain R1f. Checking this box
will automatically set the R1f fix box to true in
the Fit parameters table.
Fix R1r = R1f By checking this box, you tell the fitting
algorithm to fix R1r equal to R1f. Checking this
box will automatically set the R1r fix box to
true in the Fit parameters table.
Sr Calculation
Lineshape The absorption lineshape of the restricted pool. Available lineshapes are: Gaussian, Lorentzian and SuperLorentzian.
T2r Transverse relaxation time of the restricted pool (T2r = 1/R2r)
Example of command line usage (see also showdemo qmt_sirfse_batch):
For more examples: qMRusage(qmt_sirfse)
Author: Ian Gagnon, 2017
Reference page for qmt_sirfse
Warning: Environment Variable 'ISTRAVIS'=1: close window immediatly. run
>>setenv('ISTRAVIS','') to change this behavior.
> In Custom_OptionsGUI>OptionsGUI_OutputFcn (line 162)
In gui_mainfcn (line 262)
In Custom_OptionsGUI (line 32)
In qmt_sirfse_batch (line 32)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Fitting voxel 3/4354
...done 0%
Warning: Directory already exists.
> In FitResultsSave_nii (line 9)
In qmt_sirfse_batch (line 99)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Elapsed time is 3.298491 seconds.
===============================================================
Testing: qmt_spgr BATCH...
===============================================================
Model =
qmt_spgr with properties:
MRIinputs: {'MTdata' 'R1map' 'B1map' 'B0map' 'Mask'}
xnames: {'F' 'kr' 'R1f' 'R1r' 'T2f' 'T2r'}
voxelwise: 1
st: [0.1600 30 1 1 0.0300 1.3000e-05]
lb: [1×6 double]
ub: [0.5000 100 5 5 0.5000 5.0000e-05]
fx: [0 0 1 1 0 0]
Prot: [1×1 struct]
ProtSfTable: [1×1 struct]
buttons: {1×32 cell}
options: [1×1 struct]
Sim_Single_Voxel_Curve_buttons: {1×6 cell}
Sim_Sensitivity_Analysis_buttons: {'# of run' [5]}
Sim_Optimize_Protocol_buttons: {1×6 cell}
version: [2 0 10]
ModelName: 'qmt_spgr'
Please wait. Downloading data ...
Data has been downloaded ...
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'F', 'kr', 'R1f', 'R1r', 'T2f', 'T2r'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
Method: 'Analytical equation'
ResetMz: 0
EXAMPLE:
Model = qmt_spgr
x = struct;
x.F = 0.16;
x.kr = 30;
x.R1f = 1;
x.R1r = 1;
x.T2f = 0.03;
x.T2r = 1.3e-05;
% Get all possible options
Opt = button2opts(Model.Sim_Single_Voxel_Curve_buttons,1);
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'F', 'kr', 'R1f', 'R1r', 'T2f', 'T2r'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
Method: 'Analytical equation'
ResetMz: 0
EXAMPLE:
Model = qmt_spgr
x = struct;
x.F = 0.16;
x.kr = 30;
x.R1f = 1;
x.R1r = 1;
x.T2f = 0.03;
x.T2r = 1.3e-05;
% Get all possible options
Opt = button2opts(Model.Sim_Single_Voxel_Curve_buttons,1);
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Sensitivity_Analysis
Simulates sensitivity to fitted parameters:
(1) vary fitting parameters from lower (lb) to upper (ub) bound in 10 steps
(2) run Sim_Single_Voxel_Curve Nofruns times
(3) Compute mean and std across runs
USAGE:
SimVaryResults = Model.Sim_Sensitivity_Analysis(OptTable, Opt);
INPUT:
OptTable: [struct] nominal value and range for each parameter.
st: [vector] nominal values for 'F', 'kr', 'R1f', 'R1r', 'T2f', 'T2r'
fx: [binary vector] do not vary this parameter?
lb: [vector] vary from lb...
ub: [vector] up to ub
Opt: [struct] Options of the simulation with fields:
struct with fields:
SNR: 50
Method: 'Analytical equation'
ResetMz: 0
Nofrun: 5
EXAMPLE:
Model = qmt_spgr
% F kr R1f R1r T2f T2r
OptTable.st = [0.16 30 1 1 0.03 1.3e-05]; % nominal values
OptTable.fx = [0 1 1 1 1 1]; %vary F...
OptTable.lb = [0.0001 0.0001 0.05 0.05 0.003 3e-06]; %...from 0.0001
OptTable.ub = [0.5 1e+02 5 5 0.5 5e-05]; %...to 0.5
% Get all possible options
Opt = button2opts([Model.Sim_Single_Voxel_Curve_buttons, Model.Sim_Sensitivity_Analysis_buttons],1);
% run simulation using options `Opt(1)`
SimResults = Model.Sim_Sensitivity_Analysis(OptTable,Opt(1));
figure('Name','Sensitivity Analysis');
SimVaryPlot(SimResults, 'F' ,'F' );
------------------------------
SAVED: qmt_spgr_batch.m
Demo is ready at: /private/tmp/qMRLab/qmt_spgr_demo
------------------------------
qmt_spgr: quantitative Magnetizatoion Transfer (qMT) using Spoiled Gradient Echo (or FLASH)
Pulse Sequence Diagram
Assumptions:
FILL
Inputs:
MTdata Magnetization Transfert data
(R1map) 1/T1map (VFA RECOMMENDED Boudreau 2017 MRM)
(B1map) B1 field map, used for flip angle correction (=1 if not provided)
(B0map) B0 field map, used for offset correction (=0Hz if not provided)
(Mask) Binary mask to accelerate the fitting
Outputs:
F Ratio of number of restricted pool to free pool, defined
as F = M0r/M0f = kf/kr.
kr Exchange rate from the free to the restricted pool
(note that kf and kr are related to one another via the
definition of F. Changing the value of kf will change kr
accordingly, and vice versa).
R1f Longitudinal relaxation rate of the free pool
(R1f = 1/T1f).
R1r Longitudinal relaxation rate of the restricted pool
(R1r = 1/T1r).
T2f Tranverse relaxation time of the free pool (T2f = 1/R2f).
T2r Tranverse relaxation time of the restricted pool (T2r = 1/R2r).
(kf) Exchange rate from the restricted to the free pool.
(resnorm) Fitting residual.
Protocol:
MTdata Array [Nb of volumes x 2]
Angle MT pulses angles (degree)
Offset Offset frequencies (Hz)
TimingTable Vector [5x1]
Tmt Duration of the MT pulses (s)
Ts Free precession delay between the MT and excitation pulses (s)
Tp Duration of the excitation pulse (s)
Tr Free precession delay after tje excitation pulse, before
the next MT pulse (s)
TR Repetition time of the whole sequence (TR = Tmt + Ts + Tp + Tr)
Options:
MT Pulse
Shape Shape of the MT pulse.
Available shapes are:
- hard
- gaussian
- gausshann (gaussian pulse with Hanning window)
- sinc
- sinchann (sinc pulse with Hanning window)
- singauss (sinc pulse with gaussian window)
- fermi
Sinc TBW Time-bandwidth product for the sinc MT pulses
(applicable to sinc, sincgauss, sinchann MT
pulses).
Bandwidth Bandwidth of the gaussian MT pulse (applicable
to gaussian, gausshann and sincgauss MT pulses).
Fermi transition (a) slope 'a' (related to the transition width)
of the Fermi pulse (applicable to fermi MT
pulse).
Assuming pulse duration at 60 dB (from the Bernstein handbook)
and t0 = 10a,
slope = Tmt/33.81;
# of MT pulses Number of pulses used to achieve steady-state
before a readout is made.
Fitting constraints
Use R1map to By checking this box, you tell the fitting
constrain R1f algorithm to check for an observed R1map and use
its value to constrain R1f. Checking this box
will automatically set the R1f fix box to true
in the Fit parameters table.
Fix R1r = R1f By checking this box, you tell the fitting
algorithm to fix R1r equal to R1f. Checking this
box will automatically set the R1r fix box to
true in the Fit parameters table.
Fix R1f*T2f By checking this box, you tell the fitting
algorithm to compute T2f from R1f value. R1f*T2f
value is set in the next box.
R1f*T2f = Value of R1f*T2f (no units)
Model Model you want to use for fitting.
Available models are:
- SledPikeRP (Sled & Pike rectangular pulse),
- SledPikeCW (Sled & Pike continuous wave),
- Yarkykh (Yarnykh & Yuan)
- Ramani
Note: Sled & Pike models will show different
options than Yarnykh or Ramani.
Lineshape The absorption lineshape of the restricted pool.
Available lineshapes are:
- Gaussian
- Lorentzian
- SuperLorentzian
Read pulse alpha Flip angle of the excitation pulse.
Compute SfTable By checking this box, you compute a new SfTable
Command line usage:
qMRusage(qmt_spgr
showdemo qmt_spgr_batch
Author: Ian Gagnon, 2017
References:
Please cite the following if you use this module:
Sled, J.G., Pike, G.B., 2000. Quantitative interpretation of magnetization transfer in spoiled gradient echo MRI sequences. J. Magn. Reson. 145, 24?36.
In addition to citing the package:
Cabana J-F, Gu Y, Boudreau M, Levesque IR, Atchia Y, Sled JG, Narayanan S, Arnold DL, Pike GB, Cohen-Adad J, Duval T, Vuong M-T and Stikov N. (2016), Quantitative magnetization transfer imaging made easy with qMTLab: Software for data simulation, analysis, and visualization. Concepts Magn. Reson.. doi: 10.1002/cmr.a.21357
Reference page for qmt_spgr
Warning: Environment Variable 'ISTRAVIS'=1: close window immediatly. run
>>setenv('ISTRAVIS','') to change this behavior.
> In Custom_OptionsGUI>OptionsGUI_OutputFcn (line 162)
In gui_mainfcn (line 262)
In Custom_OptionsGUI (line 32)
In qmt_spgr_batch (line 32)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Fitting voxel 1/4101
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In FitData (line 106)
In qmt_spgr_batch (line 99)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (l 2/4101
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In FitData (line 106)
In qmt_spgr_batch (line 99)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (l 3/4101
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In FitData (line 106)
In qmt_spgr_batch (line 99)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
...done 0%
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/plotModel (line 295)
In qMRshowOutput (line 45)
In qmt_spgr_batch (line 109)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: Directory already exists.
> In FitResultsSave_nii (line 9)
In qmt_spgr_batch (line 114)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In qmt_spgr_batch (line 139)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/plotModel (line 295)
In qmt_spgr/Sim_Single_Voxel_Curve (line 318)
In qmt_spgr_batch (line 139)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In SimVary (line 48)
In qmt_spgr/Sim_Sensitivity_Analysis (line 325)
In qmt_spgr_batch (line 157)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In SimVary (line 48)
In qmt_spgr/Sim_Sensitivity_Analysis (line 325)
In qmt_spgr_batch (line 157)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In SimVary (line 48)
In qmt_spgr/Sim_Sensitivity_Analysis (line 325)
In qmt_spgr_batch (line 157)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In SimVary (line 48)
In qmt_spgr/Sim_Sensitivity_Analysis (line 325)
In qmt_spgr_batch (line 157)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In SimVary (line 48)
In qmt_spgr/Sim_Sensitivity_Analysis (line 325)
In qmt_spgr_batch (line 157)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In SimVary (line 48)
In qmt_spgr/Sim_Sensitivity_Analysis (line 325)
In qmt_spgr_batch (line 157)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In SimVary (line 48)
In qmt_spgr/Sim_Sensitivity_Analysis (line 325)
In qmt_spgr_batch (line 157)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In SimVary (line 48)
In qmt_spgr/Sim_Sensitivity_Analysis (line 325)
In qmt_spgr_batch (line 157)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In SimVary (line 48)
In qmt_spgr/Sim_Sensitivity_Analysis (line 325)
In qmt_spgr_batch (line 157)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In SimVary (line 48)
In qmt_spgr/Sim_Sensitivity_Analysis (line 325)
In qmt_spgr_batch (line 157)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In SimVary (line 48)
In qmt_spgr/Sim_Sensitivity_Analysis (line 325)
In qmt_spgr_batch (line 157)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In SimVary (line 48)
In qmt_spgr/Sim_Sensitivity_Analysis (line 325)
In qmt_spgr_batch (line 157)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In SimVary (line 48)
In qmt_spgr/Sim_Sensitivity_Analysis (line 325)
In qmt_spgr_batch (line 157)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In SimVary (line 48)
In qmt_spgr/Sim_Sensitivity_Analysis (line 325)
In qmt_spgr_batch (line 157)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Warning: No MToff (i.e. no volumes acquired with Angles=0) --> Fitting assumes that
MTData are already normalized.
> In qmt_spgr/fit (line 274)
In qmt_spgr/Sim_Single_Voxel_Curve (line 315)
In SimVary (line 48)
In qmt_spgr/Sim_Sensitivity_Analysis (line 325)
In qmt_spgr_batch (line 157)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Elapsed time is 18.544414 seconds.
===============================================================
Testing: noise_level BATCH...
===============================================================
Model =
noise_level with properties:
MRIinputs: {'Data4D' 'NoiseMask'}
xnames: {}
voxelwise: 0
Prot: [1×1 struct]
buttons: {'figure' [1] 'Noise Distribution' {1×2 cell}}
options: [1×1 struct]
version: [2 0 10]
ModelName: 'noise_level'
Please wait. Downloading data ...
Data has been downloaded ...
------------------------------
SAVED: noise_level_batch.m
Demo is ready at: /private/tmp/qMRLab/noise_level_demo
------------------------------
noise_level : Noise histogram fitting within a noise mask
ASSUMPTIONS:
(1)Uniform noise distribution. Outputs are scalar : all voxels have
the same value
Fitted Parameters:
Non-central Chi Parameters
Sigma
eta
N
Options:
figure plot noise histogram fit
Noise Distribution
Rician valid if using one coil OR adaptive combine
Non-central Chi valid for multi-coil and parallel imaging (parameter N reprensent the effective number of coils)
Author: Ian Gagnon, 2017
References:
Please cite the following if you use this module:
FILL
In addition to citing the package:
Cabana J-F, Gu Y, Boudreau M, Levesque IR, Atchia Y, Sled JG, Narayanan S, Arnold DL, Pike GB, Cohen-Adad J, Duval T, Vuong M-T and Stikov N. (2016), Quantitative magnetization transfer imaging made easy with qMTLab: Software for data simulation, analysis, and visualization. Concepts Magn. Reson.. doi: 10.1002/cmr.a.21357
Reference page for noise_level
Warning: Environment Variable 'ISTRAVIS'=1: close window immediatly. run
>>setenv('ISTRAVIS','') to change this behavior.
> In Custom_OptionsGUI>OptionsGUI_OutputFcn (line 162)
In gui_mainfcn (line 262)
In Custom_OptionsGUI (line 32)
In noise_level_batch (line 32)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
N eta sigma_g
1.0000 0.0000 7.8462
...done
Warning: Directory already exists.
> In FitResultsSave_nii (line 9)
In noise_level_batch (line 85)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Elapsed time is 2.189288 seconds.
===============================================================
Testing: inversion_recovery BATCH...
===============================================================
Model =
inversion_recovery with properties:
MRIinputs: {'IRData' 'Mask'}
xnames: {'T1' 'rb' 'ra'}
voxelwise: 1
st: [600 -1000 500]
lb: [1.0000e-04 -10000 1.0000e-04]
ub: [5000 0 10000]
fx: [0 0 0]
Prot: [1×1 struct]
buttons: {'method' {1×2 cell}}
options: [1×1 struct]
Sim_Single_Voxel_Curve_buttons: {'SNR' [50]}
Sim_Optimize_Protocol_buttons: {1×6 cell}
version: [2 0 10]
ModelName: 'inversion_recovery'
Please wait. Downloading data ...
Data has been downloaded ...
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'T1', 'rb', 'ra'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
EXAMPLE:
Model = inversion_recovery
x = struct;
x.T1 = 600;
x.rb = -1000;
x.ra = 500;
% Get all possible options
Opt = button2opts(Model.Sim_Single_Voxel_Curve_buttons,1);
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'T1', 'rb', 'ra'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
EXAMPLE:
Model = inversion_recovery
x = struct;
x.T1 = 600;
x.rb = -1000;
x.ra = 500;
% Get all possible options
Opt = button2opts(Model.Sim_Single_Voxel_Curve_buttons,1);
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Sensitivity_Analysis
Simulates sensitivity to fitted parameters:
(1) vary fitting parameters from lower (lb) to upper (ub) bound in 10 steps
(2) run Sim_Single_Voxel_Curve Nofruns times
(3) Compute mean and std across runs
USAGE:
SimVaryResults = Model.Sim_Sensitivity_Analysis(OptTable, Opt);
INPUT:
OptTable: [struct] nominal value and range for each parameter.
st: [vector] nominal values for 'T1', 'rb', 'ra'
fx: [binary vector] do not vary this parameter?
lb: [vector] vary from lb...
ub: [vector] up to ub
Opt: [struct] Options of the simulation with fields:
struct with fields:
SNR: 50
EXAMPLE:
Model = inversion_recovery
% T1 rb ra
OptTable.st = [6e+02 -1e+03 5e+02]; % nominal values
OptTable.fx = [0 1 1]; %vary T1...
OptTable.lb = [0.0001 -1e+04 0.0001]; %...from 0.0001
OptTable.ub = [5e+03 0 1e+04]; %...to 5000
Opt.SNR = 50;
Opt.Nofrun = 5;
% run simulation using options `Opt(1)`
SimResults = Model.Sim_Sensitivity_Analysis(OptTable,Opt(1));
figure('Name','Sensitivity Analysis');
SimVaryPlot(SimResults, 'T1' ,'T1' );
------------------------------
SAVED: inversion_recovery_batch.m
Demo is ready at: /private/tmp/qMRLab/inversion_recovery_demo
------------------------------
inversion_recovery: Compute a T1 map using Inversion Recovery data
Assumptions:
(1) Gold standard for T1 mapping
(2) Infinite TR
Inputs:
IRData Inversion Recovery data (4D)
(Mask) Binary mask to accelerate the fitting (OPTIONAL)
Outputs:
T1 transverse relaxation time [ms]
b arbitrary fit parameter (S=a + b*exp(-TI/T1))
a arbitrary fit parameter (S=a + b*exp(-TI/T1))
idx index of last polarity restored datapoint (only used for magnitude data)
res Fitting residual
Protocol:
IRData [TI1 TI2...TIn] inversion times [ms]
Options:
Method Method to use in order to fit the data, based on whether complex or only magnitude data acquired.
'complex' RD-NLS (Reduced-Dimension Non-Linear Least Squares)
S=a + b*exp(-TI/T1)
'magnitude' RD-NLS-PR (Reduced-Dimension Non-Linear Least Squares with Polarity Restoration)
S=|a + b*exp(-TI/T1)|
Example of command line usage (see also showdemo inversion_recovery_batch):
Model = inversion_recovery; % Create class from model
Model.Prot.IRData.Mat=[350.0000; 500.0000; 650.0000; 800.0000; 950.0000; 1100.0000; 1250.0000; 1400.0000; 1700.0000];
data = struct; % Create data structure
data.MET2data ='IRData.mat'; % Load data
data.Mask = 'Mask.mat';
FitResults = FitData(data,Model); %fit data
FitResultsSave_mat(FitResults);
For more examples: qMRusage(inversion_recovery)
Author: Ilana Leppert, 2017
References:
Please cite the following if you use this module:
A robust methodology for in vivo T1 mapping. Barral JK, Gudmundson E, Stikov N, Etezadi-Amoli M, Stoica P, Nishimura DG. Magn Reson Med. 2010 Oct;64(4):1057-67. doi: 10.1002/mrm.22497.
In addition to citing the package:
Cabana J-F, Gu Y, Boudreau M, Levesque IR, Atchia Y, Sled JG, Narayanan S, Arnold DL, Pike GB, Cohen-Adad J, Duval T, Vuong M-T and Stikov N. (2016), Quantitative magnetization transfer imaging made easy with qMTLab: Software for data simulation, analysis, and visualization. Concepts Magn. Reson.. doi: 10.1002/cmr.a.21357
Reference page for inversion_recovery
Warning: Environment Variable 'ISTRAVIS'=1: close window immediatly. run
>>setenv('ISTRAVIS','') to change this behavior.
> In Custom_OptionsGUI>OptionsGUI_OutputFcn (line 162)
In gui_mainfcn (line 262)
In Custom_OptionsGUI (line 32)
In inversion_recovery_batch (line 32)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Fitting voxel 3/4532
...done 0%
Warning: Directory already exists.
> In FitResultsSave_nii (line 9)
In inversion_recovery_batch (line 92)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Elapsed time is 1.235961 seconds.
===============================================================
Testing: vfa_t1 BATCH...
===============================================================
Model =
vfa_t1 with properties:
MRIinputs: {'VFAData' 'B1map' 'Mask'}
xnames: {'M0' 'T1'}
voxelwise: 1
Prot: [1×1 struct]
st: [2000 0.7000]
lb: [0 1.0000e-05]
ub: [6000 5]
fx: [0 0]
buttons: {}
options: [1×1 struct]
Sim_Single_Voxel_Curve_buttons: {'SNR' [50]}
Sim_Optimize_Protocol_buttons: {1×6 cell}
version: [2 0 10]
ModelName: 'vfa_t1'
Please wait. Downloading data ...
Data has been downloaded ...
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'M0', 'T1'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
EXAMPLE:
Model = vfa_t1
x = struct;
x.M0 = 2000;
x.T1 = 0.7;
% Get all possible options
Opt = button2opts(Model.Sim_Single_Voxel_Curve_buttons,1);
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'M0', 'T1'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 50
EXAMPLE:
Model = vfa_t1
x = struct;
x.M0 = 2000;
x.T1 = 0.7;
% Get all possible options
Opt = button2opts(Model.Sim_Single_Voxel_Curve_buttons,1);
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Sensitivity_Analysis
Simulates sensitivity to fitted parameters:
(1) vary fitting parameters from lower (lb) to upper (ub) bound in 10 steps
(2) run Sim_Single_Voxel_Curve Nofruns times
(3) Compute mean and std across runs
USAGE:
SimVaryResults = Model.Sim_Sensitivity_Analysis(OptTable, Opt);
INPUT:
OptTable: [struct] nominal value and range for each parameter.
st: [vector] nominal values for 'M0', 'T1'
fx: [binary vector] do not vary this parameter?
lb: [vector] vary from lb...
ub: [vector] up to ub
Opt: [struct] Options of the simulation with fields:
struct with fields:
SNR: 50
EXAMPLE:
Model = vfa_t1
% M0 T1
OptTable.st = [2e+03 0.7]; % nominal values
OptTable.fx = [0 1]; %vary M0...
OptTable.lb = [0 1e-05]; %...from 0
OptTable.ub = [6e+03 5]; %...to 6000
Opt.SNR = 50;
Opt.Nofrun = 5;
% run simulation using options `Opt(1)`
SimResults = Model.Sim_Sensitivity_Analysis(OptTable,Opt(1));
figure('Name','Sensitivity Analysis');
SimVaryPlot(SimResults, 'M0' ,'M0' );
------------------------------
SAVED: vfa_t1_batch.m
Demo is ready at: /private/tmp/qMRLab/vfa_t1_demo
------------------------------
vfa_t1: Compute a T1 map using Variable Flip Angle
Assumptions:
Inputs:
VFAData spoiled Gradient echo data, 4D volume with different flip angles in time dimension
(B1map) excitation (B1+) fieldmap. Used to correct flip angles. (optional)
(Mask) Binary mask to accelerate the fitting (optional)
Outputs:
T1 Longitudinal relaxation time [s]
M0 Equilibrium magnetization
Protocol:
VFAData Array [nbFA x 2]:
[FA1 TR1; FA2 TR2;...] flip angle [degrees] TR [s]
Options:
None
Example of command line usage (see also showdemo vfa_t1_batch):
Model = vfa_t1; % Create class from model
Model.Prot.VFAData.Mat=[3 0.015; 20 0.015]; %Protocol: 2 different FAs
data = struct; % Create data structure
data.VFAData = load_nii_data('VFAData.nii.gz');
data.B1map = load_nii_data('B1map.nii.gz');
FitResults = FitData(data,Model); %fit data
FitResultsSave_mat(FitResults);
For more examples: qMRusage(vfa_t1)
Author: Ian Gagnon, 2017
References:
Please cite the following if you use this module:
Fram, E.K., Herfkens, R.J., Johnson, G.A., Glover, G.H., Karis, J.P.,
Shimakawa, A., Perkins, T.G., Pelc, N.J., 1987. Rapid calculation of
T1 using variable flip angle gradient refocused imaging. Magn. Reson.
Imaging 5, 201?208
In addition to citing the package:
Cabana J-F, Gu Y, Boudreau M, Levesque IR, Atchia Y, Sled JG,
Narayanan S, Arnold DL, Pike GB, Cohen-Adad J, Duval T, Vuong M-T and
Stikov N. (2016), Quantitative magnetization transfer imaging made
easy with qMTLab: Software for data simulation, analysis, and
visualization. Concepts Magn. Reson.. doi: 10.1002/cmr.a.21357
Reference page for vfa_t1
Warning: Environment Variable 'ISTRAVIS'=1: close window immediatly. run
>>setenv('ISTRAVIS','') to change this behavior.
> In Custom_OptionsGUI>OptionsGUI_OutputFcn (line 162)
In gui_mainfcn (line 262)
In Custom_OptionsGUI (line 32)
In vfa_t1_batch (line 32)
In BatchExample_test>test_batch (line 55)
In MOxUnitFunctionHandleTestCase/run (line 24)
In MOxUnitTestSuite/run (line 53)
In MOxUnitTestSuite/run (line 53)
In moxunit_runtests>@()run(suite,test_report,params.partition_index,params.partition_count)
In moxunit_runtests>run_all_tests (line 207)
In moxunit_runtests (line 102)
Fitting voxel 3/4668
...done 0%
M0: 2.5567e+03
Model: [1×1 vfa_t1]
Protocol: [1×1 struct]
T1: 1.3447
Time: 0.1078
Version: [2 0 10]
computed: [128×128 double]
fields: {'T1' 'M0'}
T1: 0.7423
M0: 2.0969e+03
Elapsed time is 1.584384 seconds.
===============================================================
Testing: mwf BATCH...
===============================================================
Model =
mwf with properties:
MRIinputs: {'MET2data' 'Mask'}
xnames: {'MWF' 'T2MW' 'T2IEW'}
voxelwise: 1
lb: [1.0000e-04 1.0000e-04 40]
ub: [100 40 200]
fx: [0 0 0]
Prot: [1×1 struct]
buttons: {1×6 cell}
options: [1×1 struct]
Sim_Single_Voxel_Curve_buttons: {1×9 cell}
Sim_Sensitivity_Analysis_buttons: {'# of run' [5]}
version: [2 0 10]
ModelName: 'mwf'
Please wait. Downloading data ...
Data has been downloaded ...
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'MWF', 'T2MW', 'T2IEW'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 200
T2Spectrumvariance_Myelin: 5
T2Spectrumvariance_IEIntraExtracellularWater: 20
EXAMPLE:
Model = mwf
x = struct;
x.MWF = 50.0001;
x.T2MW = 20.0001;
x.T2IEW = 120;
% Get all possible options
Opt = button2opts(Model.Sim_Single_Voxel_Curve_buttons,1);
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Single_Voxel_Curve
Simulates Single Voxel curves:
(1) use equation to generate synthetic MRI data
(2) add rician noise
(3) fit and plot curve
USAGE:
FitResults = Model.Sim_Single_Voxel_Curve(x)
FitResults = Model.Sim_Single_Voxel_Curve(x, Opt,display)
INPUT:
x: [struct] OR [vector] containing fit results: 'MWF', 'T2MW', 'T2IEW'
display: [binary] 1=display, 0=nodisplay
Opt: struct with fields:
SNR: 200
T2Spectrumvariance_Myelin: 5
T2Spectrumvariance_IEIntraExtracellularWater: 20
EXAMPLE:
Model = mwf
x = struct;
x.MWF = 50.0001;
x.T2MW = 20.0001;
x.T2IEW = 120;
% Get all possible options
Opt = button2opts(Model.Sim_Single_Voxel_Curve_buttons,1);
% run simulation using options `Opt(1)`
figure('Name','Single Voxel Curve Simulation');
FitResult = Model.Sim_Single_Voxel_Curve(x,Opt(1));
Sim_Sensitivity_Analysis
Simulates sensitivity to fitted parameters:
(1) vary fitting parameters from lower (lb) to upper (ub) bound in 10 steps
(2) run Sim_Single_Voxel_Curve Nofruns times
(3) Compute mean and std across runs
USAGE:
SimVaryResults = Model.Sim_Sensitivity_Analysis(OptTable, Opt);
INPUT:
OptTable: [struct] nominal value and range for each parameter.
st: [vector] nominal values for 'MWF', 'T2MW', 'T2IEW'
fx: [binary vector] do not vary this parameter?
lb: [vector] vary from lb...
ub: [vector] up to ub
Opt: [struct] Options of the simulation with fields:
struct with fields:
SNR: 200
T2Spectrumvariance_Myelin: 5
T2Spectrumvariance_IEIntraExtracellularWater: 20
Nofrun: 5
EXAMPLE:
Model = mwf
% MWF T2MW T2IEW
OptTable.st = [50 20 1.2e+02]; % nominal values
OptTable.fx = [0 1 1]; %vary MWF...
OptTable.lb = [0.0001 0.0001 40]; %...from 0.0001
OptTable.ub = [1e+02 40 2e+02]; %...to 100
% Get all possible options
Opt = button2opts([Model.Sim_Single_Voxel_Curve_buttons, Model.Sim_Sensitivity_Analysis_buttons],1);
% run simulation using options `Opt(1)`
SimResults = Model.Sim_Sensitivity_Analysis(OptTable,Opt(1));
figure('Name','Sensitivity Analysis');
SimVaryPlot(SimResults, 'MWF' ,'MWF' );
------------------------------
SAVED: mwf_batch.m
Demo is ready at: /private/tmp/qMRLab/mwf_demo
------------------------------
mwf : Myelin Water Fraction from Multi-Exponential T2w data
Assumptions:
Inputs:
MET2data Multi-Exponential T2 data
(Mask) Binary mask to accelerate the fitting (OPTIONAL)
Outputs:
mwf Myelin Wanter Fraction
T2MW Spin relaxation time for Myelin Water (MW) [ms]
T2IEW Spin relaxation time for Intra/Extracellular Water (IEW) [ms]
Options:
Cutoff Cutoff time [ms]
Sigma Noise standard deviation. Currently not corrected for rician bias
Relaxation Type
'T2' For a SE sequence
'T2*' For a GRE sequence
Protocol:
MET2data [TE1 TE2 ...] % list of echo times [ms]
Example of command line usage (see also showdemo mwf_batch):
Model = mwf; % Create class from model
Model.Prot.MET2data.Mat=[10:10:320];
data = struct; % Create data structure
data.MET2data ='MET2data.mat'; % Load data
data.Mask = 'Mask.mat';
FitResults = FitData(data,Model); %fit data
FitResultsSave_mat(FitResults);
For more examples: qMRusage(mwf)
Author: Ian Gagnon, 2017
References:
Please cite the following if you use this module:
MacKay, A., Whittall, K., Adler, J., Li, D., Paty, D., Graeb, D.,
1994. In vivo visualization of myelin water in brain by magnetic
resonance. Magn. Reson. Med. 31, 673?677.
In addition to citing the package:
Cabana J-F, Gu Y, Boudreau M, Levesque IR, Atchia Y, Sled JG,
Narayanan S, Arnold DL, Pike GB, Cohen-Adad J, Duval T, Vuong M-T and
Stikov N. (2016), Quantitative magnetization transfer imaging made
easy with qMTLab: Software for data simulation, analysis, and
visualization. Concepts Magn. Reson.. doi: 10.1002/cmr.a.21357
Reference page for mwf
Fitting voxel 3/2540
...done 0%
Elapsed time is 2.880604 seconds.
..
--------------------------------------------------
OK (passed=3)
res =
logical
1