cortex.dataset.Dataset

class cortex.dataset.Dataset(**kwargs: Dataview | dict | str | tuple | Dataset)[source]

Wrapper for a named collection of Dataview objects (Volume, Vertex, VolumeRGB, etc.). Provides a standard way to save/load that collection as an HDF5 file, and lets a single Dataview be treated the same as a full Dataset elsewhere in pycortex (e.g. cortex.webshow).

Each keyword argument names one view; its value can be a Dataview, a tuple (implicitly converted to a Volume or Vertex), a filename string (loaded from an .hdf file), a dict (converted to a nested Dataset), or another Dataset (merged in).

Methods

__init__(**kwargs)

append(**kwargs)

Add the views in kwargs into this dataset.

from_file(filename[, subject])

Load a pycortex Dataset (cortex.Dataset class) from a file

get_mask(subject, xfmname, maskname)

Retrieve a subject's voxel mask from this (packed) dataset file.

get_overlay(subject[, type])

Retrieve a subject's overlay (currently only ROIs) from this (packed) dataset file.

get_surf(...)

Retrieve a subject's surface geometry from this (packed) dataset file.

get_xfm(subject, xfmname)

Retrieve a subject's transform from this (packed) dataset file.

prepend(prefix)

Adds the given prefix to the name of every data object and returns a new Dataset.

save([filename, pack])

Write this dataset's views out to an HDF5 file.

uniques([collapse])

Return the set of unique BrainData objects contained by this dataset