{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# I- DESCRIPTION" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "qMRinfo('mt_sat'); % 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 = mt_sat;" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Download sample data from OSF\n", "> The current `Model` is an instance of `mt_sat` class.\n", " \n", "You can manually download the sample data for `mt_sat` [by clicking here](https:\/\/osf.io\/c5wdb\/download?version=3)." ] }, { "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", "% |- mt_sat object needs 3 protocol field(s) to be assigned:\n", "% |- MTw\n", "% |- T1w\n", "% |- PDw" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "FlipAngle = 6;\n", "TR = 0.028;\n", "Model.Prot.MTw.Mat = [ FlipAngle TR ];\n", "%% \n", "FlipAngle = 20;\n", "TR = 0.018;\n", "Model.Prot.T1w.Mat = [ FlipAngle TR];\n", "%% \n", "FlipAngle = 6;\n", "TR = 0.028;\n", "Model.Prot.PDw.Mat = [ FlipAngle TR];\n", "%% " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# III- FIT EXPERIMENTAL DATASET\n", "## a- Load experimental data\n", "% |- mt_sat object needs 5 data input(s) to be assigned:\n", "% |- MTw\n", "% |- T1w\n", "% |- PDw\n", "% |- B1map\n", "% |- Mask" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "% MTw.nii.gz contains [128 128 96] data.\n", "data.MTw=double(load_nii_data('mt_sat_data\/MTw.nii.gz'));\n", "% T1w.nii.gz contains [128 128 96] data.\n", "data.T1w=double(load_nii_data('mt_sat_data\/T1w.nii.gz'));\n", "% PDw.nii.gz contains [128 128 96] data.\n", "data.PDw=double(load_nii_data('mt_sat_data\/PDw.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, 'mt_sat_data\/MTw.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 }