Skip to content

Commit ec23995

Browse files
authored
Merge pull request #213 from jhlegarreta/fix/fix-pet-notebook-mc-indices
FIX: Use motion corrected frame index consistently in PET notebook
2 parents cb13535 + 64db03b commit ec23995

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/notebooks/pet_motion_estimation.ipynb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,8 @@
428428
"metadata": {},
429429
"outputs": [],
430430
"source": [
431-
"predicted = model.fit_predict(pet_dataset.midframe[2])"
431+
"index = 2\n",
432+
"predicted = model.fit_predict(pet_dataset.midframe[index])"
432433
]
433434
},
434435
{
@@ -441,12 +442,12 @@
441442
"import nibabel as nb\n",
442443
"\n",
443444
"# before\n",
444-
"nifti_img_before = nb.Nifti1Image(predicted, pet_dataset.affine)\n",
445+
"nifti_img_before = nb.Nifti1Image(pet_dataset[index][0], pet_dataset.affine)\n",
445446
"output_path_before = \"before_mc.nii\"\n",
446447
"nifti_img_before.to_filename(output_path_before)\n",
447448
"\n",
448449
"# after\n",
449-
"nifti_img_after = nb.Nifti1Image(data_test[0], pet_dataset.affine)\n",
450+
"nifti_img_after = nb.Nifti1Image(predicted, pet_dataset.affine)\n",
450451
"output_path_after = \"after_mc.nii\"\n",
451452
"nifti_img_after.to_filename(output_path_after)"
452453
]
@@ -2236,7 +2237,7 @@
22362237
" fixed_image,\n",
22372238
" moving_image,\n",
22382239
" fixed_label=\"PET_before\",\n",
2239-
" moving_label=\"PET\",\n",
2240+
" moving_label=\"PET_after\",\n",
22402241
")"
22412242
]
22422243
},

0 commit comments

Comments
 (0)