Skip to content

Commit

Permalink
Update gre_walkthrough for v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
btasdelen committed May 17, 2023
1 parent 761d15a commit 3559528
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions doc/walkthrough/gre_walkthrough.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -15,7 +16,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -28,11 +29,12 @@
"from pypulseq.make_adc import make_adc\n",
"from pypulseq.make_delay import make_delay\n",
"from pypulseq.make_sinc_pulse import make_sinc_pulse\n",
"from pypulseq.make_trap_pulse import make_trapezoid\n",
"from pypulseq.make_trapezoid import make_trapezoid\n",
"from pypulseq.opts import Opts"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -41,7 +43,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -61,6 +63,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -69,12 +72,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "TypeError",
"evalue": "cannot unpack non-iterable types.SimpleNamespace object",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m/Users/bilal/workspace/pypulseq_bilal/doc/walkthrough/gre_walkthrough.ipynb Cell 6\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/bilal/workspace/pypulseq_bilal/doc/walkthrough/gre_walkthrough.ipynb#W5sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m rf, gz, gzr \u001b[39m=\u001b[39m make_sinc_pulse(flip_angle\u001b[39m=\u001b[39malpha \u001b[39m*\u001b[39m math\u001b[39m.\u001b[39mpi \u001b[39m/\u001b[39m \u001b[39m180\u001b[39m, duration\u001b[39m=\u001b[39m\u001b[39m4e-3\u001b[39m, slice_thickness\u001b[39m=\u001b[39mslice_thickness,\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/bilal/workspace/pypulseq_bilal/doc/walkthrough/gre_walkthrough.ipynb#W5sZmlsZQ%3D%3D?line=1'>2</a>\u001b[0m apodization\u001b[39m=\u001b[39m\u001b[39m0.5\u001b[39m, time_bw_product\u001b[39m=\u001b[39m\u001b[39m4\u001b[39m, system\u001b[39m=\u001b[39msys)\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/bilal/workspace/pypulseq_bilal/doc/walkthrough/gre_walkthrough.ipynb#W5sZmlsZQ%3D%3D?line=3'>4</a>\u001b[0m delta_k \u001b[39m=\u001b[39m \u001b[39m1\u001b[39m \u001b[39m/\u001b[39m fov\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/bilal/workspace/pypulseq_bilal/doc/walkthrough/gre_walkthrough.ipynb#W5sZmlsZQ%3D%3D?line=4'>5</a>\u001b[0m gx \u001b[39m=\u001b[39m make_trapezoid(channel\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mx\u001b[39m\u001b[39m'\u001b[39m, flat_area\u001b[39m=\u001b[39mNx \u001b[39m*\u001b[39m delta_k, flat_time\u001b[39m=\u001b[39m\u001b[39m6.4e-3\u001b[39m, system\u001b[39m=\u001b[39msys)\n",
"\u001b[0;31mTypeError\u001b[0m: cannot unpack non-iterable types.SimpleNamespace object"
]
}
],
"source": [
"rf, gz, gzr = make_sinc_pulse(flip_angle=alpha * math.pi / 180, duration=4e-3, slice_thickness=slice_thickness,\n",
" apodization=0.5, time_bw_product=4, system=sys)\n",
" apodization=0.5, time_bw_product=4, system=sys, return_gz=True)\n",
"\n",
"delta_k = 1 / fov\n",
"gx = make_trapezoid(channel='x', flat_area=Nx * delta_k, flat_time=6.4e-3, system=sys)\n",
Expand All @@ -95,6 +110,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -128,6 +144,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -147,6 +164,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -180,7 +198,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
"version": "3.10.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 3559528

Please sign in to comment.