ArrayImageRef

Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

class ArrayImageRef(array: ndarray, geometry: Geometry)[source]

Bases: object

In-memory ImageRef backed by a NumPy array.

This is the reference implementation for custom lazy references: it holds the array plus its geometry and materialises trivially.

array

Voxel values, NumPy axis order (z, y, x).

Type:

numpy.ndarray

geometry

Spatial definition of array.

Type:

habit.contracts.geometry.Geometry

load() → ndarray[source]

Return the held array.

load_volume(*, modality: str | None = None) → ImageVolume[source]

Materialise directly as an ImageVolume.

__init__(array: ndarray, geometry: Geometry) → None

Examples using habit.contracts.ArrayImageRef

Load from NumPy arrays

Load from NumPy arrays