cortex.dataset.Vertex2D¶
- class cortex.dataset.Vertex2D(dim1: NDArray | Vertex, dim2: NDArray | Vertex, subject: str | None = None, description: str = '', cmap: str | None = None, vmin: float | None = None, vmax: float | None = None, vmin2: float | None = None, vmax2: float | None = None, **kwargs)[source]¶
Contains two vertex maps for simultaneous visualization. Includes information on how the maps should be jointly colormapped.
- Parameters:
- dim1ndarray or Vertex
The first vertex map. Can be a 1D array (see Vertex for details), or a Vertex.
- dim2ndarray or Vertex
The second vertex map. Can be a 1D array (see Vertex for details), or a Vertex.
- subjectstr, optional
Subject identifier. Must exist in the pycortex database. If not given, dim1 must be a Vertex from which the subject can be extracted.
- descriptionstr, optional
String describing this dataset. Displayed in webgl viewer.
- cmapstr, optional
Colormap (or colormap name) to use. If not given defaults to the default_cmap2d in your pycortex options.cfg file.
- vminfloat, optional
Minimum value in colormap for dim1. If not given, the
vminof dim1 is used (its ownvminfor a Volume/Vertex object, the 1st percentile of the data for an array).- vmaxfloat, optional
Maximum value in colormap for dim1. If not given, the
vmaxof dim1 is used (its ownvmaxfor a Volume/Vertex object, the 99th percentile of the data for an array).- vmin2float, optional
Minimum value in colormap for dim2. If not given, the
vminof dim2 is used (same rule asvmin).- vmax2float, optional
Maximum value in colormap for dim2. If not given, the
vmaxof dim2 is used (same rule asvmax).- alphandarray or Volume/Vertex, optional
Per-voxel (per-vertex) opacity multiplied into the colormap alpha. Arrays are taken in [0, 1]; Volume/Vertex objects are normalized by their own
vmin/vmax. Honored identically by quickflat and the WebGL viewer. Wherever dim1, dim2 or alpha is NaN the data is rendered fully transparent, regardless of this map.- **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 (default = “nearest”)
interpolation filter for volumetric rendering in webgl (nearest/trilinear/nearlin/debug)
- alphandarray or Volume
overwrites the computed alpha channel from a cmap, but currently commented out in Dataview2D
Methods
__init__(dim1, dim2[, subject, description, ...])blend_curvature(alpha[, threshold, ...])Blend the data with a curvature map depending on a transparency map.
copy(*args, **kwargs)Create a new instance of this Dataview's class, reusing its display settings (cmap, vmin, vmax, description, state, attrs).
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.
to_json([simple])Serialize this 2D dataview to a JSON-compatible dict, for the webgl viewer / HDF5 export.
uniques([collapse])Yield the two underlying Dataview objects (dim1, dim2) that make up this composite 2D view.
Attributes
Optional alpha map (Volume/Vertex in [vmin, vmax]) multiplied into the colormap alpha.
VertexRGB object containing the colormapped data from this object.