siibra.locations.point

Singular coordinate defined on a space, possibly with an uncertainty.

Module Contents

Classes

Point

A single 3D point in reference space.

class siibra.locations.point.Point(coordinatespec, space=None, sigma_mm: float = 0.0, label: int | float | tuple = None)
Inheritance diagram of siibra.locations.point.Point

A single 3D point in reference space.

property boundingbox
property homogeneous

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

property id: str
property volume

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

__add__(other)

Add the coordinates of two points to get a new point representing.

__eq__(other: Point)

Required to provide comparison and making the object hashable

__ge__(other)

Return self>=value.

__getitem__(index)

Index access to the coefficients of this point.

__gt__(other)

Return self>value.

__hash__()

Return hash(self).

__iter__()

Return an iterator over the location, so the Point can be easily cast to list or tuple.

__le__(other)

Return self<=value.

__len__()
__lt__(other)

Return self<value.

__mul__(number: float)

Return a new point with multiplied coordinates in the same space.

__repr__()

Return repr(self).

__setitem__(index, value)

Write access to the coefficients of this point.

__sub__(other)

Substract the coordinates of two points to get a new point representing the offset vector. Alternatively, subtract an integer from the all coordinates of this point to create a new one. TODO this needs to maintain sigma

__truediv__(number: float)

Return a new point with divided coordinates in the same 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.

get_enclosing_cube(width_mm)

Create a bounding box centered around this point with the given width. TODO this should respect sigma (in addition or instead of the offset)

intersection(other: siibra.locations.location.Location) Point

Return the intersection of two BrainStructures, ie. the other BrainStructure filtered by this BrainStructure.

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. TODO this needs to maintain sigma

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 TODO this needs to maintain the sigma parameter!