EachHabitatRadiomicsFeatures

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 EachHabitatRadiomicsFeatures(params_file: str | None = None, params: Dict[str, Any] | None = None, modalities: Sequence[str] | None = None, modality: str | None = None, as_: str | None = None, use_torch_radiomics: str | bool = False, torch_device: str = 'auto', torch_dtype: str = 'float64')[source]

Bases: object

PyRadiomics features of the raw image(s) within each habitat label.

This is the v1 form of the v0.1 each_habitat feature type: for every habitat id the model can assign, PyRadiomics runs on each raw modality with the multi-label habitat map as mask and the habitat id as label, replicating HabitatRadiomicsExtractor.extract_radiomics_features_from_each_habitat (mask-metadata harmonisation included).

Where v0.1 wrote one CSV per habitat plus a habitat_count.csv, the v1 single-row table carries everything at once:

  • has_habitat_{id} – 1.0 when the habitat is present in this subject, else 0.0 (the v0.1 habitat-count semantics);

  • habitat_{id}_{feature}_of_{modality} – one column per PyRadiomics feature, NaN when the habitat is absent (NaN is the honest “not measured”; zero would be a fabricated measurement).

Columns and their order are canonical for a given extractor configuration – every subject of the same model yields the same layout regardless of which habitats it contains. A subject whose map has no habitat label at all yields only the has_habitat_* columns.

Extraction is one multi-label pass per modality (union-bbox crop, then per-habitat _applyBinning + native C matrices). binWidth gray levels stay per-habitat, matching execute(label=id). Torch is off unless the caller sets use_torch_radiomics.

__init__(params_file: str | None = None, params: Dict[str, Any] | None = None, modalities: Sequence[str] | None = None, modality: str | None = None, as_: str | None = None, use_torch_radiomics: str | bool = False, torch_device: str = 'auto', torch_dtype: str = 'float64') → None[source]
property spec: Spec

Return the algorithm specification.

__call__(subject: Subject, habitat_map: HabitatMap) → FeatureTable[source]

Compute the per-habitat radiomics family for one subject.

Parameters:
  • subject – Owning subject; every selected modality is extracted.

  • habitat_map – Habitat labels; used as the multi-label mask.

Returns:

One-row table of per-habitat radiomics plus presence indicators.

Examples using habit.habitat_features.EachHabitatRadiomicsFeatures

Per-habitat radiomics

Per-habitat radiomics