cortex.dataset.Volume2D

class cortex.dataset.Volume2D(dim1: NDArray | Volume, dim2: NDArray | Volume, subject: str | None = None, xfmname: 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 3D volumes for simultaneous visualization. Includes information on how the volumes should be jointly colormapped.

Parameters:
dim1ndarray or Volume

The first volume. Can be a 1D or 3D array (see Volume for details), or a Volume.

dim2ndarray or Volume

The second volume. Can be a 1D or 3D array (see Volume for details), or a Volume.

subjectstr, optional

Subject identifier. Must exist in the pycortex database. If not given, dim1 must be a Volume from which the subject can be extracted.

xfmnamestr, optional

Transform name. Must exist in the pycortex database. If not given, dim1 must be a Volume 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 vmin of dim1 is used (its own vmin for 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 vmax of dim1 is used (its own vmax for 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 vmin of dim2 is used (same rule as vmin).

vmax2float, optional

Maximum value in colormap for dim2. If not given, the vmax of dim2 is used (same rule as vmax).

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, xfmname, ...])

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.

get_cmapdict()

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

alpha

Optional alpha map (Volume/Vertex in [vmin, vmax]) multiplied into the colormap alpha.

priority

raw

VolumeRGB object containing the colormapped data from this object.

subject

xfmname

dim1

dim2