Skip to content
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

FIX/EHN update load_confound_strategy defaults #4225

Merged
merged 8 commits into from Jan 19, 2024

Conversation

htwangtw
Copy link
Member

@htwangtw htwangtw commented Jan 16, 2024

Closes #4222
Closes #4223

  • deprecation for scrubbing thresholds to match fmriprep docmentation (fd_threshold=0.5; std_dvars_threshold=1.5)

  • for load_confounds_strategy allow global signal in compcor strategy to reflect on fmriprep documentation. This change does not break any existing behaviour as the default remains to be False

Need help:

  • deprecated version?
  • docstring formatting
  • Release note badges????

Closes nilearn#4222
Closes nilearn#4223

- deprecation for scrubbing thresholds to match fmriprep docmentation
  FD will be changed to 0.5 and std DVARS 1.5

- allow global signal in compcor strategy to reflect on fmriprep
  docmentation. This change does not break any existing behaviour as the
  defalt remains to be False

Need help: depricated version?
Copy link
Contributor

github-actions bot commented Jan 16, 2024

👋 @htwangtw Thanks for creating a PR!

Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft.

Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.

  • PR has an interpretable title.
  • PR links to Github issue with mention Closes #XXXX (see our documentation on PR structure)
  • Code is PEP8-compliant (see our documentation on coding style)
  • Changelog or what's new entry in doc/changes/latest.rst (see our documentation on PR structure)

For new features:

  • There is at least one unit test per new function / class (see our documentation on testing)
  • The new feature is demoed in at least one relevant example.

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

We will review it as quick as possible, feel free to ping us with questions if needed.

Copy link

codecov bot commented Jan 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (281656e) 92.07% compared to head (2e0fdbd) 92.05%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4225      +/-   ##
==========================================
- Coverage   92.07%   92.05%   -0.03%     
==========================================
  Files         144      144              
  Lines       16374    16417      +43     
  Branches     3428     3433       +5     
==========================================
+ Hits        15077    15112      +35     
- Misses        756      762       +6     
- Partials      541      543       +2     
Flag Coverage Δ
macos-latest_3.10_test_plotting 91.84% <100.00%> (-0.03%) ⬇️
macos-latest_3.11_test_plotting 91.84% <100.00%> (-0.03%) ⬇️
macos-latest_3.12_test_plotting 91.84% <100.00%> (-0.03%) ⬇️
macos-latest_3.8_test_plotting 91.80% <100.00%> (-0.03%) ⬇️
macos-latest_3.9_test_plotting 91.81% <100.00%> (-0.03%) ⬇️
ubuntu-latest_3.10_test_plotting 91.84% <100.00%> (-0.03%) ⬇️
ubuntu-latest_3.11_test_plotting 91.84% <100.00%> (-0.03%) ⬇️
ubuntu-latest_3.12_test_plotting 91.84% <100.00%> (-0.03%) ⬇️
ubuntu-latest_3.12_test_pre 91.84% <100.00%> (?)
ubuntu-latest_3.8_test_min 68.92% <100.00%> (-0.04%) ⬇️
ubuntu-latest_3.8_test_plot_min 91.55% <100.00%> (-0.03%) ⬇️
ubuntu-latest_3.8_test_plotting 91.80% <100.00%> (-0.03%) ⬇️
ubuntu-latest_3.9_test_plotting 91.81% <100.00%> (-0.03%) ⬇️
windows-latest_3.10_test_plotting 91.82% <100.00%> (-0.03%) ⬇️
windows-latest_3.11_test_plotting 91.82% <100.00%> (-0.03%) ⬇️
windows-latest_3.12_test_plotting ?
windows-latest_3.8_test_plotting 91.78% <100.00%> (-0.03%) ⬇️
windows-latest_3.9_test_plotting 91.78% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

doc/changes/latest.rst Outdated Show resolved Hide resolved
warnings.warn(
category=DeprecationWarning,
message=fd_threshold_default,
stacklevel=3,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wonder if the stack level should not be 2 here so that the warning appears with where load_confounds was called.

Note: the warning stacklevel in the code base are overall wildly inconsistent, probably something we want to clean up a bit to give user better feedback.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to call the function and feel level 2 makes most sense to me. I don't know the logic behind stack level and didn't look too much into it. Happy to have it changed to whatever it seems fit

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would say don't sweat it too much for now until we got some rule of thumb we agree on regarding how to handle this.

@@ -37,6 +37,7 @@
"motion": "full",
"n_compcor": "all",
"compcor": "anat_combined",
"global_signal": None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to add this in an example?

Copy link
Member Author

Choose a reason for hiding this comment

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

In fact we cannot create an example with the example dataset in the same tutorial because there's no json file for the confounds. We will have to update the example dataset to do so

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this the 3rd instance where we cannot show things in example because we rely on too old datasets. Probably worth opening an issue to identify what BIDS dataset we have could potentially be updated.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good to me. I did downsampled two fMRIPrep preprocessed dataset for my other projects as test data (ds000228, ds000030).

@bthirion
Copy link
Member

Documentation building is still broken...

doc/changes/latest.rst Outdated Show resolved Hide resolved
@htwangtw
Copy link
Member Author

Thanks @Remi-Gau for fixing the docs....

Copy link
Member

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

I can't spot any issue. Thx for that !

Copy link
Collaborator

@Remi-Gau Remi-Gau left a comment

Choose a reason for hiding this comment

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

LGTM

@Remi-Gau Remi-Gau merged commit 1beb52b into nilearn:main Jan 19, 2024
32 checks passed
@htwangtw htwangtw deleted the load_confound-updates branch January 19, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants