ImageRef

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 ImageRef(*args, **kwargs)[source]

Bases: Protocol

Lazy handle to volumetric data.

Operators always receive an ImageRef and decide when to materialise it, which means:

  • small cohorts can stay fully in memory and compose freely;

  • large cohorts pass lightweight handles across process boundaries;

  • third parties can back a subject with PACS, zarr, a torch tensor, or an in-memory array by implementing this protocol alone.

ImageVolume / MaskVolume below are the already-materialised counterparts and satisfy this protocol structurally (load() returning their own array).

property geometry: Geometry

Return grid definition without materialising voxel data.

load() → ndarray[source]

Materialise and return the voxel array.

__init__(*args, **kwargs)