MeanVoxelFeatures

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 MeanVoxelFeatures(field: VoxelFeatureField | None = None)[source]

Bases: object

Describe each supervoxel by the mean of the voxel features within it.

The v0.1 default (supervoxel_level: {method: mean_voxel_features()}) and the summary every built-in supervoxelizer already attaches. It exists as a registered component for two reasons: a study can state its choice explicitly instead of relying on a default, and a partition obtained from elsewhere (a saved label map, a third-party segmenter) can be described without re-running the supervoxelization.

Voxel features are not recoverable from a Supervoxelization alone, so the field that produced the partition must be supplied at construction time when calling this extractor standalone. Constructed without one, it returns the partition’s existing features unchanged, which is the idempotent behaviour a pipeline needs when the user names the default explicitly.

Parameters:

field – Voxel features to aggregate. Optional; see above.

__init__(field: VoxelFeatureField | None = None) → None[source]
property spec: Spec

Return the algorithm specification.

__call__(subject: Subject, partition: Supervoxelization) → Supervoxelization[source]

Recompute per-supervoxel means over the partition’s regions.

Parameters:
  • subject – Unused; means need no intensity access beyond the voxel features already computed. The parameter is part of the protocol so every extractor is interchangeable.

  • partition – The subject’s supervoxel partition.

Returns:

The partition with mean features attached.