{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Design and simulate a set of gSlider excitation pulses" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%matplotlib notebook\n", "import numpy as np\n", "import sigpy as sp\n", "import sigpy.mri as mr\n", "import sigpy.plot as pl\n", "import sigpy.mri.rf as rf\n", "import scipy.signal as signal\n", "import matplotlib.pyplot as pyplot" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "N = 512\n", "G = 5\n", "exFlip = 90*np.pi/180\n", "tb = 12\n", "d1 = 0.01\n", "d2 = 0.01\n", "phi = np.pi\n", "dt = 1\n", "\n", "pulses = rf.slr.dz_gslider_rf(N, G, exFlip, phi, tb, d1, d2, cancel_alpha_phs = True)\n", "Mxy = np.zeros((np.size(np.arange(-2*tb, 2*tb, 0.01)), G), dtype = complex)\n", "\n", "for Gind in range(1, G+1):\n", " \n", " [a, b] = rf.sim.abrm(pulses[:, Gind-1], np.arange(-2*tb, 2*tb, 0.01), True)\n", " Mxy[:, Gind-1] = 2*np.multiply(np.conj(a),b)\n", " " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "pl.LinePlot(Mxy.T)\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "pl.LinePlot(pulses.T)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 2 }