{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Exercise 1: SLR Pulse Design\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Welcome! This first exercise will cover the design of SLR pulses for MRI using Python. \n", "\n", "Documentation for all pulse design tools can be found [here](https://sigpy.readthedocs.io/en/latest/mri_rf.html).\n", "\n", "Prior to beginning this exercise (and at the beginning of all additional exercise notebooks) we will need to import the packages we will use:\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%matplotlib notebook\n", "\n", "# typical sigpy and numpy imports\n", "import numpy as np\n", "import sigpy.mri.rf as rf # import for our RF pulse design tools \n", "import sigpy.plot as pl" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Problem 1a: design an inversion pulse" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Large-tip inversion pulses cannot be effectively designed by the small-tip-angle approximation alone, and should instead be designed by iterative methods or the SLR method, which we will use here.\n", "\n", "In SigPy, basic SLR pulses are designed using the [*sigpy.mri.rf.slr.dzrf*](https://sigpy.readthedocs.io/en/latest/generated/sigpy.mri.rf.slr.dzrf.html#sigpy.mri.rf.slr.dzrf) function, modeled after John Pauly's SLR design tools.\n", "\n", "For this example, we want to design an inversion pulse with a sharp edge to invert magnetization(flip the sign of Mz).\n", "\n", "* Using dzrf(), design an inversion pulse with a duration of 128 samples.\n", "* To start, give your pulse 8 zero crossings. \n", "* Use a filter type that concentrates the pulse energy at the end of the pulse.\n", "* Design the pulse to have at maximum 1% ripple in both the passband and the stopband.\n", "* Plot the pulse using pl.LinePlot()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "N = 128 \n", "tb = 4\n", "d1 = 0.01\n", "d2 = 0.01\n", "ptype = 'inv'\n", "ftype = 'ls'" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "pulse = rf.slr.dzrf(N, tb, ptype, ftype, d1, d2)\n", "pl.LinePlot(pulse, mode='r', title = 'Real Component')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Problem 1b: simulate the inversion pulse's profile" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "* Simulate and plot the Mz profile created by this pulse.\n", "\n", "This is done in 2 steps: \n", "* First, find get the a and b Cayley-Klein coefficients that correspond to the RF pulse using [*rf.sim.abrm()*](https://sigpy.readthedocs.io/en/latest/generated/sigpy.mri.rf.sim.abrm.html#sigpy.mri.rf.sim.abrm). You'll want to use spatial locations ranging from -2TB to 2TB. \n", "* Second, you need to make a conversion from the Cayley-Klein parameters to the magnetization response. For an inversion pulse (assuming M0 is initially oriented entirely along MZ), the relationship for MZ's final state is:\n", "\n", "