siibra.experimental

Submodules

Package Contents

Classes

Contour

A PointSet that represents a contour line.

CorticalProfileSampler

Samples cortical profiles from the cortical layer maps.

Patch

Plane3D

A 3D plane in reference space.

class siibra.experimental.Contour(coordinates, space=None, sigma_mm=0, labels: list = None)
Inheritance diagram of siibra.experimental.Contour

A PointSet that represents a contour line. The only difference is that the point order is relevant, and consecutive points are thought as being connected by an edge.

In fact, PointSet assumes order as well, but no connections between points.

crop(voi: siibra.locations.boundingbox.BoundingBox)

Crop the contour with a volume of interest. Since the contour might be split from the cropping, returns a set of contour segments.

class siibra.experimental.CorticalProfileSampler

Samples cortical profiles from the cortical layer maps.

query(query_point: siibra.locations.point.Point)
class siibra.experimental.Patch(corners: siibra.locations.pointset.PointSet)
property space
extract_volume(image_volume: siibra.volumes.volume.Volume, resolution_mm: float)

fetches image data in a planar patch. TODO The current implementation only covers patches which are strictly define in the y plane. A future implementation should accept arbitrary oriented patches.accept arbitrary oriented patches.

flip()

Flips the patch.

class siibra.experimental.Plane3D(point1: siibra.locations.point.Point, point2: siibra.locations.point.Point, point3: siibra.locations.point.Point)

A 3D plane in reference space. This shall eventually be derived from siibra.Location

property distance_from_origin
property normal
classmethod from_image(image: siibra.volumes.volume.Volume)

Derive an image plane by assuming the volume to be a 2D image. The smallest dimension in voxel space is considered flat. The plane is defined in the physical space of the volume.

get_enclosing_patch(points: siibra.locations.pointset.PointSet, margin=[0.5, 0.5])

Computes the enclosing patch in the given plane which contains the projections of the given points. The orientation of the patch follows the principal axis.

intersect_line_segments(startpoints: numpy.ndarray, endpoints: numpy.ndarray)

Intersects a set of straight line segments with the plane. Returns the set of intersection points. The line segments are given by two Nx3 arrays of their start- and endpoints. The result is an Nx3 list of intersection coordinates. TODO This returns an intersection even if the line segment intersects the plane,

intersect_mesh(mesh: dict)

Intersects a 3D surface mesh with the plane. Returns a set of split 2D contours, represented by ordered coordinate lists. The output contour coordinates are intersection points of mesh edges going through the plane, and only combined into a contour if arising from neighboring edges in the mesh. The mesh is passed as a dictionary with an Nx3 array “verts” of vertex coordinates, and an Mx3 array “faces” of face definitions. Each row in the face array corresponds to the three indices of vertices making up the triangle. The result is a list of contour segments, each represented as a PointSet holding the ordered list of contour points. The point labels in each “contour” PointSet hold the index of the face in the mesh which made up each contour point.

project_points(points: siibra.locations.pointset.PointSet)

projects the given points onto the plane.

sidedness(points: numpy.ndarray)

Computes labels for a set of 3D coordinates classifying them by the halfspaces spanned by this plane.