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

Standardize "nilearn" atlases #4329

Closed
Remi-Gau opened this issue Mar 20, 2024 · 6 comments
Closed

Standardize "nilearn" atlases #4329

Remi-Gau opened this issue Mar 20, 2024 · 6 comments
Labels
Code quality This issue tackles code quality (code refactoring, PEP8...). Effort: medium The issue is likely to require a decent amount of work (in between a few hours and a couple days). Impact: medium Solving this issue will have a decent impact on the project. Priority: high The task is urgent and needs to be addressed as soon as possible.

Comments

@Remi-Gau
Copy link
Collaborator

  • ensuring that nilearn atlases have a "standardized" data structure
    (for example that each fetcher returns a list of labels as a list of strings)
  • checking the label types passed to the constructor of NiftiLabelMasker
    and throw errors if they do not pass
    instead of warnings like they do here.

Originally posted by @Remi-Gau in #4289 (comment)

@Remi-Gau
Copy link
Collaborator Author

Note that the list of labels should also include "background" (or "Background")

@Remi-Gau Remi-Gau added Priority: high The task is urgent and needs to be addressed as soon as possible. Effort: medium The issue is likely to require a decent amount of work (in between a few hours and a couple days). Code quality This issue tackles code quality (code refactoring, PEP8...). Impact: medium Solving this issue will have a decent impact on the project. labels Mar 20, 2024
@Remi-Gau
Copy link
Collaborator Author

Even though working on this should fix #4330 and #4331, it will change what it returned by some of the fetchers (some even if not an API change, it would be a behavior change that should probably go through a deprecation cycle - not 100% about this).

For example, the Destrieux fetcher would return 'labels' as list of strings and not a numpy.recarray containing the names of the ROIs.

So this feels like a bit of an "invasive" change to include into 0.10.4 that should be a bug fix release. So I suggest making that change after 0.10.4 is out.

@bthirion @man-shu what's your take on this?

@Remi-Gau
Copy link
Collaborator Author

Remi-Gau commented Mar 20, 2024

Note that the list of labels should also include "background" (or "Background")

Was checking on the templateFlow atlases and not all of them explicitly includes "background" in their list of labels so I would not make this required for Nilearn list of labels (for example by throwing an error if a user passed a list of labels to NiftiLabelMasker that did not include "background").

@bthirion
Copy link
Member

Indeed, we need to go through deprecation cycles for that one.

@man-shu
Copy link
Contributor

man-shu commented Mar 21, 2024

IIUC, going through the deprecation cycle would involve warning users about the changes for a few releases before actually inteoducing them?

@Remi-Gau
Copy link
Collaborator Author

Will close this in favor of @4335 (that is more detailed).

Will move people's comments over there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code quality This issue tackles code quality (code refactoring, PEP8...). Effort: medium The issue is likely to require a decent amount of work (in between a few hours and a couple days). Impact: medium Solving this issue will have a decent impact on the project. Priority: high The task is urgent and needs to be addressed as soon as possible.
Projects
None yet
Development

No branches or pull requests

3 participants