Skip to content

DOC: Document the PET notebook #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jhlegarreta
Copy link
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
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
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
Copy link

codecov bot commented Aug 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.00%. Comparing base (19af931) to head (b66a580).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #197   +/-   ##
=======================================
  Coverage   74.00%   74.00%           
=======================================
  Files          24       24           
  Lines        1404     1404           
  Branches      166      166           
=======================================
  Hits         1039     1039           
  Misses        299      299           
  Partials       66       66           

☔ 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 from ae3ce06 to 9d62e1c Compare August 15, 2025 22:38
Document the PET notebook: add markdown cells explaining the steps.
@jhlegarreta jhlegarreta force-pushed the doc/document-pet-notebook branch from 9d62e1c to b66a580 Compare August 22, 2025 22:22
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.

1 participant