build_voxel_field

Note

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

build_voxel_field(subject: Subject, mask: ImageVolume, voxel_index: ndarray, feature_names: Sequence[str], values: ndarray, spec: Spec) → VoxelFeatureField[source]

Assemble a VoxelFeatureField with provenance for one subject.

Parameters:
  • subject – Subject the features describe.

  • mask – ROI mask defining the field’s geometry.

  • voxel_index – ROI voxel coordinates, matching values row order.

  • feature_names – Column names, in column order.

  • values – Voxel-by-feature matrix.

  • spec – The extractor’s specification, recorded in provenance.

Returns:

The per-voxel feature field.

Raises:

HABITAPIError – If values does not describe every ROI voxel with one column per feature name.

Examples using habit.voxel_features.build_voxel_field

Custom features

Custom features