siibra

Submodules

Attributes

QUIET

VERBOSE

cache

fetch_ebrains_token

find_regions

from_json

logger

set_ebrains_token

Classes

MapIndex

Identifies a unique region in a ParcellationMap, combining its labelindex (the "color") and mapindex (the number of the 3Dd map, in case multiple are provided).

MapType

Generic enumeration.

Point

A single 3D point in reference space.

PointSet

A set of 3D points in the same reference space,

Functions

get_map(parcellation, space[, maptype])

get_region(parcellation, region)

get_template(space_spec, **kwargs)

set_cache_size(maxsize_gbyte)

set_feasible_download_size(maxsize_gbyte)

set_log_level(level)

warm_cache()

Preload preconfigured siibra concepts.

Package Contents

class siibra.MapIndex(volume: int = None, label: int = None, fragment: str = None)

Identifies a unique region in a ParcellationMap, combining its labelindex (the “color”) and mapindex (the number of the 3Dd map, in case multiple are provided).

classmethod from_dict(spec: dict)
fragment = None
label = None
volume = None
class siibra.MapType
Inheritance diagram of siibra.MapType

Generic enumeration.

Derive from this class to define new enumerations.

LABELLED = 1
STATISTICAL = 2
class siibra.Point(coordinatespec, space=None, sigma_mm: float = 0.0)

A single 3D point in reference space.

bigbrain_section()

Estimate the histological section number of BigBrain which corresponds to this point. If the point is given in another space, a warping to BigBrain space will be tried.

contained_in(other: siibra.locations.location.Location | nibabel.Nifti1Image)
contains(other: siibra.locations.location.Location | nibabel.Nifti1Image)
get_enclosing_cube(width_mm)

Create a bounding box centered around this point with the given width.

intersection(other: siibra.locations.location.Location | nibabel.Nifti1Image) Point

All subclasses of Location must implement intersection, as it is required by SpatialFeature._test_mask()

intersects(other: siibra.locations.location.Location | nibabel.Nifti1Image) bool

Returns true if this point lies in the given mask.

NOTE: The affine matrix of the image must be set to warp voxels coordinates into the reference space of this Bounding Box.

static parse(spec, unit='mm') Tuple[float, float, float]

Converts a 3D coordinate specification into a 3D tuple of floats.

Parameters:
  • spec (Any of str, tuple(float,float,float)) – For string specifications, comma separation with decimal points are expected.

  • unit (str) – specification of the unit (only ‘mm’ supported so far)

Return type:

tuple(float, float, float)

transform(affine: numpy.ndarray, space=None)

Returns a new Point obtained by transforming the coordinate of this one with the given affine matrix.

Parameters:
  • affine (numpy 4x4 ndarray) – affine matrix

  • space (str, Space, or None) –

    Target reference space which is reached after applying the transform

    Note

    The consistency of this cannot be checked and is up to the user.

warp(space)

Creates a new point by warping this point to another space

property boundingbox
coordinate
property homogeneous

The homogenous coordinate of this point as a 4-tuple, obtained by appending ‘1’ to the original 3-tuple.

property id: str
sigma = 0.0
property volume

The volume of a point can be nonzero if it has a location uncertainty.

class siibra.PointSet(coordinates, space=None, sigma_mm=0)

A set of 3D points in the same reference space, defined by a list of coordinates.

as_list()

Return the point set as a list of 3D tuples.

intersection(other: siibra.locations.location.Location | nibabel.Nifti1Image)

Return the subset of points that are inside the given mask.

NOTE: The affine matrix of the image must be set to warp voxels coordinates into the reference space of this Bounding Box.

intersects(other: siibra.locations.location.Location | nibabel.Nifti1Image)

Verifies wether this 3D location intersects the given mask.

NOTE: The affine matrix of the image must be set to warp voxels coordinates into the reference space of this Bounding Box.

transform(affine: numpy.ndarray, space=None)

Returns a new PointSet obtained by transforming the coordinates of this one with the given affine matrix.

Parameters:
  • affine (numpy 4x4 ndarray) – affine matrix

  • space (reference space (id, name, or Space)) – Target reference space which is reached after applying the transform. Note that the consistency of this cannot be checked and is up to the user.

warp(space, chunksize=1000)

Creates a new point set by warping its points to another space

property boundingbox

Return the bounding box of these points.

property centroid
property has_constant_sigma
property homogeneous

Access the list of 3D point as an Nx4 array of homogeneous coorindates.

property sigma
property volume
siibra.get_map(parcellation: str, space: str, maptype: commons.MapType = MapType.LABELLED, **kwargs)
siibra.get_region(parcellation: str, region: str)
siibra.get_template(space_spec: str, **kwargs)
siibra.set_cache_size(maxsize_gbyte: int)
siibra.set_feasible_download_size(maxsize_gbyte)
siibra.set_log_level(level)
siibra.warm_cache()

Preload preconfigured siibra concepts.

Siibra relies on preconfigurations that simplify integrating various concepts such as parcellations, refernce spaces, and multimodal data features. By preloading the instances, siibra commits all preconfigurations to the memory at once instead of commiting them when required.

siibra.QUIET
siibra.VERBOSE
siibra.cache = None
siibra.fetch_ebrains_token
siibra.find_regions
siibra.from_json
siibra.logger = None
siibra.set_ebrains_token