filter_map: Applies spatial filtering (2D or 3D)Ā¶


% This m-file has been automatically generated using qMRgenBatch(filter_map)
    % 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 filter_map on CLI.
    % Demo files are downloaded into filter_map_data folder.
    % Written by: Agah Karakuzu, 2017
    % =========================================================================


qMRinfo('filter_map'); % Describe the model
  filter_map:   Applies spatial filtering (2D or 3D)

    Assumptions: If a 3D volume is provided and 2D filtering is requested, each slice will be processsed independently

    Raw                Input data to be filtered
    (Mask)             Binary mask to exclude voxels from smoothing

    Filtered           Filtered output map (see FilterClass.m for more info)


    (inherited from FilterClass)

    Example of command line usage:

    For more examples: a href="matlab: qMRusage(filter_map);"qMRusage(filter_map)/a

    Author: Ilana Leppert Dec 2018

    Please cite the following if you use this module:
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 filter_map



a- create object

Model = filter_map;

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

         |- filter_map object needs 2 data input(s) to be assigned:
    |-   Raw
    |-   Mask
data = struct();
    % Raw.nii.gz contains [128  128   35] data.
    % Mask.nii.gz contains [128  128   35] data.

b- fit dataset

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

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, 'filter_map_data/Raw.nii.gz');
Warning: Directory already exists.


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

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.