{ "cells": [ { "cell_type": "markdown", "metadata": { "kernel": "SoS", "tags": [ "scratch" ] }, "source": [ "# Welcome to the Inversion Recovery blog post Jupyter Notebook!\n", "\n", "If this is your first time running a Juptyer Notebook, there's a lot of tutorials available online to help. [Here's one](https://www.dataquest.io/blog/jupyter-notebook-tutorial/) for your convenience.\n", "\n", "## Introduction\n", "\n", "This notebook contains everything needed to reproduce the Inversion Recovery T1 blog post on the [qMRLab website](). In fact, this notebook generated the HTML for the blog post too! This notebook is currently running on a MyBinder server that only you can access, but if you want to be kept up-to-date on any changes that the developpers make to this notebook, you should go to it's [GitHub repository](https://github.com/qMRLab/t1_notebooks) and follow it by clicking the \"Watch\" button in the top right (you may need to create a GitHub account, if you don't have one already).\n", "\n", "## Tips\n", "\n", "Here's a few things you can do in this notebook\n", "\n", "### Code\n", "* Run the entire processing by clicking above on the \"Kernel\" tab, then \"Restart & Run All\". Currently, the processing time is approximately **30-45 minutes**. It will be complete when none of the cells have an asterix \"\\*\" in the square brackets.\n", "* To change the code, you need to click once on code cells. To re-run that cell, click the \"Run\" button above when the cell is selected.\n", " * **Note:** Cells can depend on previous cells, or even on previous runs of the cell itself, so it's best to run all the previous cells beforehand.\n", "* This binder runs on SoS, which allows the mixing of Octave (i.e. an open-source MATLAB) and Python cells. Take a look a the drop down menu on the top right of the cells to know which one you are running.\n", "* To transfer data from cells of one language to another, you need to create a new cell in the incoming language and run `%get (param name) --from (outgoing language)`. See cells below for several examples within this notebook.\n", "\n", "### HTML\n", "* To reproduce the HTML of the blog post, run the entire processing pipeline (see point one in the previous section), then save the notebook (save icon, top left). Now, click on the drop down menu on the left pannel, and select `%sossave --to html --force` . After a few seconds, it should output \"Workflow saved to InversionRecovery.html\" – click on the HTML name, and you're done!\n", "* Cells with tags called \"scratch\" are not displayed in the generated HTML.\n", "* Cells with the tag \"report_output\" display the output (e.g. figures) in the generated HTML.\n", "* Currently in an un-run notebook, the HTML is not formatted like the website. To do so, run the Python module import cell (`# Module imports`) and then very last cell (`display(HTML(...`).\n", "\n", "**If you have any other questions or comments, please raise them in a [GitHub issue](https://github.com/qMRLab/t1_notebooks/issues).**" ] }, { "cell_type": "markdown", "metadata": { "kernel": "SoS", "tags": [ "scratch" ] }, "source": [ "# Note\n", "\n", "The following cell is meant to be displayed for instructional purposes in the blog post HTML when \"All cells\" gets displayed (i.e. the Octave code)." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Octave" }, "outputs": [], "source": [ "% **Blog post code introduction**\n", "% \n", "% Congrats on activating the \"All cells\" option in this interactive blog post =D\n", "%\n", "% Below, several new HTML blocks have appears prior to the figures, displaying the Octave/MATLAB code that was used to generate the figures in this blog post.\n", "%\n", "% If you want to reproduce the data on your own local computer, you simply need to have qMRLab installed in your Octave/MATLAB path and run the \"startup.m\" file, as is shown below.\n", "%\n", "% If you want to get under the hood and modify the code right now, you can do so in the Jupyter Notebook of this blog post hosted on MyBinder. The link to it is in the introduction above." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Python3", "tags": [ "scratch" ] }, "outputs": [], "source": [ "# PYTHON CODE\n", "# Module imports\n", "\n", "import matplotlib.pyplot as plt\n", "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "import numpy as np\n", "from plotly import __version__\n", "from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot\n", "config={'showLink': False, 'displayModeBar': False}\n", "\n", "init_notebook_mode(connected=True)\n", "\n", "from IPython.core.display import display, HTML" ] }, { "cell_type": "markdown", "metadata": { "kernel": "SoS" }, "source": [ "

Inversion Recovery T1 Mapping

\n", "

" ] }, { "cell_type": "markdown", "metadata": { "kernel": "SoS" }, "source": [ "

\n", "

\n", "Widely considered the gold standard for T1 mapping, the inversion recovery technique estimates T1 values by fitting the signal recovery curve acquired at different delays after an inversion pulse (180°). In a typical inversion recovery experiment (Figure 1), the magnetization at thermal equilibrium is inverted using a 180° RF pulse. After the longitudinal magnetization recovers through spin-lattice relaxation for predetermined delay (“inversion time”, TI), a 90° excitation pulse is applied, followed by a readout imaging sequence (typically a spin-echo or gradient-echo readout) to create a snapshot of the longitudinal magnetization state at that TI.\n", "

\n", "\n", "

\n", "Inversion recovery was first developed for NMR in the 1940s (Hahn 1949; Drain 1949), and the first T1 map was acquired using a saturation-recovery technique (90° as a preparation pulse instead of 180°) by (Pykett and Mansfield 1978). Some distinct advantages of inversion recovery are its large dynamic range of signal change and an insensitivity to pulse sequence parameter imperfections (Stikov et al. 2015). Despite its proven robustness at measuring T1, inversion recovery is scarcely used in practice, because conventional implementations require repetition times (TRs) on the order of 2 to 5 T1 (Steen et al. 1994), making it challenging to acquire whole-organ T1 maps in a clinically feasible time. Nonetheless, it is continuously used as a reference measurement during the development of new techniques, or when comparing different T1 mapping techniques, and several variations of the inversion recovery technique have been developed, making it practical for some applications (Messroghli et al. 2004; Piechnik et al. 2010).\n", "

\n", "
" ] }, { "cell_type": "markdown", "metadata": { "kernel": "SoS" }, "source": [ "
\n", "
\n", "\n", "Figure 1. Pulse sequence of an inversion recovery experiment.\n", "\n", "
\n", "
\n", "\n", "

\n", "

" ] }, { "cell_type": "markdown", "metadata": { "kernel": "SoS" }, "source": [ "

Signal Modelling

" ] }, { "cell_type": "markdown", "metadata": { "kernel": "SoS" }, "source": [ "
\n", "

\n", "The steady-state longitudinal magnetization of an inversion recovery experiment can be derived from the Bloch equations for the pulse sequence {θ180 – TI – θ90 – (TR-TI)}, and is given by:\n", "\n", "

\n", "\n", "

\n", "

\n", "

\n", "\n", "

\n", "where Mz is the longitudinal magnetization prior to the θ90 pulse. If the in-phase real signal is desired, it can be calculated by multiplying Eq. 1 by ksin(θ90)e-TE/T2, where k is a constant. This general equation can be simplified by grouping together the constants for each measurements regardless of their values (i.e. at each TI, same TE and θ90 are used) and assuming an ideal inversion pulse:\n", "

\n", "\n", "

\n", "

\n", "

\n", "\n", "

\n", "where the first three terms and the denominator of Eq. 1 have been grouped together into the constant C. If the experiment is designed such that TR is long enough to allow for full relaxation of the magnetization (TR > 5T1), we can do an additional approximation by dropping the last term in Eq. 2:\n", "

\n", "\n", "

\n", "

\n", "

\n", "\n", "

\n", "The simplicity of the signal model described by Eq. 3, both in its equation and experimental implementation, has made it the most widely used equation to describe the signal evolution in an inversion recovery T1 mapping experiment. The magnetization curves are plotted in Figure 2 for approximate T1 values of three different tissues in the brain. Note that in many practical implementations, magnitude-only images are acquired, so the signal measured would be proportional to the absolute value of Eq. 3.\n", "

\n", "
" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "
\n", "

\n", "\n", "Figure 2. Inversion recovery curves (Eq. 2) for three different T1 values, approximating the main types of tissue in the brain.\n", "\n", "

\n", "
" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Octave" }, "outputs": [], "source": [ "%% MATLAB/OCTAVE CODE\n", "% Adds qMRLab to the path of the environment\n", "\n", "cd ../qMRLab\n", "startup" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Octave" }, "outputs": [], "source": [ "%% MATLAB/OCTAVE CODE\n", "% Code used to generate the data required for Figure 2 of the blog post\n", "\n", "clear all\n", "\n", "%% Setup parameters\n", "% All times are in seconds\n", "% All flip angles are in degrees\n", "\n", "params.TR = 5.0;\n", "params.TI = linspace(0.001, params.TR, 1000);\n", " \n", "params.TE = 0.004;\n", "params.T2 = 0.040;\n", " \n", "params.EXC_FA = 90; % Excitation flip angle\n", "params.INV_FA = 180; % Inversion flip angle\n", "\n", "params.signalConstant = 1;\n", "\n", "%% Calculate signals\n", "%\n", "% The option 'GRE-IR' selects the analytical equations for the gradient echo readout inversion recovery experiment\n", "% The option '4' is a flag that selects the long TR approximation of the analytical solution (TR>>T1), Eq. 3 of the blog post.\n", "%\n", "% To see all the options available, run `help inversion_recovery.analytical_solution`\n", "\n", "% White matter\n", "params.T1 = 0.900; % in seconds\n", "\n", "signal_WM = inversion_recovery.analytical_solution(params, 'GRE-IR', 4);\n", "\n", "% Grey matter\n", "params.T1 = 1.500; % in seconds\n", "signal_GM = inversion_recovery.analytical_solution(params, 'GRE-IR', 4);\n", "\n", "% CSF\n", "params.T1 = 4.000; % in seconds\n", "signal_CSF = inversion_recovery.analytical_solution(params, 'GRE-IR', 4);" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Python3", "tags": [ "scratch" ] }, "outputs": [], "source": [ "%get params --from Octave\n", "%get signal_WM --from Octave\n", "%get signal_GM --from Octave\n", "%get signal_CSF --from Octave" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Python3", "tags": [ "report_output", "scratch" ] }, "outputs": [], "source": [ "# PYTHON CODE\n", "\n", "init_notebook_mode(connected=True)\n", "# The polling here is to ensure that plotly.js has already been loaded before\n", "# setting display alignment in order to avoid a race condition.\n", "\n", "wm = go.Scatter(\n", " x = params[\"TI\"],\n", " y = signal_WM,\n", " name = 'T1 = 0.9 s (White Matter)',\n", " text = 'T1 = 0.9 s (White Matter)',\n", " hoverinfo = 'x+y+text'\n", ")\n", "\n", "gm = go.Scatter(\n", " x = params[\"TI\"],\n", " y = signal_GM,\n", " name = 'T1 = 1.5 s (Grey Matter)',\n", " text = 'T1 = 1.5 s (Grey Matter)',\n", " hoverinfo = 'x+y+text'\n", ")\n", "\n", "csf = go.Scatter(\n", " x = params[\"TI\"],\n", " y = signal_CSF,\n", " name = 'T1 = 4.0 s (Cerebrospinal Fluid)',\n", " text = 'T1 = 4.0 s (Cerebrospinal Fluid)',\n", " hoverinfo = 'x+y+text'\n", ")\n", "\n", "data = [wm, gm, csf]\n", "\n", "layout = go.Layout(\n", " width=600,\n", " height=350,\n", " margin=go.layout.Margin(\n", " l=100,\n", " r=50,\n", " b=60,\n", " t=0,\n", " ),\n", " annotations=[\n", " dict(\n", " x=0.5004254919715793,\n", " y=-0.175,\n", " showarrow=False,\n", " text='Inversion Time – TI (ms)',\n", " font=dict(\n", " family='Times New Roman',\n", " size=22\n", " ),\n", " xref='paper',\n", " yref='paper'\n", " ),\n", " dict(\n", " x=-0.15,\n", " y=0.50,\n", " showarrow=False,\n", " text='Long. Magnetization (Mz)',\n", " font=dict(\n", " family='Times New Roman',\n", " size=22\n", " ),\n", " textangle=-90,\n", " xref='paper',\n", " yref='paper'\n", " ),\n", " ],\n", " xaxis=dict(\n", " showgrid=False,\n", " linecolor='black',\n", " linewidth=2\n", " ),\n", " yaxis=dict(\n", " showgrid=False,\n", " linecolor='black',\n", " linewidth=2\n", " ),\n", " legend=dict(\n", " x=0.55,\n", " y=0.15,\n", " traceorder='normal',\n", " font=dict(\n", " family='Times New Roman',\n", " size=12,\n", " color='#000'\n", " ),\n", " bordercolor='#000000',\n", " borderwidth=2\n", " )\n", ")\n", "\n", "fig = dict(data=data, layout=layout)\n", "\n", "iplot(fig, filename = 'basic-line', config = config)" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "
\n", "

\n", "Practically, Eq. 1 is the better choice for simulating the signal of an inversion recovery experiment, as the TRs are often chosen to be greater than 5T1 of the tissue-of-interest, which rarely coincides with the longest T1 present (e.g. TR may be sufficiently long for white matter, but not for CSF which could also be present in the volume). Equation 3 also assumes ideal inversion pulses, which is rarely the case due to slice profile effects. Figure 3 displays the inversion recovery signal magnitude (complete relaxation normalized to 1) of an experiment with TR = 5 s and T1 values ranging between 250 ms to 5 s, calculated using both equations.\n", "

\n", "

" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "
\n", "

\n", "\n", "Figure 3. Signal recovery curves simulated using Eq. 3 (solid) and Eq. 1 (dotted) with a TR = 5 s for T1 values ranging between 0.25 to 5 s.\n", "\n", "

" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Octave" }, "outputs": [], "source": [ "%% MATLAB/OCTAVE CODE\n", "% Code used to generate the data required for Figure 3 of the blog post\n", "\n", "clear all\n", "\n", "%% Setup parameters\n", "% All times are in seconds\n", "% All flip angles are in degrees\n", "\n", "params.TR = 5.0;\n", "params.TI = linspace(0.001, params.TR, 1000);\n", " \n", "params.TE = 0.004;\n", "params.T2 = 0.040;\n", " \n", "params.EXC_FA = 90; % Excitation flip angle\n", "params.INV_FA = 180; % Inversion flip angle\n", "\n", "params.signalConstant = 1;\n", "\n", "T1_range = 0.25:0.25:5; % in seconds\n", "\n", "%% Calculate signals\n", "%\n", "% The option 'GRE-IR' selects the analytical equations for the gradient echo readout inversion recovery experiment\n", "% The option '1' is a flag that selects full analytical solution equation (no approximation), Eq. 1 of the blog post.\n", "% The option '4' is a flag that selects the long TR approximation of the analytical solution (TR>>T1), Eq. 3 of the blog post.\n", "%\n", "% To see all the options available, run `help inversion_recovery.analytical_solution`\n", "\n", "for ii = 1:length(T1_range)\n", " params.T1 = T1_range(ii);\n", " \n", " signal_T1_Eq1{ii} = inversion_recovery.analytical_solution(params, 'GRE-IR', 1);\n", "\n", " signal_T1_Eq3{ii} = inversion_recovery.analytical_solution(params, 'GRE-IR', 4);\n", "end\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Python3", "tags": [ "scratch" ] }, "outputs": [], "source": [ "%get T1_range --from Octave\n", "%get signal_T1_Eq1 --from Octave\n", "%get signal_T1_Eq3 --from Octave" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Python3", "tags": [ "report_output", "scratch" ] }, "outputs": [], "source": [ "# PYTHON CODE\n", "\n", "init_notebook_mode(connected=True)\n", "\n", "data1 = [dict(\n", " visible = False,\n", " x = params[\"TI\"],\n", " y = abs(signal_T1_Eq3[ii]),\n", " name = '[Eq. 3] – Long TR approximation',\n", " text = '[Eq. 3] – Long TR approximation',\n", " hoverinfo = 'x+y+text') for ii in range(len(T1_range))]\n", "\n", "data1[3]['visible'] = True\n", "\n", "data2 = [dict(\n", " visible = False,\n", " x = params[\"TI\"],\n", " y = abs(signal_T1_Eq1[ii]),\n", " line = dict(\n", " color = ('rgb(22, 96, 167)'),\n", " dash = 'dash'),\n", " name = '[Eq. 1] – General Equation',\n", " text = '[Eq. 1] – General Equation',\n", " hoverinfo = 'x+y+text') for ii in range(len(T1_range))]\n", "\n", "data2[3]['visible'] = True\n", "\n", "data = data1 + data2\n", "\n", "steps = []\n", "for i in range(len(T1_range)):\n", " step = dict(\n", " method = 'restyle', \n", " args = ['visible', [False] * len(data1)],\n", " label = str(T1_range[i])\n", " )\n", " step['args'][1][i] = True # Toggle i'th trace to \"visible\"\n", " steps.append(step)\n", "\n", "sliders = [dict(\n", " x = 0,\n", " y = -0.0,\n", " active = 3,\n", " currentvalue = {\"prefix\": \"T1 value (s): \"},\n", " pad = {\"t\": 50, \"b\": 10},\n", " steps = steps\n", ")]\n", "\n", "layout = go.Layout(\n", " width=580,\n", " height=400,\n", " margin=go.layout.Margin(\n", " l=80,\n", " r=40,\n", " b=60,\n", " t=10,\n", " ),\n", " annotations=[\n", " dict(\n", " x=0.5004254919715793,\n", " y=-0.2,\n", " showarrow=False,\n", " text='Inversion Time – TI (ms)',\n", " font=dict(\n", " family='Times New Roman',\n", " size=22\n", " ),\n", " xref='paper',\n", " yref='paper'\n", " ),\n", " dict(\n", " x=-0.14,\n", " y=0.5,\n", " showarrow=False,\n", " text='Signal (magnitude)',\n", " font=dict(\n", " family='Times New Roman',\n", " size=22\n", " ),\n", " textangle=-90,\n", " xref='paper',\n", " yref='paper'\n", " ),\n", " ],\n", " xaxis=dict(\n", " autorange=False,\n", " range=[0, 5],\n", " showgrid=False,\n", " linecolor='black',\n", " linewidth=2\n", " ),\n", " yaxis=dict(\n", " autorange=False,\n", " range=[0, 1],\n", " showgrid=False,\n", " linecolor='black',\n", " linewidth=2\n", " ),\n", " legend=dict(\n", " x=0.5,\n", " y=0.5,\n", " traceorder='normal',\n", " font=dict(\n", " family='Times New Roman',\n", " size=12,\n", " color='#000'\n", " ),\n", " bordercolor='#000000',\n", " borderwidth=2\n", " ), \n", " sliders=sliders\n", ")\n", "\n", "fig = dict(data=data, layout=layout)\n", "\n", "iplot(fig, filename = 'basic-line', config = config)" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "

Data Fitting

" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "
\n", "

\n", "Several factors impact the choice of the inversion recovery fitting algorithm. If only magnitude images are available, then a polarity-inversion is often implemented to restore the non-exponential magnitude curves (Figure 3) into the exponential form (Figure 2). This process is sensitive to noise due to the Rician noise creating a non-zero level at the signal null. If phase data is also available, then a phase term must be added to the fitting equation (Barral et al. 2010). Equation 3 must only be used to fit data for the long TR regime (TR > 5T1), which in practice is rarely satisfied for all tissues in subjects.\n", "

\n", "\n", "

\n", "Early implementations of inversion recovery fitting algorithms were designed around the computational power available at the time. These included the “null method” (Pykett et al. 1983), assuming that each T1 value has unique zero-crossings (see Figure 2), and linear fitting of a rearranged version of Eq. 3 on a semi-log plot (Fukushima & Roeder 1981). Nowadays, a non-linear least-squares fitting algorithm (e.g. Levenberg-Marquardt) is more appropriate, and can be applied to either approximate or general forms of the signal model (Eq. 3 or Eq. 1). More recent work (Barral et al. 2010) demonstrated that T1 maps can also be fitted much faster (up to 75 times compared to Levenberg-Marquardt) to fit Eq. 1 – without a precision penalty – by using a reduced-dimension non-linear least squares (RD-NLS) algorithm. It was demonstrated that the following simplified 5-parameter equation can be sufficient for accurate T1 mapping:\n", "

\n", "\n", "

\n", "

\n", "

\n", "\n", "

\n", "where a and b are complex values. If magnitude-only data is available, a 3-parameter model can be sufficient by taking the absolute value of Eq. 4. While the RD-NLS algorithms are too complex to be presented here (the reader is referred to the paper, (Barral et al. 2010)), the code for these algorithms was released open-source along with the original publication, and is also available as a qMRLab T1 mapping model. One important thing to note about Eq. 4 is that it is general – no assumption is made about TR – and is thus as robust as Eq. 1 as long as all pulse sequence parameters other than TI are kept constant between each measurement. Figure 4 compares simulated data (Eq. 1) using a range of TRs (1.5T1 to 5T1) fitted using either RD-NLS & Eq. 4 or a Levenberg-Marquardt fit of Eq. 2.\n", "

\n", "
" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "
\n", "

\n", "\n", "Figure 4. Fitting comparison of simulated data (blue markers) with T1 = 1 s and TR = 1.5 to 5 s, using fitted using RD-NLS & Eq. 4 (green) and Levenberg-Marquardt & Eq. 2 (orange, long TR approximation).\n", "\n", "

" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Octave" }, "outputs": [], "source": [ "%% MATLAB/OCTAVE CODE\n", "% Code used to generate the data required for Figure 4 of the blog post\n", "\n", "clear all\n", "\n", "%% Setup parameters\n", "% All times are in milliseconds\n", "% All flip angles are in degrees\n", "\n", "params.TI = 50:50:1500;\n", "TR_range = 1500:50:5000;\n", "\n", "params.EXC_FA = 90;\n", "params.INV_FA = 180;\n", "\n", "params.T1 = 1000;\n", "\n", "%% Calculate signals\n", "%\n", "% The option 'GRE-IR' selects the analytical equations for the gradient echo readout inversion recovery experiment\n", "% The option '1' is a flag that selects full analytical solution equation (no approximation), Eq. 1 of the blog post.\n", "%\n", "% To see all the options available, run `help inversion_recovery.analytical_solution`\n", "\n", "for ii = 1:length(TR_range)\n", " params.TR = TR_range(ii);\n", " Mz_analytical(ii,:) = inversion_recovery.analytical_solution(params, 'GRE-IR', 1);\n", "end\n", "\n", "%% Fit data using Levenberg-Marquardt with the long TR approximation equation\n", "%\n", "% The option '4' is a flag that selects the long TR approximation of the analytical solution (TR>>T1), Eq. 3 of the blog post.\n", "%\n", "% To see all the options available, run `help inversion_recovery.fit_lm`\n", "\n", "\n", "for ii=1:length(TR_range)\n", " fitOutput_lm{ii} = inversion_recovery.fit_lm(Mz_analytical(ii,:), params, 4);\n", " T1_lm(ii) = fitOutput_lm{ii}.T1;\n", "end\n", "\n", "%% Fit data using the RDLS method (Barral), Eq. 4 of the blog post.\n", "%\n", "\n", "% Create a qMRLab inversion recovery model object and load protocol values\n", "irObj = inversion_recovery();\n", "irObj.Prot.IRData.Mat = params.TI';\n", "\n", "for ii=1:length(TR_range)\n", "\n", " data.IRData = Mz_analytical(ii,:);\n", "\n", " fitOutput_barral{ii} = irObj.fit(data);\n", "\n", " T1_barral(ii) = fitOutput_barral{ii}.T1;\n", "\n", "end" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Python3", "tags": [ "scratch" ] }, "outputs": [], "source": [ "%get params --from Octave\n", "%get Mz_analytical --from Octave\n", "%get fitOutput_lm --from Octave\n", "%get fitOutput_barral --from Octave\n", "%get TR_range --from Octave" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Python3", "tags": [ "report_output", "scratch" ] }, "outputs": [], "source": [ "# PYTHON CODE\n", "\n", "init_notebook_mode(connected=True)\n", "\n", "data1 = [dict(\n", " visible = False,\n", " mode = 'markers',\n", " x = params[\"TI\"],\n", " y = abs(np.squeeze(np.asarray(Mz_analytical[ii]))),\n", " name = 'Simulated data',\n", " text = 'Simulated data',\n", " hoverinfo = 'x+y+text') for ii in range(len(TR_range))]\n", "\n", "data1[10]['visible'] = True\n", "\n", "data2 = [dict(\n", " visible = False,\n", " mode = 'lines',\n", " x = params[\"TI\"],\n", " y = abs(fitOutput_lm[ii]['c'] * (1 - 2*np.exp(-params['TI']/fitOutput_lm[ii]['T1']))),\n", " name = '[C(1-2e-TI/T1)] Fitted T1: ' + str(round(fitOutput_lm[ii]['T1'])) + ' ms',\n", " text = '[C(1-2e-TI/T1)]',\n", " hoverinfo = 'x+y+text') for ii in range(len(TR_range))]\n", "\n", "data2[10]['visible'] = True\n", "\n", "data3 = [dict(\n", " visible = False,\n", " mode = 'lines',\n", " x = params[\"TI\"],\n", " y = abs((fitOutput_barral[ii]['ra']+fitOutput_barral[ii]['rb']*np.exp(-params['TI']/fitOutput_barral[ii]['T1']))),\n", " name = '[a+be-TI/T1] Fitted T1: ' + str(round(fitOutput_barral[ii]['T1'])) + ' ms',\n", " text = '[a+be-TI/T1]',\n", " hoverinfo = 'x+y+text') for ii in range(len(TR_range))]\n", "\n", "data3[10]['visible'] = True\n", "\n", "\n", "\n", "data = data1 + data2 + data3\n", "\n", "steps = []\n", "for i in range(len(TR_range)):\n", " step = dict(\n", " method = 'restyle', \n", " args = ['visible', [False] * len(data1)],\n", " label = str(TR_range[i])\n", " )\n", " step['args'][1][i] = True # Toggle i'th trace to \"visible\"\n", " steps.append(step)\n", "\n", "sliders = [dict(\n", " x = 0,\n", " y = -0.02,\n", " active = 10,\n", " currentvalue = {\"prefix\": \"TR value (ms): \"},\n", " pad = {\"t\": 50, \"b\": 10},\n", " steps = steps\n", ")]\n", "\n", "layout = go.Layout(\n", " width=580,\n", " height=450,\n", " margin=go.layout.Margin(\n", " l=80,\n", " r=40,\n", " b=60,\n", " t=10,\n", " ),\n", " annotations=[\n", " dict(\n", " x=0.5004254919715793,\n", " y=-0.18,\n", " showarrow=False,\n", " text='Inversion Time – TI (ms)',\n", " font=dict(\n", " family='Times New Roman',\n", " size=22\n", " ),\n", " xref='paper',\n", " yref='paper'\n", " ),\n", " dict(\n", " x=-0.14,\n", " y=0.5,\n", " showarrow=False,\n", " text='Signal (magnitude)',\n", " font=dict(\n", " family='Times New Roman',\n", " size=22\n", " ),\n", " textangle=-90,\n", " xref='paper',\n", " yref='paper'\n", " ),\n", " ],\n", " xaxis=dict(\n", " autorange=False,\n", " range=[0, params['TI'][-1]],\n", " showgrid=False,\n", " linecolor='black',\n", " linewidth=2\n", " ),\n", " yaxis=dict(\n", " autorange=False,\n", " range=[0, 1],\n", " showgrid=False,\n", " linecolor='black',\n", " linewidth=2\n", " ),\n", " legend=dict(\n", " x=0.2,\n", " y=0.9,\n", " traceorder='normal',\n", " font=dict(\n", " family='Times New Roman',\n", " size=12,\n", " color='#000'\n", " ),\n", " bordercolor='#000000',\n", " borderwidth=2\n", " ), \n", " sliders=sliders\n", ")\n", "\n", "fig = dict(data=data, layout=layout)\n", "\n", "iplot(fig, filename = 'basic-line', config = config)" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "
\n", "

\n", "Figure 5 displays an example brain dataset from an inversion recovery experiment, along with the T1 map fitted using the RD-NLS technique.\n", "

\n", "
" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "
\n", "

\n", "\n", "Figure 5. Figure 5. Example inversion recovery dataset of a healthy adult brain (left). Inversion times used to acquire this magnitude image dataset were 30 ms, 530 ms, 1030 ms, and 1530 ms, and the TR used was 1550 ms. The T1 map (right) was fitted using a RD-NLS algorithm.\n", "\n", "

" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Octave" }, "outputs": [], "source": [ "%% MATLAB/OCTAVE CODE\n", "% Download inversion recovery brain MRI data for Figure 5 of the blog post\n", "\n", "cmd = ['curl -L -o ir_brain.zip https://osf.io/ezv74/download/'];\n", "[STATUS,MESSAGE] = unix(cmd);\n", "unzip('ir_brain.zip');\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Octave" }, "outputs": [], "source": [ "%% MATLAB/OCTAVE CODE\n", "% Code used to generate the data required for Figure 5 of the blog post\n", "\n", "clear all\n", "\n", "% Load data into environment, and rotate mask to be aligned with IR data\n", "load('IRData.mat');\n", "load('IRMask.mat');\n", "\n", "IRData = data;\n", "Mask = imrotate(Mask,180);\n", "clear data\n", "\n", "% Format qMRLab inversion_recovery model parameters, and load them into the Model object\n", "Model = inversion_recovery; \n", "TI = [30; 530; 1030; 1530];\n", "Model.Prot.IRData.Mat = [TI];\n", "\n", "% Format data structure so that they may be fit by the model\n", "data = struct();\n", "data.IRData= double(IRData);\n", "data.Mask= double(Mask);\n", "\n", "FitResults = FitData(data,Model,0); % The '0' flag is so that no wait bar is shown." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Octave" }, "outputs": [], "source": [ "%% MATLAB/OCTAVE CODE\n", "% Code used to re-orient the images to make pretty figures, and to assign variables with the axis lengths.\n", "\n", "T1_map = imrotate(FitResults.T1.*Mask,-90);\n", "xAxis = [0:size(T1_map,2)-1];\n", "yAxis = [0:size(T1_map,1)-1];\n", "\n", "% Raw MRI data at different TI values\n", "TI_0030 = imrotate(squeeze(IRData(:,:,:,1).*Mask),-90);\n", "TI_0530 = imrotate(squeeze(IRData(:,:,:,2).*Mask),-90);\n", "TI_1030 = imrotate(squeeze(IRData(:,:,:,3).*Mask),-90);\n", "TI_1530 = imrotate(squeeze(IRData(:,:,:,4).*Mask),-90);" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Python3", "tags": [ "scratch" ] }, "outputs": [], "source": [ "%get T1_map --from Octave\n", "%get TI_0030 --from Octave\n", "%get TI_0530 --from Octave\n", "%get TI_1030 --from Octave\n", "%get TI_1530 --from Octave\n", "%get xAxis --from Octave\n", "%get yAxis --from Octave" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Python3", "tags": [ "report_output", "scratch" ] }, "outputs": [], "source": [ "from plotly import tools\n", "trace1 = go.Heatmap(x = xAxis,\n", " y = yAxis,\n", " z=TI_0030,\n", " colorscale='Greys',\n", " showscale = False,\n", " visible=False,\n", " name = 'Signal')\n", "trace2 = go.Heatmap(x = xAxis,\n", " y = yAxis,\n", " z=TI_0530,\n", " colorscale='Greys',\n", " showscale = False,\n", " visible=False,\n", " name = 'Signal')\n", "trace3 = go.Heatmap(x = xAxis,\n", " y = yAxis,\n", " z=TI_1030,\n", " colorscale='Greys',\n", " showscale = False,\n", " visible=True,\n", " name = 'Signal')\n", "trace4 = go.Heatmap(x = xAxis,\n", " y = yAxis,\n", " z=TI_1530,\n", " colorscale='Greys',\n", " visible=False,\n", " showscale = False,\n", " name = 'Signal')\n", "trace5 = go.Heatmap(x = xAxis,\n", " y = yAxis,\n", " z=T1_map,\n", " colorscale='Portland',\n", " xaxis='x2',\n", " yaxis='y2',\n", " visible=True,\n", " name = 'T1 values (ms)')\n", "\n", "data=[trace1, trace2, trace3, trace4, trace5]\n", "\n", "\n", "updatemenus = list([\n", " dict(active=2,\n", " x = 0.12,\n", " xanchor = 'left',\n", " y = -0.15,\n", " yanchor = 'bottom',\n", " direction = 'up',\n", " font=dict(\n", " family='Times New Roman',\n", " size=16\n", " ),\n", " buttons=list([ \n", " dict(label = '30 ms',\n", " method = 'update',\n", " args = [{'visible': [True, False, False, False, True]},\n", " ]),\n", " dict(label = '530 ms',\n", " method = 'update',\n", " args = [{'visible': [False, True, False, False, True]},\n", " ]),\n", " dict(label = '1030 ms',\n", " method = 'update',\n", " args = [{'visible': [False, False, True, False, True]},\n", " ]),\n", " dict(label = '1530 ms',\n", " method = 'update',\n", " args = [{'visible': [False,False, False, True, True]},\n", " ])\n", " ]),\n", " )\n", "])\n", "\n", "layout = dict(\n", " width=560,\n", " height=345,\n", " margin = dict(\n", " t=40,\n", " r=50,\n", " b=10,\n", " l=50),\n", " annotations=[\n", " dict(\n", " x=0.06,\n", " y=1.15,\n", " showarrow=False,\n", " text='MR Image',\n", " font=dict(\n", " family='Times New Roman',\n", " size=26\n", " ),\n", " xref='paper',\n", " yref='paper'\n", " ),\n", " dict(\n", " x=0.6,\n", " y=1.15,\n", " showarrow=False,\n", " text='T1 map',\n", " font=dict(\n", " family='Times New Roman',\n", " size=26\n", " ),\n", " xref='paper',\n", " yref='paper'\n", " ),\n", " dict(\n", " x=1.22,\n", " y=1.15,\n", " showarrow=False,\n", " text='T1 (ms)',\n", " font=dict(\n", " family='Times New Roman',\n", " size=26\n", " ),\n", " xref='paper',\n", " yref='paper'\n", " ),\n", " dict(\n", " x=0.02,\n", " y=-0.15,\n", " showarrow=False,\n", " text='TI:',\n", " font=dict(\n", " family='Times New Roman',\n", " size=22\n", " ),\n", " xref='paper',\n", " yref='paper'\n", " ),\n", " ],\n", " xaxis = dict(range = [0,127], autorange = False,\n", " showgrid = False, zeroline = False, showticklabels = False,\n", " ticks = '', domain=[0, 0.6]),\n", " yaxis = dict(range = [0,127], autorange = False,\n", " showgrid = False, zeroline = False, showticklabels = False,\n", " ticks = '', domain=[0, 1]),\n", " xaxis2 = dict(range = [0,127], autorange = False,\n", " showgrid = False, zeroline = False, showticklabels = False,\n", " ticks = '', domain=[0.4, 1]),\n", " yaxis2 = dict(range = [0,127], autorange = False,\n", " showgrid = False, zeroline = False, showticklabels = False,\n", " ticks = '', domain=[0, 1], anchor='x2'),\n", " showlegend = False,\n", " autosize = False,\n", " updatemenus=updatemenus\n", ")\n", "\n", "\n", "fig = dict(data=data, layout=layout)\n", "\n", "iplot(fig, filename = 'basic-heatmap', config = config)" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "

Benefits and Pitfalls

" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "
\n", "

\n", "The conventional inversion recovery experiment is considered the gold standard T1 mapping technique for several reasons. A typical protocol has a long TR value and a sufficient number of inversion times for stable fitting (typically 5 or more) covering the range [0, TR]. It offers a wide dynamic range of signals (up to [-kM0, kM0]), allowing a number of inversion times where high SNR is available to sample the signal recovery curve (Fukushima 1981). T1 maps produced by inversion recovery are largely insensitive to inaccuracies in excitation flip angles and imperfect spoiling (Stikov et al. 2015), as all parameters except TI are constant for each measurement and only a single acquisition is performed (at TI) during each TR. One important pulse sequence design consideration is to avoid acquiring at inversion times where the signal for T1 values of the tissue-of-interest is nulled, as the magnitude images at this TI time will be dominated by Rician noise which can negatively impact the fit under low SNR circumstances (Figure 6). Inversion recovery can also often be acquired using commonly available standard pulse sequences available on most MRI scanners by setting up a customized acquisition protocol, and does not require any additional calibration measurements.\n", "

\n", "
" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "
\n", "

\n", "\n", "Figure 6. Monte Carlo simulations (mean and standard deviation (STD), blue markers) and fitted T1 values (mean and STD, red and green respectively) generated for a T1 value of 900 ms and 5 TI values linearly spaced across the TR (ranging from 1 to 5 s). A bump in T1 STD occurs near TR = 3000 ms, which coincides with the TR where the second TI is located near a null point for this T1 value. \n", "\n", "

" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Octave", "tags": [ "report_output" ] }, "outputs": [], "source": [ "%% MATLAB/OCTAVE CODE\n", "% Code used to generate the data required for Figure 6 of the blog post\n", "\n", "clear all\n", "\n", "%% Setup parameters\n", "% All times are in seconds\n", "% All flip angles are in degrees\n", "\n", "TR_range = 1000:100:5000; % in seconds\n", "\n", "x = struct;\n", "x.T1 = 900; % in seconds\n", "\n", "Opt.SNR = 25;\n", "Opt.M0 = 1;\n", "Opt.FAexcite = 90; % Excitation flip angle\n", "Opt.FAinv = 180; % Inversion flip angle\n", "\n", "%% Monte Carlo data simulation\n", "% Simulate noisy signal data 1,000 time, fit the data, then calculate the means and standard deviations of the data and fitted T1\n", "% Data is calculated by calculating the a and b values of Eq. 4 from the full analytical equations (Eq. 1)\n", "\n", "Model = inversion_recovery; \n", "\n", "for ii = 1:length(TR_range)\n", " Opt.TR = TR_range(ii);\n", " Opt.T1 = x.T1;\n", " TI_lowres(ii,:) = linspace(0.05, Opt.TR, 6)';\n", " Model.Prot.IRData.Mat = [TI_lowres(ii,:)];\n", " [ra,rb] = Model.ComputeRaRb(x,Opt);\n", " x.rb = rb;\n", " x.ra = ra;\n", " for jj = 1:1000\n", " [FitResult{ii,jj}, noisyData{ii,jj}] = Model.Sim_Single_Voxel_Curve(x,Opt,0); \n", " fittedT1(ii,jj) = FitResult{ii,jj}.T1;\n", " noisyData_array(ii,jj,:) = noisyData{ii,jj}.IRData;\n", " end\n", " \n", " for kk=1:length(TI_lowres(ii,:))\n", " data_mean(ii,kk) = mean(noisyData_array(ii,:,kk));\n", " data_std(ii,kk) = std(noisyData_array(ii,:,kk));\n", " end\n", " \n", " T1_mean(ii) = mean(fittedT1(ii,:));\n", " T1_std(ii) = std(fittedT1(ii,:));\n", "end\n", "\n", "%% Calculate the noiseless data at a higher TI resolution to plot the ideal signal curve.\n", "%\n", "\n", "for ii = 1:length(TR_range)\n", " TI_highres(ii,:) = linspace(0.05, TR_range(ii), 500);\n", " Model.Prot.IRData.Mat = [TI_highres(ii,:)];\n", " Opt.TR = TR_range(ii);\n", " Opt.T1 = x.T1;\n", " [ra,rb] = Model.ComputeRaRb(x,Opt);\n", " x.rb = rb;\n", " x.ra = ra;\n", "\n", " data_noiseless(ii,:) = Model.equation(x);\n", "end" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Python3", "tags": [ "scratch" ] }, "outputs": [], "source": [ "%get TR_range --from Octave\n", "%get TI_lowres --from Octave\n", "%get TI_highres --from Octave\n", "%get T1_mean --from Octave\n", "%get T1_std --from Octave\n", "%get data_mean --from Octave\n", "%get data_std --from Octave\n", "%get data_noiseless --from Octave" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Python3", "tags": [ "report_output", "scratch" ] }, "outputs": [], "source": [ "# PYTHON CODE\n", "\n", "init_notebook_mode(connected=True)\n", "\n", "data1 = [dict(\n", " visible = False,\n", " x = np.squeeze(np.asarray(TI_lowres[ii,:])),\n", " y = np.squeeze(np.asarray(data_mean[ii,:])),\n", " error_y=dict(\n", " type='data',\n", " color = ('rgb(22, 96, 167)'),\n", " array=np.squeeze(np.asarray(data_std[ii,:])),\n", " visible=True\n", " ),\n", " line = dict(\n", " color = ('rgb(22, 96, 167)'),\n", " dash = 'dot'),\n", " mode = 'markers',\n", " name = 'Monte Carlo simulated signal',\n", " text = 'Monte Carlo simulated signal',\n", " hoverinfo = 'x+y+text') for ii in range(len(TR_range))]\n", "\n", "data1[28]['visible'] = True\n", "\n", "data2 = [dict(\n", " visible = False,\n", " x = np.squeeze(np.asarray(TI_highres[ii,:])),\n", " y = np.squeeze(np.asarray(data_noiseless[ii,:])),\n", " line = dict(\n", " color = ('rgb(247, 152, 19)'),\n", " ),\n", " name = 'Noiseless signal',\n", " text = 'Noiseless signal',\n", " hoverinfo = 'x+y+text') for ii in range(len(TR_range))]\n", "\n", "data2[28]['visible'] = True\n", "\n", "data_meanT1 = [dict(\n", " visible = False,\n", " x = TR_range,\n", " y = T1_mean,\n", " name = 'Mean T1 (s)',\n", " text = 'Mean T1 (s)',\n", " hoverinfo = 'x+y+text',\n", " xaxis='x2',\n", " yaxis='y2') for ii in range(len(TR_range))]\n", "\n", "data_meanT1[15]['visible'] = True\n", "\n", "data_stdT1 = [dict(\n", " visible = False,\n", " x = TR_range,\n", " y = T1_std,\n", " name = 'STD T1 (s)',\n", " text = 'STD T1 (s)',\n", " hoverinfo = 'x+y+text',\n", " xaxis='x2',\n", " yaxis='y3') for ii in range(len(TR_range))]\n", "\n", "data_stdT1[28]['visible'] = True\n", "\n", "data = data2 + data1 + data_meanT1 + data_stdT1\n", "\n", "steps = []\n", "for i in range(len(TR_range)):\n", " step = dict(\n", " method = 'restyle', \n", " args = ['visible', [False] * len(data1)],\n", " label = str(TR_range[i])\n", " )\n", " step['args'][1][i] = True # Toggle i'th trace to \"visible\"\n", " steps.append(step)\n", "\n", "sliders = [dict(\n", " x = 0,\n", " y = -0.02,\n", " active = 28,\n", " currentvalue = {\"prefix\": \"TR value (ms): \"},\n", " pad = {\"t\": 50, \"b\": 10},\n", " steps = steps\n", ")]\n", "\n", "layout = go.Layout(\n", " width=540,\n", " height=540,\n", " margin = dict(\n", " t=0,\n", " r=25,\n", " b=100,\n", " l=75),\n", " annotations=[\n", " dict(\n", " x=0.5004254919715793,\n", " y=-0.17,\n", " showarrow=False,\n", " text='Inversion Time – TI (ms)',\n", " font=dict(\n", " family='Times New Roman',\n", " size=26\n", " ),\n", " xref='paper',\n", " yref='paper'\n", " ),\n", " dict(\n", " x=-0.15,\n", " y=0.5,\n", " showarrow=False,\n", " text='Signal (magnitude)',\n", " font=dict(\n", " family='Times New Roman',\n", " size=26\n", " ),\n", " textangle=-90,\n", " xref='paper',\n", " yref='paper'\n", " ),\n", " dict(\n", " x=0.76,\n", " y=0.77,\n", " showarrow=False,\n", " text='TR (ms)',\n", " font=dict(\n", " family='Times New Roman',\n", " size=14\n", " ),\n", " xref='paper',\n", " yref='paper'\n", " ),\n", " dict(\n", " x=0.40,\n", " y=0.35,\n", " showarrow=False,\n", " text='Mean T1 (ms)',\n", " font=dict(\n", " family='Times New Roman',\n", " size=14\n", " ),\n", " textangle=-90,\n", " xref='paper',\n", " yref='paper'\n", " ),\n", " dict(\n", " x=1.00,\n", " y=0.35,\n", " showarrow=False,\n", " text='STD T1 (ms)',\n", " font=dict(\n", " family='Times New Roman',\n", " size=14\n", " ),\n", " textangle=-90,\n", " xref='paper',\n", " yref='paper'\n", " )\n", " ],\n", " xaxis=dict(\n", " autorange=False,\n", " range=[0, 5000],\n", " showgrid=False,\n", " linecolor='black',\n", " linewidth=2\n", " ),\n", " yaxis=dict(\n", " autorange=False,\n", " range=[0, 1],\n", " showgrid=False,\n", " linecolor='black',\n", " linewidth=2\n", " ),\n", " xaxis2=dict(\n", " domain=[0.5, 0.90],\n", " anchor='y2',\n", " mirror = True,\n", " side='top',\n", " ticks='inside',\n", " showline=True,\n", " ),\n", " yaxis2=dict(\n", " autorange=False,\n", " range=[500, 1300],\n", " domain=[0.05, 0.65],\n", " anchor='x2',\n", " mirror = True,\n", " ticks='inside',\n", " showline=True,\n", " ),\n", " yaxis3=dict(\n", " autorange=False,\n", " range=[0, 190],\n", " domain=[0.05, 0.65],\n", " anchor='x2',\n", " overlaying='y2',\n", " side='right',\n", " ticks='inside',\n", " ),\n", " legend=dict(\n", " x=0.3,\n", " y=1.35,\n", " traceorder='normal',\n", " font=dict(\n", " family='Times New Roman',\n", " size=12,\n", " color='#000'\n", " ),\n", " bordercolor='#000000',\n", " borderwidth=2\n", " ), \n", " sliders=sliders\n", ")\n", "\n", "fig = dict(data=data, layout=layout)\n", "\n", "iplot(fig, filename = 'basic-line', config = config)" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "
\n", "

\n", "Despite a widely acknowledged robustness for measuring accurate T1 maps, inversion recovery is not often used in studies. An important drawback of this technique is the need for long TR values, generally on the order of a few T1 for general models (e.g. Eqs. 1 and 4), and up to 5T1 for long TR approximated models (Eq. 3). It takes about to 10-25 minutes to acquire a single-slice T1 map using the inversion recovery technique, as only one TI is acquired per TR (2-5 s) and conventional cartesian gradient readout imaging acquires one phase encode line per excitation (for a total of ~100-200 phase encode lines). The long acquisition time makes it challenging to acquire whole-organ T1 maps in clinically feasible protocol times. Nonetheless, it is useful as a reference measurement for comparisons against other T1 mapping methods, or to acquire a single-slice T1 map of a tissue to get T1 estimates for optimization of other pulse sequences.\n", "

\n", "
" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "

Other Saturation-Recovery T1 Mapping techniques

" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "
\n", "

\n", "Several variations of the inversion recovery pulse sequence were developed to overcome challenges like those specified above. Amongst them, the Look-Locker technique (Look and Locker 1970) stands out as one of the most widely used in practice. Instead of a single 90° acquisition per TR, a periodic train of small excitation pulses θ are applied after the inversion pulse, {θ180 – 𝛕 – θ – 𝛕 – θ – ...}, where 𝛕 = TR/n and n is the number of sampling acquisitions. This pulse sequence samples the inversion time relaxation curve much more efficiently than conventional inversion recovery, but at a cost of lower SNR. However, because the magnetization state of each TI measurement depends on the previous series of θ excitation, it has higher sensitivity to B1-inhomogeneities and imperfect spoiling compared to inversion recovery (Gai et al. 2013; Stikov et al. 2015) . Nonetheless, Look-Locker is widely used for rapid T1 mapping applications, and variants like MOLLI (Modified Look-Locker Inversion recovery) and ShMOLLI (Shortened MOLLI) are widely used for cardiac T1 mapping (Messroghli et al. 2004; Piechnik et al. 2010)\n", "

\n", "\n", "

\n", "Another inversion recovery variant that’s worth mentioning is saturation recovery, in which the inversion pulse is replaced with a saturation pulse: {θ90 – TI – θ90}. This technique was used to acquire the very first T1 map (Pykett and Mansfield 1978). Unlike inversion recovery, this pulse sequence does not need a long TR to recover to its initial condition; every θ90 pulse resets the longitudinal magnetization to the same initial state. However, to properly sample the recovery curve, TIs still need to reach the order of ~T1, the dynamic range of signal potential is cut in half ([0, M0]), and the short TIs (which have the fastest acquisition times) have the lowest SNRs.\n", "

\n", "
" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "

Works Cited

" ] }, { "cell_type": "markdown", "metadata": { "kernel": "Python3" }, "source": [ "
\n", "

\n", "Barral JK, Gudmundson E, Stikov N, et al. (2010) A robust methodology for in vivo T1 mapping. Magn. Reson. Med. 64(4): 1057–1067.\n", "

\n", "\n", "

\n", "Drain LE (1949) A Direct Method of Measuring Nuclear Spin-Lattice Relaxation Times. Proceedings of the Physical Society. Section A 62(5): 301–306.\n", "

\n", "\n", "

\n", "Fukushima, E. & Roeder, S., 1981. Experimental Pulse NMR. A Nuts and Bolts Approach, Reading, Massachusetts : Addison-Wesley Publ. Comp., Inc.\n", "

\n", "\n", "

\n", "Gai, N.D. et al., 2013. Modified Look-Locker T1 evaluation using Bloch simulations: human and phantom validation. Magn. Reson. Med., 69(2), pp.329–336.\n", "

\n", "\n", "

\n", "Hahn, E.L., 1949. An Accurate Nuclear Magnetic Resonance Method for Measuring Spin-Lattice Relaxation Times. Physics Review, 76(1), pp.145–146.\n", "

\n", "\n", "

\n", "Look, D.C. & Locker, D.R., 1970. Time Saving in Measurement of NMR and EPR Relaxation Times. The Review of scientific instruments, 41(2), pp.250–251.\n", "

\n", "\n", "

\n", "Messroghli, D.R. et al., 2004. Modified Look-Locker inversion recovery (MOLLI) for high-resolution T1 mapping of the heart. Magn. Reson. Med., 52(1), pp.141–146.\n", "

\n", "\n", "

\n", "Piechnik, S.K. et al., 2010. Shortened Modified Look-Locker Inversion recovery (ShMOLLI) for clinical myocardial T1-mapping at 1.5 and 3 T within a 9 heartbeat breathhold. J. Cardiovasc. Magn. Reson., 12, p.69.\n", "

\n", "\n", "

\n", "Pykett, I.L. et al., 1983. Measurement of spin-lattice relaxation times in nuclear magnetic resonance imaging. Physics in medicine and biology, 28(6), pp.723–729.\n", "

\n", "\n", "

\n", "Pykett, I.L. & Mansfield, P., 1978. A line scan image study of a tumorous rat leg by NMR. Physics in medicine and biology, 23(5), pp.961–967.\n", "

\n", "\n", "

\n", "Steen, R.G. et al., 1994. Precise and accurate measurement of proton T1 in human brain in vivo: validation and preliminary clinical application. J. Magn. Reson. Imaging, 4(5), pp.681–691.\n", "

\n", "\n", "

\n", "Stikov, N. et al., 2015. On the accuracy of T1 mapping: Searching for common ground. Magn. Reson. Med., 73(2), pp.514–522.\n", "

\n", "
" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "kernel": "Python3" }, "outputs": [], "source": [ "# PYTHON CODE\n", "\n", "display(HTML(\n", " ''\n", "))" ] } ], "metadata": { "celltoolbar": "Tags", "kernelspec": { "display_name": "SoS", "language": "sos", "name": "sos" }, "language_info": { "codemirror_mode": "sos", "file_extension": ".sos", "mimetype": "text/x-sos", "name": "sos", "nbconvert_exporter": "sos_notebook.converter.SoS_Exporter", "pygments_lexer": "sos" }, "sos": { "kernels": [ [ "Octave", "octave", "Octave", "#dff8fb" ], [ "Python3", "python3", "Python3", "#FFD91A" ] ], "panel": { "displayed": true, "height": 0, "style": "side" }, "version": "0.16.12" } }, "nbformat": 4, "nbformat_minor": 2 }