cortex.dataset.Vertex¶
- class cortex.dataset.Vertex(data: NDArray, subject: str, cmap: str | None = None, vmin: float | None = None, vmax: float | None = None, description: str = '', **kwargs)[source]¶
Encapsulates a 1D vertex map or 2D vertex movie. Includes information on how the data should be colormapped for display purposes.
- Parameters:
- datandarray
The data. Can be 1D with shape (v,), or 2D with shape (t,v). Here, v can be the number of vertices in both hemispheres, or the number of vertices in either one of the hemispheres. In that case, the data for the other hemisphere will be filled with zeros.
- subjectstr
Subject identifier. Must exist in the pycortex database.
- cmapstr or matplotlib colormap, optional
Colormap (or colormap name) to use. If not given defaults to matplotlib default colormap.
- vminfloat, optional
Minimum value in colormap. If not given, defaults to the 1st percentile of the data.
- vmaxfloat, optional
Maximum value in colormap. If not given defaults to the 99th percentile of the data.
- descriptionstr, optional
String describing this dataset. Displayed in webgl viewer.
- **kwargs
- All additional arguments in kwargs are passed to the VolumeData and Dataview
- stateuntyped
role unclear
- priorityint (default = 1)
controls the order in which datasets are viewed in webgl
- stimstr
path to stimulus file
- ratenumeric (default 1)
frame rate for movie/time series playback in webgl
- delaynumeric (default 0)
delay for movie/time series playback in webgl
- filterstr
interpolation filter for volumetric rendering in webgl (nearest/trilinear/nearlin/debug)
Methods
__init__(data, subject[, cmap, vmin, vmax, ...])blend_curvature(alpha[, threshold, ...])Blend the data with a curvature map depending on a transparency map.
copy(data)Return a new VertexData object for the same subject but with data replaced by the given data.
empty(subject[, value])Create a constant-valued VertexData for the given subject.
exp()Return copy of this brain data with data exponentiated.
from_hdf(node[, subject])Reconstruct a Dataview from a /views/<name> node in an HDF5 file previously written by Dataview._write_hdf.
Returns a dictionary with cmap information.
map(target_subj[, surface_type, hemi, fs_subj])Map this data from this surface to another surface
random(subject[, random_type, smooth_factor])Create a random-valued VertexData for the given subject.
to_json([simple])Serialize this vertex data to a JSON-compatible dict, for the webgl viewer / HDF5 export.
uniques([collapse])Yield the underlying BrainData object(s) this view is built from.
volume(xfmname[, projection])Map this VertexData back to volume space, creating a VolumeData object.
Attributes
Data for only the left hemisphere vertices.
Name of this BrainData, computed from hash of data.
Colormap this Vertex's data into an RGBA VertexRGB.
Data for only the right hemisphere vertices.