Skip to content

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 78.65%. Comparing base (6a98aa0) to head (d7c0f08).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #197   +/-   ##
=======================================
  Coverage   78.65%   78.65%           
=======================================
  Files          24       24           
  Lines        1443     1443           
  Branches      166      166           
=======================================
  Hits         1135     1135           
  Misses        237      237           
  Partials       71       71           

☔ 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
Document the PET notebook: add markdown cells explaining the steps.
@jhlegarreta jhlegarreta force-pushed the doc/document-pet-notebook branch from 2154d63 to a1e710f Compare September 28, 2025 01: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.

3 participants