-
Notifications
You must be signed in to change notification settings - Fork 630
[MAINT] ensure transform on 3D volume (1D surface) images returns 1D arrays #5381
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
Changes from all commits
dcdfa06
fdd8f0d
1f900dd
a7bb6ec
853edec
cdd9b52
747492c
5bef1b0
0504756
1d526f0
d44e3b2
eddca40
60a7b1a
f14b703
417776b
427b481
ff8b482
87b93f3
0510ad9
185c829
f1748ee
ef5fe78
8f5e92b
ceeb4e9
8b53a88
cb46ad9
ba065d1
58ec000
e69134c
86dfee8
68c7eae
1d820e2
f15c15f
252cf1b
dd2901f
0c28d4e
6f8c5f6
402f902
e1d52de
e552e3f
02f55a7
4508c96
6af0509
8e7275d
60685d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,8 +1,8 @@ | ||||||
.. _masker_objects: | ||||||
|
||||||
===================================================================== | ||||||
================================================================ | ||||||
From neuroimaging volumes to data matrices: the masker objects | ||||||
===================================================================== | ||||||
================================================================ | ||||||
|
||||||
This chapter introduces the maskers: objects that go from | ||||||
neuroimaging volumes, on the disk or in memory, to data matrices, eg of | ||||||
|
@@ -24,10 +24,10 @@ the raw neuroimaging data in 3D space into the units of observation | |||||
relevant for the research questions at hand. | ||||||
|
||||||
.. tip:: | ||||||
Masker objects can transform both 3D and 4D image objects. | ||||||
Transforming a 4D image produces a 2D (samples x features) matrix. | ||||||
Currently, transforming a 3D image also produces a 2D (1 x features) matrix, | ||||||
but starting in version 0.12, it will produce a 1D (features) array. | ||||||
Masker objects can transform both 3D and 4D image objects : | ||||||
|
||||||
- transforming a 3D image produces a 1D (features,) array, | ||||||
- transforming a 4D image produces a 2D (samples, features) array. | ||||||
|
||||||
|
||||||
.. |niimgs| image:: ../images/niimgs.jpg | ||||||
|
@@ -294,8 +294,6 @@ properties, before conversion to :term:`voxel` signals. | |||||
:func:`nilearn.signal.clean` | ||||||
|
||||||
|
||||||
|
||||||
|
||||||
Resampling: resizing and changing resolutions of images | ||||||
....................................................... | ||||||
|
||||||
|
@@ -343,9 +341,10 @@ an excerpt of :ref:`the example performing Anova-SVM on the Haxby data | |||||
| | ||||||
|
||||||
.. tip:: | ||||||
Masker objects can inverse-transform both 1D and 2D arrays. | ||||||
Inverse-transforming a 2D array produces a 4D (X x Y x Z x samples) image, | ||||||
while inverse-transforming a 1D array produces a 3D (X x Y x Z) image. | ||||||
Masker objects can inverse-transform both 1D and 2D arrays : | ||||||
|
||||||
- inverse-transforming a 2D array produces a 4D (X x Y x Z x samples) image, | ||||||
- inverse-transforming a 1D array produces a 3D (X x Y x Z) image. | ||||||
|
||||||
.. topic:: **Examples to better understand the NiftiMasker** | ||||||
|
||||||
|
@@ -445,8 +444,17 @@ as to facilitate the computation of :term:`voxel` signals in multi-subjects sett | |||||
While :class:`NiftiMasker`, :class:`NiftiLabelsMasker` and | ||||||
:class:`NiftiMapsMasker` work with 3D inputs (single brain volume) or 4D inputs | ||||||
(sequence of brain volumes in time for one subject), :class:`MultiNiftiMasker`, | ||||||
:class:`MultiNiftiLabelsMasker` and :class:`MultiNiftiMapsMasker` expect 5D | ||||||
inputs (list of sequences of brain volumes). | ||||||
:class:`MultiNiftiLabelsMasker` and :class:`MultiNiftiMapsMasker` | ||||||
can also handle list of 3D or 4D image objects. | ||||||
|
||||||
.. tip:: | ||||||
MultiMasker objects can transform both 3D, 4D, | ||||||
as well as list of 3D or 4D image objects : | ||||||
|
||||||
- transforming a 3D image produces a 1D (features,) array, | ||||||
- transforming a 4D image produces a 2D (samples, features) array, | ||||||
- transforming a list of 3D image produces a list of 1D (features,) array, | ||||||
- transforming a list of 4D image produces a list of 2D (samples, features) array. | ||||||
|
||||||
:class:`MultiNiftiMasker` Usage | ||||||
------------------------------- | ||||||
|
@@ -470,7 +478,7 @@ for each subject. | |||||
* :ref:`sphx_glr_auto_examples_03_connectivity_plot_atlas_comparison.py` | ||||||
|
||||||
:class:`MultiNiftiMapsMasker` Usage | ||||||
------------------------------------- | ||||||
----------------------------------- | ||||||
|
||||||
:class:`MultiNiftiMapsMasker` extracts signals regions defined by maps | ||||||
for each subject. | ||||||
|
@@ -504,3 +512,27 @@ seed position is used. | |||||
.. topic:: **Examples** | ||||||
|
||||||
* :ref:`sphx_glr_auto_examples_03_connectivity_plot_sphere_based_connectome.py` | ||||||
|
||||||
|
||||||
Extraction of signals from surface images\ :class:`SurfaceMasker`, :class:`SurfaceLabelsMasker`, :class:`SurfaceMapsMasker` | ||||||
============================================================================================================================ | ||||||
|
||||||
The purpose of :class:`SurfaceMasker`, :class:`SurfaceLabelsMasker`, :class:`SurfaceMapsMasker` | ||||||
is to mirror the capabilities of | ||||||
:class:`NiftiMasker`, :class:`NiftiLabelsMasker` and :class:`NiftiMapsMasker` | ||||||
but to extract data from :class:`~nilearn.surface.SurfaceImage`. | ||||||
|
||||||
They can perform data extraction from 1D surface data (n_vertices), | ||||||
2D surface data (n_vertices x samples) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apparently I am late :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oops sorry I need to do another pass on this so I can integrate those suggestions |
||||||
as well as list of 1D or 2D surface data with the same underlying mesh. | ||||||
|
||||||
.. tip:: | ||||||
Surface masker objects can transform both 1D, 2D, | ||||||
as well as list of 1D or 2D surface image objects. | ||||||
Transforming a 1D image produces a 1D (features,) array. | ||||||
All other input will produce a 1D (samples, features) array.. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
Surface masker objects can inverse-transform both 1D and 2D arrays : | ||||||
|
||||||
- inverse-transforming a 1D array produces a 1D (n_vertices,) image, | ||||||
- inverse-transforming a 2D array produces a 2D (n_vertices, samples) image. |
Uh oh!
There was an error while loading. Please reload this page.