siibra.locations.pointset
A set of coordinates on a reference space.
Module Contents
Classes
A set of 3D points in the same reference space, |
Functions
|
Create a PointSet from an iterable of Points. |
- class siibra.locations.pointset.PointSet(coordinates: List[Tuple] | numpy.ndarray, space=None, sigma_mm: int | float | List[int | float] = 0, labels: List[int | float | tuple] = None)
-
A set of 3D points in the same reference space, defined by a list of coordinates.
- property boundingbox
Return the bounding box of these points. TODO revisit the numerical margin of 1e-6, should not be necessary.
- property centroid
- property coordinates: numpy.ndarray
- property has_constant_sigma: bool
- property homogeneous
Access the list of 3D point as an Nx4 array of homogeneous coordinates.
- property label_colors
return a color for the given label.
- property volume
- __eq__(other: PointSet)
Required to provide comparison and making the object hashable
- __getitem__(index: int)
- __hash__()
Return hash(self).
- __iter__()
Return an iterator over the coordinate locations.
- __len__()
The number of points in this PointSet.
- __str__()
Return str(self).
- as_list()
Return the point set as a list of 3D tuples.
- find_clusters(min_fraction=1 / 200, max_fraction=1 / 8)
- intersection(other: siibra.locations.location.Location)
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.
- 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
- siibra.locations.pointset.from_points(points: List[siibra.locations.point.Point], newlabels: List[int | float | tuple] = None) PointSet
Create a PointSet from an iterable of Points.
- Parameters:
points (Iterable[point.Point]) –
newlabels (List[int], optional) – Use these labels instead of the original labels of the points.
- Return type: