{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# I- DESCRIPTION" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "qMRinfo('b1_afi'); % Describe the model" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# II- MODEL PARAMETERS\n", "## a- Create object" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "Model = b1_afi;" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Download sample data from OSF\n", "> The current `Model` is an instance of `b1_afi` class.\n", " \n", "You can manually download the sample data for `b1_afi` [by clicking here](https:\/\/osf.io\/csjgx\/download?version=9)." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "dataDir = downloadData(Model,pwd);" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## b- Set protocol\n", "> Protocol is set according to the example data\n", " \n", "% |- b1_afi object needs 1 protocol field(s) to be assigned:\n", "% |- Sequence" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "nomFA = 60;\n", "TR1 = 20;\n", "TR2 = 100;\n", "Model.Prot.Sequence.Mat = [ nomFA TR1 TR2];\n", "%% " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# III- FIT EXPERIMENTAL DATASET\n", "## a- Load experimental data\n", "% |- b1_afi object needs 3 data input(s) to be assigned:\n", "% |- AFIData1\n", "% |- AFIData2\n", "% |- Mask" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "% AFIData1.nii.gz contains [88 128 32] data.\n", "data.AFIData1=double(load_nii_data('b1_afi_data\/AFIData1.nii.gz'));\n", "% AFIData2.nii.gz contains [88 128 32] data.\n", "data.AFIData2=double(load_nii_data('b1_afi_data\/AFIData2.nii.gz'));\n", " " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## b- Fit experimental data\n", "> This section will fit data." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "FitResults = FitData(data,Model,0);" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## c- Show fitting results\n", "> * Output map will be displayed.\n", " \n", "> * If available, a graph will be displayed to show fitting in a voxel." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "qMRshowOutput(FitResults,data,Model);" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## d- Save results\n", "> * qMR maps are saved in NIFTI and in a structure `FitResults.mat` that can be loaded in qMRLab graphical user interface.\n", "> * Model object stores all the options and protocol\n", "> * These objects can be easily shared or be used for simulation." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "FitResultsSave_nii(FitResults, 'b1_afi_data\/AFIData1.nii.gz');" ] } ], "metadata": { "kernelspec": { "display_name": "Octave", "language": "octave", "name": "octave" }, "language_info": { "file_extension": ".m", "help_links": [ { "text": "GNU Octave", "url": "https:\/\/www.gnu.org\/software\/octave\/support.html" }, { "text": "Octave Kernel", "url": "https:\/\/github.com\/Calysto\/octave_kernel" }, { "text": "MetaKernel Magics", "url": "https:\/\/github.com\/calysto\/metakernel\/blob\/master\/metakernel\/magics\/README.md" } ], "mimetype": "text\/x-octave", "name": "octave", "version": "4.2.1" }, "toc": { "nav_menu": null, "number_sections": true, "sideBar": false, "skip_h1_title": false, "toc_cell": false, "toc_position": null, "toc_section_display": "block", "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }