Skip to content

DOC: Document the PET notebook#197

Merged
jhlegarreta merged 1 commit into
nipreps:mainfrom
jhlegarreta:doc/document-pet-notebook
Dec 21, 2025
Merged

DOC: Document the PET notebook#197
jhlegarreta merged 1 commit into
nipreps:mainfrom
jhlegarreta:doc/document-pet-notebook

Conversation

@jhlegarreta
Copy link
Copy Markdown
Contributor

Document the PET notebook: add markdown cells explaining the steps.

"can be installed from [GIN G-node](https://gin.g-node.org/nipreps-data/tests-nifreeze):\n",
"\n",
"```\n",
"$ datalad install -g https://gin.g-node.org/nipreps-data/tests-nifreeze.git\n",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not true as the data does not use datalad yet, but it will eventually (related to issue #112).

@jhlegarreta
Copy link
Copy Markdown
Contributor Author

jhlegarreta commented Aug 2, 2025

@mnoergaard I would be grateful if you could review this PR. There is a number of things that I do not fully understand, and may require separate work (i.e. issues and PRs)

  • What is the purpose of the below statement ? The split is done internally by PETMotionEstimator and the data_train, and data_test are not used. Maybe it was a simple example ?
data_train, data_test = pet_dataset.lofo_split(15)
  • In the statement
model = PETModel(dataset=pet_dataset, timepoints=pet_dataset.midframe, xlim=7000)

Why is xlim given a seemingly arbitrary value? Documenting the class may help clarifying this. Further down the notebook pet_dataset.total_duration is used to set the value for xlim.

  • Is the below statement necessary?
model.fit_predict(None)
  • There is something missing in the before/after correction plot because the PET_before is not being shown.

  • Slightly related to the above, wouldn't it be better if we could propose (or leverage nireports if possible) a GIF with a flickering between uncorrected vs corrected? Otherwise the difference between the two can be hard to tell.

  • Are we sure that data_test[0] is the data after motion correction in the following statement?

nifti_img_after = nb.Nifti1Image(data_test[0], pet_dataset.affine)

data_test it is assigned by the lofo_split call but it is never used? Maybe the before_mc and after_mc NIfTI filenames are swapped?

  • It seems weird to first make the correction with a given model instance, and then instantiate the estimator with a new model, isn't it?

@jhlegarreta jhlegarreta requested a review from mnoergaard August 2, 2025 15:07
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.10%. Comparing base (9b36f58) to head (22fb641).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #197   +/-   ##
=======================================
  Coverage   82.10%   82.10%           
=======================================
  Files          37       37           
  Lines        2045     2045           
  Branches      224      224           
=======================================
  Hits         1679     1679           
  Misses        320      320           
  Partials       46       46           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jhlegarreta jhlegarreta force-pushed the doc/document-pet-notebook branch 2 times, most recently from 9d62e1c to b66a580 Compare August 22, 2025 22:22
@jhlegarreta jhlegarreta force-pushed the doc/document-pet-notebook branch 7 times, most recently from 13064e1 to 2154d63 Compare September 27, 2025 00:28
@jhlegarreta jhlegarreta force-pushed the doc/document-pet-notebook branch from 2154d63 to a1e710f Compare September 28, 2025 01:22
@jhlegarreta jhlegarreta force-pushed the doc/document-pet-notebook branch from d7c0f08 to fa1ce90 Compare December 21, 2025 15:40
Document the PET notebook: add markdown cells explaining the steps.
@jhlegarreta jhlegarreta force-pushed the doc/document-pet-notebook branch from fa1ce90 to 22fb641 Compare December 21, 2025 15:41
@jhlegarreta
Copy link
Copy Markdown
Contributor Author

jhlegarreta commented Dec 21, 2025

typecheck issues are unrelated (x-ref #204 (comment)); CI errors are unrelated (x-ref #204 (comment)).

Most questions in #197 (comment) are no longer relevant after having merged PR #204, some will be addressed in PR #203, and visualization questions will be addressed after the more pressing questions about the PET estimator, and overall, the results in the notebook are addressed. Merging to move forward.

@jhlegarreta jhlegarreta merged commit f651c2b into nipreps:main Dec 21, 2025
10 of 14 checks passed
@jhlegarreta jhlegarreta deleted the doc/document-pet-notebook branch December 21, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants