LocalEntropyVoxelFeatures
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 LocalEntropyVoxelFeatures(modalities: Sequence[str] = (), roi: str | None = None, kernel_size: int = 3, bins: int = 32, modality: str | None = None, as_: str | None = None)[source]
Bases:
objectShannon entropy of each voxel’s intensity neighbourhood.
Where raw intensity says how bright a voxel is, local entropy says how disordered its surroundings are, which separates homogeneous tissue from structurally mixed tissue at the same intensity. The entropy map is computed over the whole image and then restricted to the ROI, exactly as in v0.1, so voxels at the ROI border still see their true neighbourhood.
- Parameters:
modality – Single modality key – the explicit form used inside feature trees. Mutually exclusive with
modalities.modalities – Modality keys to describe, in feature order; empty selects every image the subject carries.
as – Optional output-column alias. Valid only with exactly one resolved modality; the column suffix then uses the alias.
roi – Mask key defining the region of interest;
Noneuses the subject’s single mask.kernel_size – Neighbourhood edge length in voxels. Even values are incremented to keep the neighbourhood centred, as in v0.1.
bins – Histogram bins used to discretise intensities.
- __init__(modalities: Sequence[str] = (), roi: str | None = None, kernel_size: int = 3, bins: int = 32, modality: str | None = None, as_: str | None = None) None[source]
- __call__(subject: Subject) VoxelFeatureField[source]
Compute per-voxel local entropy for one subject.
- Parameters:
subject – Subject providing the requested modalities and mask.
- Returns:
One row per ROI voxel, one
local_entropy-{source}column per modality, wheresourceis theas_alias when given, else the modality name.- Raises:
GeometryError – If a modality and the mask are on different grids.
HABITAPIError – If a requested modality is absent.
Examples using habit.voxel_features.LocalEntropyVoxelFeatures
/auto_examples/04_habitat_maps/plot_07_voxel_texture
/auto_examples/04_habitat_maps/plot_09_texture_habitats