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

[DOC] update doc strings of the maskers #4286

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion nilearn/maskers/multi_nifti_labels_masker.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@

@fill_doc
class MultiNiftiLabelsMasker(NiftiLabelsMasker):
"""Class for masking of Niimg-like objects.
"""Class for extracting data from multiple Niimg-like objects \
using labels of non-overlapping brain regions.

MultiNiftiLabelsMasker is useful when data from non-overlapping volumes
and from different subjects should be extracted (contrary to
:class:`nilearn.maskers.NiftiLabelsMasker`).

For more details on the definitions of labels in Nilearn,
see the :ref:`region` section.
Comment on lines +21 to +22
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would be tempted (in another PR) to add label (brain region) and maps (brain region) (as defined in the user guide) as part of the nilearn glossary to make it easier to link to them.

Though obviously this would have to be disinguished from "statistcal maps", "class labels"...


Parameters
----------
labels_img : Niimg-like object
Expand Down
10 changes: 9 additions & 1 deletion nilearn/maskers/multi_nifti_maps_masker.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,24 @@

@fill_doc
class MultiNiftiMapsMasker(NiftiMapsMasker):
"""Class for masking of Niimg-like objects.
"""Class for extracting data from multiple Niimg-like objects \
using maps of potentially overlapping brain regions.

MultiNiftiMapsMasker is useful when data from overlapping volumes
and from different subjects should be extracted (contrary to
:class:`nilearn.maskers.NiftiMapsMasker`).

Use case:
summarize brain signals from several subjects
from large-scale networks obtained by prior PCA or :term:`ICA`.

.. note::
Inf or NaN present in the given input images are automatically
put to zero rather than considered as missing data.

For more details on the definitions of maps in Nilearn,
see the :ref:`region` section.

Parameters
----------
maps_img : 4D niimg-like object
Expand Down
9 changes: 6 additions & 3 deletions nilearn/maskers/multi_nifti_masker.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ def _get_mask_strategy(strategy):

@_utils.fill_doc
class MultiNiftiMasker(NiftiMasker, _utils.CacheMixin):
"""Class for masking of Niimg-like objects.
"""Applying a mask to extract time-series from multiple Niimg-like objects.

MultiNiftiMasker is useful when dealing with image sets from multiple
subjects. Use case: integrates well with decomposition by MultiPCA and
CanICA (multi-subject models)
subjects.

Use case:
integrates well with decomposition by MultiPCA and CanICA
(multi-subject models)

Parameters
----------
Expand Down
10 changes: 8 additions & 2 deletions nilearn/maskers/nifti_labels_masker.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,19 @@ def __call__(self, imgs):

@_utils.fill_doc
class NiftiLabelsMasker(BaseMasker, _utils.CacheMixin):
"""Class for masking of Niimg-like objects.
"""Class for extracting data from Niimg-like objects \
using labels of non-overlapping brain regions.

NiftiLabelsMasker is useful when data from non-overlapping volumes should
be extracted (contrarily to :class:`nilearn.maskers.NiftiMapsMasker`).
Use case: Summarize brain signals from clusters that were obtained by prior

Use case:
summarize brain signals from clusters that were obtained by prior
K-means or Ward clustering.

For more details on the definitions of labels in Nilearn,
see the :ref:`region` section.

Parameters
----------
labels_img : Niimg-like object
Expand Down
17 changes: 12 additions & 5 deletions nilearn/maskers/nifti_maps_masker.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,22 @@ def __call__(self, imgs):

@_utils.fill_doc
class NiftiMapsMasker(BaseMasker, _utils.CacheMixin):
"""Class for masking of Niimg-like objects.
"""Class for extracting data from Niimg-like objects \
using maps of potentially overlapping brain regions.

NiftiMapsMasker is useful when data from overlapping volumes should be
extracted (contrarily to :class:`nilearn.maskers.NiftiLabelsMasker`).
Use case: Summarize brain signals from large-scale networks obtained by
prior PCA or :term:`ICA`.

Note that, Inf or NaN present in the given input images are automatically
put to zero rather than considered as missing data.
Use case:
summarize brain signals from large-scale networks
obtained by prior PCA or :term:`ICA`.

.. note::
Inf or NaN present in the given input images are automatically
put to zero rather than considered as missing data.

For more details on the definitions of maps in Nilearn,
see the :ref:`region` section.

Parameters
----------
Expand Down
4 changes: 3 additions & 1 deletion nilearn/maskers/nifti_masker.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ class NiftiMasker(BaseMasker, _utils.CacheMixin):

NiftiMasker is useful when preprocessing (detrending, standardization,
resampling, etc.) of in-mask :term:`voxels<voxel>` is necessary.
Use case: working with time series of :term:`resting-state` or task maps.

Use case:
working with time series of :term:`resting-state` or task maps.

Parameters
----------
Expand Down
6 changes: 4 additions & 2 deletions nilearn/maskers/nifti_spheres_masker.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,10 @@ class NiftiSpheresMasker(BaseMasker, CacheMixin):
"""Class for masking of Niimg-like objects using seeds.

NiftiSpheresMasker is useful when data from given seeds should be
extracted. Use case: Summarize brain signals from seeds that were
obtained from prior knowledge.
extracted.

Use case:
summarize brain signals from seeds that were obtained from prior knowledge.

Parameters
----------
Expand Down