extract_voxel_texture
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.
- extract_voxel_texture(image: ImageVolume, mask: MaskVolume, *, kernel_radius: int = 3, bin_width: float = 12.0, feature_classes: Mapping[str, Sequence[str]] | None = None, params: Dict[str, Any] | None = None, voxel_batch: int | str = 1000, use_torch_radiomics: str | bool = 'auto', use_gpu_matrices: str | bool = 'auto') VoxelFeatureField[source]
Extract a per-voxel texture table from one image and one mask.
This is the atomic teaching / experiment call. Paper combinations are repeated calls on the same volumes with different knobs, for example
kernel_radius=1vskernel_radius=3(R1 vs R3) orbin_width=12vsbin_width=25(B12 vs B25). The returnedVoxelFeatureFieldis the input toprecision_panel().- Parameters:
image – Intensity volume.
mask – ROI mask; one row is emitted per foreground voxel.
kernel_radius – Neighbourhood radius in voxels (the paper’s
R). Must be a positive int. Radius 1 is 3x3x3; radius 3 is 7x7x7. Default 3.bin_width – Grey-level discretisation width (the paper’s
B). Must be a positive float. Typical CT pair is 12 vs 25 HU. Default 12.0.feature_classes – Optional PyRadiomics class-to-names map, e.g.
{"firstorder": ["Entropy", "Mean"], "glcm": ["Contrast"]}. Default None (bundled voxel preset, unlessparamsis set).params – Full in-memory PyRadiomics settings. Default None. Mutually exclusive with
feature_classes.bin_widthstill overwritessetting.binWidth.voxel_batch – ROI voxels per batch. Allowed: positive int or
"auto"(size from VRAM). Default 1000.use_torch_radiomics – Allowed
"auto",True, orFalse. Default"auto".use_gpu_matrices – Allowed
"auto",True, orFalse. Default"auto". GPU matrices stay bit-identical to CPU.
- Returns:
One row per ROI voxel, one column per enabled feature. Provenance carries the extractor
Spec.- Raises:
HABITAPIError – When
feature_classesandparamsare both set, orkernel_radiusis not positive.
See also
habit.voxel_features.VoxelRadiomicsFeaturesSubject-level extractor this function constructs for one image/mask pair.