Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the user guide for the big picture.
nilearn.surface.PolyData¶
- class nilearn.surface.PolyData(left=None, right=None)[source]¶
A collection of data arrays.
It is a shallow wrapper around the
parts
dictionary, which cannot be empty and whose keys must be a subset of {“left”, “right”}.Added in version 0.11.0.
- Parameters:
- left1/2D
numpy.ndarray
orstr
orpathlib.Path
or None, default = None - right1/2D
numpy.ndarray
orstr
orpathlib.Path
or None, default = None
- left1/2D
- Attributes:
- parts
dict
of 2Dnumpy.ndarray
(n_vertices, n_timepoints) shape
tuple
ofint
Shape of the data.
- parts
Examples
>>> import numpy as np >>> from nilearn.surface import PolyData >>> n_time_points = 10 >>> n_left_vertices = 5 >>> n_right_vertices = 7 >>> left = np.ones((n_left_vertices, n_time_points)) >>> right = np.ones((n_right_vertices, n_time_points)) >>> PolyData(left=left, right=right) <PolyData (12, 10)> >>> PolyData(right=right) <PolyData (7, 10)>
>>> PolyData() Traceback (most recent call last): ... ValueError: Cannot create an empty PolyData. ...
- property shape¶
Shape of the data.
- to_filename(filename)[source]¶
Save data to gifti.
- Parameters:
- filename
str
orpathlib.Path
If the filename contains hemi-L then only the left part of the mesh will be saved. If the filename contains hemi-R then only the right part of the mesh will be saved. If the filename contains neither of those, then _hemi-L and _hemi-R will be appended to the filename and both will be saved.
- filename
Examples using nilearn.surface.PolyData
¶
Seed-based connectivity on the surface
Seed-based connectivity on the surface