Skip to content

Commit 6011868

Browse files
committed
FIX: Fix FD plot function call in BOLD fMRI realignment notebook
Fix FD plot function call in BOLD fMRI realignment notebook: provide the framewise displacement data as a `pandas` `DataFrame` and group the labels for the legend into a list. Left behind in commit 2d95cbb. Take advantage of the commit to transfer a lonely `import` statement to the immediately subsequent cell where the actual plot function is called for the sake of compactness and consistency.
1 parent 0fb310a commit 6011868

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

docs/notebooks/bold_realignment.ipynb

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -164,21 +164,15 @@
164164
"afni_realigned"
165165
]
166166
},
167-
{
168-
"cell_type": "code",
169-
"execution_count": 6,
170-
"metadata": {},
171-
"outputs": [],
172-
"source": [
173-
"from matplotlib import pyplot as plt"
174-
]
175-
},
176167
{
177168
"cell_type": "code",
178169
"execution_count": 43,
179170
"metadata": {},
180171
"outputs": [],
181172
"source": [
173+
"import pandas as pd\n",
174+
"from matplotlib import pyplot as plt\n",
175+
"\n",
182176
"from nifreeze.viz.motion_viz import plot_framewise_displacement\n",
183177
"\n",
184178
"\n",
@@ -264,10 +258,9 @@
264258
" )\n",
265259
"\n",
266260
" # Plot the framewise displacement on the first axis\n",
261+
" fd = pd.DataFrame({\"afni\": afni_fd, \"nifreeze\": nifreeze_fd})\n",
267262
" fd_axis = axes[0]\n",
268-
" _ = plot_framewise_displacement(\n",
269-
" afni_fd, nifreeze_fd, \"AFNI 3dVolreg FD\", \"nifreeze FD\", ax=fd_axis\n",
270-
" )\n",
263+
" _ = plot_framewise_displacement(fd, [\"AFNI 3dVolreg FD\", \"nifreeze FD\"], ax=fd_axis)\n",
271264
"\n",
272265
" # Set labels for profile plots if not provided\n",
273266
" if labels is None or isinstance(labels, str):\n",

0 commit comments

Comments
 (0)