siibra.volumes.sparsemap
Represents lists of probabilistic brain region maps.
Module Contents
Classes
A sparse representation of list of statistical (e.g. probabilistic) brain |
- class siibra.volumes.sparsemap.SparseIndex
- property num_volumes
- add_img(imgdata: numpy.ndarray, affine: numpy.ndarray)
- coords(volume: int)
- mapped_voxels(volume: int)
- max()
- class siibra.volumes.sparsemap.SparseMap(identifier: str, name: str, space_spec: dict, parcellation_spec: dict, indices: Dict[str, siibra.commons.MapIndex], volumes: list = [], shortname: str = '', description: str = '', modality: str = None, publications: list = [], datasets: list = [])
-
A sparse representation of list of statistical (e.g. probabilistic) brain region maps.
It represents the 3D statistical maps of N brain regions by two data structures:
‘spatial_index’, a 3D volume where non-negative values represent unique indices into a list of region assignments
‘probs’, a list of region assignments where each entry is a dict
More precisely, given
i = sparse_index.voxels[x, y, z]
we define thatif i<0, no brain region is assigned at this location
if i>=0,
probs[i]
defines the probabilities of brain regions.
Each entry in probs is a dictionary that represents the region assignments for the unique voxel where
spatial_index == i
. The assignment maps from a MapIndex to the actual (probability) value.- property affine
- property shape
- property sparse_index
- fetch(region_or_index: siibra.commons.MapIndex | str | siibra.core.region.Region = None, *, index: siibra.commons.MapIndex = None, region: str | siibra.core.region.Region = None, **kwargs)
Recreate a particular volumetric map from the sparse representation.
- load_zipped_sparseindex(zipfname: str)
Load SparseIndex from previously computed source and creates a local cache.
- Parameters:
zipfile (str) – A url or a path to zip file containing the SparseIndex files for this SparseMap precomputed by siibra.
- Return type: