SupervoxelRadiomicsFeatures

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 SupervoxelRadiomicsFeatures(modality: str | None = None, modalities: Sequence[str] = (), as_: str | None = None, params_file: str | None = None, params: Dict[str, Any] | None = None, supervoxel_batch: int = 64, supervoxel_union_bbox_crop: bool = True, supervoxel_pad_distance: int | None = None, use_supervoxel_cext: str | bool = True, union_bin: bool = False, use_torch_radiomics: str | bool = 'auto', torch_device: str = 'auto', torch_dtype: str = 'float64', output_float32: bool = True)[source]

Bases: object

Describe each supervoxel by PyRadiomics features of the original images.

One extraction pass runs per modality and the resulting columns are suffixed with -{modality}, which is the v0.1 column scheme for concat(supervoxel_radiomics(m1), supervoxel_radiomics(m2)). All modalities of a subject are used when none are named.

The single-modality form modality="T1" is the tree-friendly alternative to modalities=["T1"]; as_ renames the column suffix so the same modality can be extracted under two parameter sets without a name clash.

Parameters:
  • modality – Single modality name; mutually exclusive with modalities.

  • modalities – Modality names to extract from; empty selects all the subject carries.

  • as – Alias used as the column suffix instead of the modality name; requires modality.

  • params_file – Path to a PyRadiomics parameter YAML, or None for PyRadiomics defaults.

  • params – Inline PyRadiomics settings mapping, for API users holding settings in memory. Mutually exclusive with params_file.

  • supervoxel_batch – Labels processed per batch. Larger batches trade memory for speed and never change the numbers.

  • supervoxel_union_bbox_crop – Crop image and masks to the bounding box of the union of all supervoxels before extraction.

  • supervoxel_pad_distance – Padding around that bounding box; None keeps the PyRadiomics padDistance setting.

  • use_supervoxel_cext – True (default), "auto", or False – whether to use the habit native C extension for texture matrices.

  • union_bin – When False (default) each supervoxel is discretized with its own binWidth edges, matching PyRadiomics execute(). When True, all labels share one union-mask bin.

  • use_torch_radiomics – "auto", True or False – whether to use the TorchRadiomics GPU path when torch and CUDA are present.

  • torch_device – Torch device string, or "auto" to select one.

  • torch_dtype – "float64" (default) or "float32" for the torch path.

  • output_float32 – Downcast the resulting feature columns to float32, the v0.1 default that keeps large supervoxel tables manageable.

__init__(modality: str | None = None, modalities: Sequence[str] = (), as_: str | None = None, params_file: str | None = None, params: Dict[str, Any] | None = None, supervoxel_batch: int = 64, supervoxel_union_bbox_crop: bool = True, supervoxel_pad_distance: int | None = None, use_supervoxel_cext: str | bool = True, union_bin: bool = False, use_torch_radiomics: str | bool = 'auto', torch_device: str = 'auto', torch_dtype: str = 'float64', output_float32: bool = True) → None[source]
property spec: Spec

Return the algorithm specification.

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

Compute per-supervoxel radiomics for one subject.

Parameters:
  • subject – Subject supplying the original intensity images.

  • partition – The subject’s supervoxel partition.

Returns:

The partition carrying one radiomics feature vector per supervoxel, across every requested modality.

Raises:

HABITAPIError – If a requested modality is absent or the partition holds no supervoxel.

Examples using habit.supervoxel.SupervoxelRadiomicsFeatures

Supervoxel feature extraction and acceleration

Supervoxel feature extraction and acceleration