siibra.volumes.providers
Subpackage handling the digestion of different volume and mesh types
Submodules
Classes
Helper class that provides a standard way to create an ABC using |
|
One or more surface mesh fragments in Gifti format. |
|
A mesh labeling, specified by a gifti file. |
|
A surface mesh provided as neuroglancer precomputed mesh. |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
Package Contents
- class siibra.volumes.providers.FreesurferAnnot(url: str | dict)
Helper class that provides a standard way to create an ABC using inheritance.
- abstract get_boundingbox(clip=False, background=0.0) siibra.locations.boundingbox.BoundingBox
- class siibra.volumes.providers.GiftiMesh(url: str | Dict[str, str], volume=None)
One or more surface mesh fragments in Gifti format.
- fetch(fragment: str = None, **kwargs)
Returns the mesh as a dictionary with two numpy arrays.
- Parameters:
fragment (str, default: None) –
A fragment name can be specified to choose from multiple fragments.
Note
If not specified, multiple fragments will be merged into one mesh. In such a case, the verts and faces arrays of different fragments are appended to one another.
- Returns:
‘verts’: An Nx3 array of vertex coordinates,
’faces’: an Mx3 array of face definitions using row indices of the vertex array
- Return type:
- fetch_iter()
Iterator returning all submeshes
- Returns:
‘verts’: An Nx3 array of vertex coordinates,
’faces’: an Mx3 array of face definitions using row indices of the vertex array
’name’: Name of the of the mesh variant
- Return type:
- abstract get_boundingbox(clip=False, background=0.0, **fetch_kwargs) siibra.locations.boundingbox.BoundingBox
Bounding box calculation is not yet implemented for meshes.
- property fragments
- property variants
- volume = None
- class siibra.volumes.providers.GiftiSurfaceLabeling(url: str | dict)
A mesh labeling, specified by a gifti file.
- abstract get_boundingbox(clip=False, background=0.0) siibra.locations.boundingbox.BoundingBox
- class siibra.volumes.providers.NeuroglancerMesh(resource: str | dict, volume=None)
A surface mesh provided as neuroglancer precomputed mesh.
- fetch(label: int, fragment: str)
Fetches a particular mesh. Each mesh is a dictionary with keys:
- Parameters:
label (int) – Label of the volume
fragment (str, default: None) –
A fragment name can be specified to choose from multiple fragments.
Note
If not specified, multiple fragments will be merged into one mesh. In such a case, the verts and faces arrays of different fragments are appended to one another.
- Returns:
‘verts’: An Nx3 array of vertex coordinates (in nanometer)
’faces’: an MX3 array containing connection data of vertices
’name’: Name of the of the mesh variant
- Return type:
- abstract get_boundingbox(clip=False, background=0.0, **fetch_kwargs) siibra.locations.boundingbox.BoundingBox
Bounding box calculation is not yet implemented for meshes.
- volume = None
- class siibra.volumes.providers.NeuroglancerProvider(url: str | Dict[str, str])
Helper class that provides a standard way to create an ABC using inheritance.
- fetch(fragment: str = None, resolution_mm: float = None, voi: siibra.locations.boundingbox.BoundingBox = None, **kwargs) nibabel.Nifti1Image
Fetch 3D image data from neuroglancer volume.
- Parameters:
fragment (str, optional) – The name of a fragment volume to fetch, if any. For example, some volumes are split into left and right hemisphere fragments. See
fragments()
resolution_mm (float, default: None (i.e, lowest)) – Desired resolution in millimeters. .. tip:: Set to -1 to get the highest resolution. (might need to set max_bytes)
voi (BoundingBox) – optional specification of a volume of interest to fetch.
max_bytes (float: Default: NeuroglancerVolume.MAX_BYTES) – Maximum allowable size (in bytes) for downloading the image. siibra will attempt to find the highest resolution image with a size less than this value.
- get_boundingbox(**fetch_kwargs) siibra.locations.boundingbox.BoundingBox
Return the bounding box in physical coordinates of the union of fragments in this neuroglancer volume.
- Parameters:
fetch_kwargs – key word arguments that are used for fetching volumes, such as voi or resolution_mm.
- class siibra.volumes.providers.NiftiProvider(src: str | Dict[str, str] | nibabel.Nifti1Image | Tuple[numpy.ndarray, numpy.ndarray])
Helper class that provides a standard way to create an ABC using inheritance.
- fetch(fragment: str = None, voi: siibra.locations.boundingbox.BoundingBox = None, label: int = None)
Loads and returns a Nifti1Image object
- Parameters:
fragment (str) – Optional name of a fragment volume to fetch, if any. For example, some volumes are split into left and right hemisphere fragments. see
fragments()
voi (BoundingBox) – optional specification of a volume of interest to fetch.
label (int, default: None) – Optional: a label index can be provided. Then the mask of the 3D volume will be returned, where voxels matching this label are marked as “1”.
- find_peaks(min_distance_mm=5)
Find peaks in the image data.
- Parameters:
min_distance_mm (float) – Minimum distance between peaks in mm
Returns –
-------- –
PointCloud –
- get_boundingbox(**fetch_kwargs) siibra.locations.boundingbox.BoundingBox
Return the bounding box in physical coordinates of the union of fragments in this nifti volume.
- Parameters:
fetch_kwargs – Not used
- get_shape(resolution_mm=None)
- is_float()
- property fragments
- class siibra.volumes.providers.ZippedFreesurferAnnot(url: str | dict)
Helper class that provides a standard way to create an ABC using inheritance.
- abstract get_boundingbox(clip=False, background=0.0) siibra.locations.boundingbox.BoundingBox