b0_dem map : Dual Echo Method for B0 mappingĀ¶



% This m-file has been automatically generated using qMRgenBatch(b0_dem)
    % Command Line Interface (CLI) is well-suited for automatization
    % purposes and Octave.
    % Please execute this m-file section by section to get familiar with batch
    % processing for b0_dem on CLI.
    % Demo files are downloaded into b0_dem_data folder.
    % Written by: Agah Karakuzu, 2017
    % =========================================================================


qMRinfo('b0_dem'); % Describe the model
  b0_dem map :  Dual Echo Method for B0 mapping

    Compute B0 map based on 2 phase images with different TEs

    Phase       4D phase image, 2 different TEs in time dimension
    Magn        3D magnitude image

    B0map       B0 field map [Hz]

    deltaTE     Difference in TE between 2 images [ms]

    Magn thresh     relative threshold for the magnitude (phase is undefined in the background

    Example of command line usage:
    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: a href="matlab: qMRusage(b0_dem);"qMRusage(b0_dem)/a

    Author: Ian Gagnon, 2017

    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:
Karakuzu A., Boudreau M., Duval T.,Boshkovski T., Leppert I.R., Cabana J.F.,
Gagnon I., Beliveau P., Pike G.B., Cohen-Adad J., Stikov N. (2020), qMRLab:
Quantitative MRI analysis, under one umbrella doi: 10.21105/joss.02343

    Reference page in Doc Center
    doc b0_dem



a- create object

Model = b0_dem;

b- modify options

         |- This section will pop-up the options GUI. Close window to continue.
    |- Octave is not GUI compatible. Modify Model.options directly.
Model = Custom_OptionsGUI(Model); % You need to close GUI to move on.


a- load experimental data

         |- b0_dem object needs 2 data input(s) to be assigned:
    |-   Phase
    |-   Magn
data = struct();
    % Phase.nii.gz contains [64  64   1   8] data.
    % Magn.nii.gz contains [64  64   1   8] data.

b- fit dataset

           |- This section will fit data.
FitResults = FitData(data,Model,0);
=============== qMRLab::Fit ======================
    Operation has been started: b0_dem
    Elapsed time is 1.843207 seconds.
    Operation has been completed: b0_dem

c- show fitting results

         |- Output map will be displayed.
    |- If available, a graph will be displayed to show fitting in a voxel.
    |- To make documentation generation and our CI tests faster for this model,
    we used a subportion of the data (40X40X40) in our testing environment.
    |- Therefore, this example will use FitResults that comes with OSF data for display purposes.
    |- Users will get the whole dataset (384X336X224) and the script that uses it for demo
    via qMRgenBatch(qsm_sb) command.
FitResults_old = load('FitResults/FitResults.mat');

d- Save results

         |-  qMR maps are saved in NIFTI and in a structure FitResults.mat
    that can be loaded in qMRLab graphical user interface
    |-  Model object stores all the options and protocol.
    It can be easily shared with collaborators to fit their
    own data or can be used for simulation.
FitResultsSave_nii(FitResults, 'b0_dem_data/Phase.nii.gz');
Warning: Directory already exists.


   |- This section can be executed to run simulations for b0_dem.

a- Single Voxel Curve

         |- Simulates Single Voxel curves:
    (1) use equation to generate synthetic MRI data
    (2) add rician noise
    (3) fit and plot curve
% Not available for the current model.

b- Sensitivity Analysis

         |-    Simulates sensitivity to fitted parameters:
    (1) vary fitting parameters from lower (lb) to upper (ub) bound.
    (2) run Sim_Single_Voxel_Curve Nofruns times
    (3) Compute mean and std across runs
% Not available for the current model.