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

[EHN] Implement signal.clean to SurfaceMasker #4117

Merged
merged 1 commit into from Nov 24, 2023

Conversation

htwangtw
Copy link
Member

@htwangtw htwangtw commented Nov 24, 2023

  • Closes #

Changes proposed in this pull request:

This is an initial attempt to implement signal.clean to SurfaceMasker.
Concerns (generalisable to niftimaskers):

  • clean_kwargs - should filter out confounds and sample mask to prevent
    user adding those parameters upon creating the masker
  • all the cleaning related parameters - what do we want to choose to
    expose?

If we set on the solution I will expand this to SurfaceLabelsMasker

This is an inital attempt to implement signal.clean to SurfMasker
Concerns:
  clean_kwarg  - should filter out confounds and sample mask to prevent
user adding those parameters upon creating the masker
  all the cleaning related parameters - what do we want to choose to
expose?
Copy link
Contributor

👋 @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 Nov 24, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (b607726) 91.80% compared to head (f43c09a) 91.81%.

Files Patch % Lines
nilearn/experimental/surface/_maskers.py 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4117      +/-   ##
==========================================
+ Coverage   91.80%   91.81%   +0.01%     
==========================================
  Files         144      144              
  Lines       16152    16172      +20     
  Branches     3359     3360       +1     
==========================================
+ Hits        14829    14849      +20     
  Misses        781      781              
  Partials      542      542              
Flag Coverage Δ
macos-latest_3.10_test_plotting 91.64% <96.00%> (+0.01%) ⬆️
macos-latest_3.11_test_plotting 91.64% <96.00%> (+0.01%) ⬆️
macos-latest_3.12_test_plotting 91.64% <96.00%> (+0.01%) ⬆️
macos-latest_3.8_test_plotting 91.60% <96.00%> (+0.01%) ⬆️
macos-latest_3.9_test_plotting 91.61% <96.00%> (+0.01%) ⬆️
ubuntu-latest_3.10_test_plotting 91.64% <96.00%> (+0.01%) ⬆️
ubuntu-latest_3.11_test_plotting 91.64% <96.00%> (+0.01%) ⬆️
ubuntu-latest_3.12_test_plotting 91.64% <96.00%> (+0.01%) ⬆️
ubuntu-latest_3.12_test_pre 91.64% <96.00%> (+0.01%) ⬆️
ubuntu-latest_3.8_test_min 69.16% <96.00%> (+0.03%) ⬆️
ubuntu-latest_3.8_test_plot_min 91.36% <96.00%> (+0.01%) ⬆️
ubuntu-latest_3.8_test_plotting 91.60% <96.00%> (+0.01%) ⬆️
ubuntu-latest_3.9_test_plotting 91.61% <96.00%> (+0.01%) ⬆️
windows-latest_3.10_test_plotting 91.62% <96.00%> (+0.01%) ⬆️
windows-latest_3.11_test_plotting 91.62% <96.00%> (+0.01%) ⬆️
windows-latest_3.12_test_plotting 91.62% <96.00%> (+0.01%) ⬆️
windows-latest_3.8_test_plotting 91.58% <96.00%> (+0.01%) ⬆️
windows-latest_3.9_test_plotting 91.58% <96.00%> (+0.01%) ⬆️

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.

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.

Looks good so far.

@bthirion
Copy link
Member

You probably want to add tests ?

@htwangtw
Copy link
Member Author

htwangtw commented Nov 24, 2023

You probably want to add tests ?

When I look at the NiftiMasker objects, it seems that they deliberately did not test out all the signal cleaning part and just assumed all the parameters are passed to signal.clean correctly.
I am not sure what's the best thing to do.

@htwangtw htwangtw marked this pull request as ready for review November 24, 2023 16:02
Copy link
Member

@ymzayek ymzayek left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

Thx !

@htwangtw
Copy link
Member Author

merging...

@htwangtw htwangtw merged commit d6d822d into nilearn:main Nov 24, 2023
32 checks passed
@htwangtw htwangtw deleted the surface/signal-cleaning branch November 24, 2023 16:47
@ymzayek
Copy link
Member

ymzayek commented Dec 11, 2023

linking to #4027 to keep track

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.

None yet

3 participants