pointset
¶
Point-set structures
Imaging data are sampled at points in space, and these points can be described by coordinates. These structures are designed to enable operations on sets of points, as opposed to the data sampled at those points.
Abstractly, a point set is any collection of points, but there are two types that warrant special consideration in the neuroimaging context: grids and meshes.
A grid is a collection of regularly-spaced points. The canonical examples of grids are the indices of voxels and their affine projection into a reference space.
A mesh is a collection of points and some structure that enables adjacent points to be identified. A triangular mesh in particular uses triplets of adjacent vertices to describe faces.
|
|
|
A regularly-spaced collection of coordinates |
|
Class for generating indices just-in-time |
|
A collection of points described by coordinates. |
CoordinateArray
¶
Grid
¶
- class nibabel.pointset.Grid(coordinates: CoordinateArray, affine: ndarray | None = None, homogeneous: bool = False)¶
Bases:
Pointset
A regularly-spaced collection of coordinates
This class provides factory methods for generating Pointsets from
SpatialImage
s and generating masks from coordinate sets.- __init__(coordinates: CoordinateArray, affine: ndarray | None = None, homogeneous: bool = False)¶
- classmethod from_image(spatialimage: SpatialImage) Self ¶
- classmethod from_mask(mask: SpatialImage) Self ¶
- to_mask(shape=None) SpatialImage ¶
GridIndices
¶
Pointset
¶
- class nibabel.pointset.Pointset(coordinates: CoordinateArray, affine: ndarray | None = None, homogeneous: bool = False)¶
Bases:
object
A collection of points described by coordinates.
- Parameters:
- coordsarray-like
(N, n) array with N being points and columns their n-dimensional coordinates
- affine
numpy.ndarray
Affine transform to be applied to coordinates array
- homogeneous
bool
Indicate whether the provided coordinates are homogeneous, i.e., homogeneous 3D coordinates have the form
(x, y, z, 1)
- __init__(coordinates: CoordinateArray, affine: ndarray | None = None, homogeneous: bool = False)¶
- coordinates: CoordinateArray¶