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

[ENH] Set appropriate cut coordinates for NiftiLabelsMasker reports #4099

Merged
merged 7 commits into from Nov 30, 2023

Conversation

Copy link
Contributor

github-actions bot commented Nov 7, 2023

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

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (115631c) 91.84% compared to head (3f78f39) 91.80%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4099      +/-   ##
==========================================
- Coverage   91.84%   91.80%   -0.05%     
==========================================
  Files         144      144              
  Lines       16223    16224       +1     
  Branches     3377     3377              
==========================================
- Hits        14900    14894       -6     
- Misses        781      790       +9     
+ Partials      542      540       -2     
Flag Coverage Δ
macos-latest_3.10_test_plotting 91.67% <100.00%> (+<0.01%) ⬆️
macos-latest_3.11_test_plotting 91.67% <100.00%> (+<0.01%) ⬆️
macos-latest_3.12_test_plotting 91.67% <100.00%> (+<0.01%) ⬆️
macos-latest_3.8_test_plotting 91.63% <100.00%> (+<0.01%) ⬆️
macos-latest_3.9_test_plotting ?
ubuntu-latest_3.10_test_plotting 91.67% <100.00%> (+<0.01%) ⬆️
ubuntu-latest_3.11_test_plotting 91.67% <100.00%> (+<0.01%) ⬆️
ubuntu-latest_3.12_test_plotting 91.67% <100.00%> (+<0.01%) ⬆️
ubuntu-latest_3.12_test_pre 91.67% <100.00%> (+<0.01%) ⬆️
ubuntu-latest_3.8_test_min ?
ubuntu-latest_3.8_test_plot_min 91.39% <100.00%> (+<0.01%) ⬆️
ubuntu-latest_3.8_test_plotting 91.63% <100.00%> (+<0.01%) ⬆️
ubuntu-latest_3.9_test_plotting 91.63% <100.00%> (+<0.01%) ⬆️
windows-latest_3.10_test_plotting 91.64% <100.00%> (+<0.01%) ⬆️
windows-latest_3.11_test_plotting 91.64% <100.00%> (+<0.01%) ⬆️
windows-latest_3.12_test_plotting 91.64% <100.00%> (+<0.01%) ⬆️
windows-latest_3.8_test_plotting 91.60% <100.00%> (+<0.01%) ⬆️
windows-latest_3.9_test_plotting 91.61% <100.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.

@ymzayek
Copy link
Member Author

ymzayek commented Nov 9, 2023

A quick example showing the same cut coords with an without passing func image:

# %%
from nilearn.maskers import NiftiLabelsMasker
from nilearn import datasets
from nilearn.image import load_img
from nilearn._utils import data_gen
import numpy as np

data = datasets.fetch_development_fmri(n_subjects=1)
data = load_img(data["func"][0])
atlas = data_gen.generate_labeled_regions(
    (13, 11, 12), affine=np.eye(4), n_regions=5
)
masker = NiftiLabelsMasker(atlas)
masker.fit()
report = masker.generate_report()
report

#%%
masker.fit(data)
report = masker.generate_report()
report

image
image

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.

LGTM, thx.

@ymzayek ymzayek force-pushed the supercede-coords-labelsmasker branch from d3efa2e to aa311b1 Compare November 10, 2023 08:39
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.

LGTM.

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.

good with me

@ymzayek
Copy link
Member Author

ymzayek commented Nov 30, 2023

Thanks merging

@ymzayek ymzayek merged commit 2c65177 into nilearn:main Nov 30, 2023
32 checks passed
@ymzayek ymzayek deleted the supercede-coords-labelsmasker branch November 30, 2023 08:21
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.

masker.generate_report doesn't center on ROI if overlaid on functional data
4 participants