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] fix positions markers on images on sphere masker reports #4285

Merged
merged 5 commits into from Feb 26, 2024

Conversation

Remi-Gau
Copy link
Collaborator

@Remi-Gau Remi-Gau commented Feb 23, 2024

Changes proposed in this pull request:

  • fix positions markers on images on sphere masker reports
  • minor changes in example with report to trigger its build in CI

Copy link
Contributor

👋 @Remi-Gau 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.

@Remi-Gau
Copy link
Collaborator Author

for visual tests

from nilearn import datasets
from nilearn.maskers import NiftiSpheresMasker

dmn_coords = [(0, -52, 18), (-46, -68, 32), (46, -68, 32), (1, 50, -5)]

# plot sphere on MNI152 was unaffected before
report = NiftiSpheresMasker(dmn_coords).fit().generate_report()
report.save_as_html("report1.html")

# plot sphere on fitted image is fixed
masker = NiftiSpheresMasker(
    dmn_coords,
)
dataset = datasets.fetch_development_fmri(n_subjects=10)
func_filename = dataset.func[0]
time_series = masker.fit(func_filename)
report = masker.generate_report()
report.save_as_html('report2.html')

@Remi-Gau
Copy link
Collaborator Author

After fix:

image

image

Copy link

codecov bot commented Feb 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.98%. Comparing base (abb80ff) to head (13deb44).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4285      +/-   ##
==========================================
+ Coverage   91.85%   91.98%   +0.12%     
==========================================
  Files         144      144              
  Lines       16419    16422       +3     
  Branches     3434     3436       +2     
==========================================
+ Hits        15082    15105      +23     
+ Misses        792      772      -20     
  Partials      545      545              
Flag Coverage Δ
macos-latest_3.11_test_plotting ?
ubuntu-latest_3.10_test_plotting 91.85% <ø> (+<0.01%) ⬆️
ubuntu-latest_3.11_test_plotting 91.85% <ø> (?)
ubuntu-latest_3.12_test_plotting 91.85% <ø> (?)
ubuntu-latest_3.8_test_min 68.93% <ø> (?)
ubuntu-latest_3.9_test_plotting 91.82% <ø> (?)
windows-latest_3.10_test_plotting 91.83% <ø> (?)
windows-latest_3.11_test_plotting 91.83% <ø> (?)
windows-latest_3.12_test_plotting 91.83% <ø> (?)

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.

@bthirion
Copy link
Member

The change makes sense to me.

@Remi-Gau
Copy link
Collaborator Author

Will update changelog and merge if CI is still OK.

@Remi-Gau Remi-Gau marked this pull request as ready for review February 26, 2024 08:28
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

adding some semantic line breaks in the problematic examples reported in the issue to trigger its build in CI to check the problem is solved.

@Remi-Gau
Copy link
Collaborator Author

new example looks fixed

image

@Remi-Gau Remi-Gau merged commit 9c5bd24 into nilearn:main Feb 26, 2024
32 checks passed
@Remi-Gau Remi-Gau deleted the fix/4282 branch April 8, 2024 11:11
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.

[BUG] Location of individual spheres does not match the "all spheres plot" in NiftiSpheresMasker reports
2 participants