特征提取

特征提取器

Mean Voxel Features

class habit.core.habitat_analysis.extractors.mean_voxel_features_extractor.MeanVoxelFeaturesExtractor(**kwargs: Any)[源代码]

Extract mean voxel features for each supervoxel in the supervoxel map

This extractor calculates the mean values of voxel features within each supervoxel. It's a simpler alternative to radiomics features, just using the average values.

__init__(**kwargs: Any) None[源代码]

Initialize mean voxel features extractor

参数:

**kwargs -- Additional parameters

extract_features(image_data: str | Image, supervoxel_map: str | Image, **kwargs: Any) DataFrame[源代码]

Extract mean voxel features for each supervoxel

参数:
  • image_data -- Path to image file, SimpleITK image object, or DataFrame of voxel features

  • supervoxel_map -- Path to supervoxel map file or SimpleITK image object

  • **kwargs -- Additional parameters

返回:

DataFrame with mean voxel features for each supervoxel

返回类型:

pd.DataFrame

get_feature_names() List[str][源代码]

Get feature names

返回:

List of feature names

返回类型:

List[str]

Kinetic Features

class habit.core.habitat_analysis.extractors.kinetic_feature_extractor.KineticFeatureExtractor(timestamps: str | None = None, **kwargs: Any)[源代码]

Kinetic Feature Extractor

Extracts dynamic features based on time-series images, such as enhancement rate, peak enhancement, etc.

__init__(timestamps: str | None = None, **kwargs: Any) None[源代码]

Initialize the kinetic feature extractor

参数:
  • timestamps (str, optional) -- Path to timestamp file containing acquisition time for each image

  • **kwargs -- Other parameters to be passed to the parent class

extract_features(image_data: ndarray, **kwargs: Any) ndarray[源代码]

Extract kinetic features

参数:
  • image_data (dict) -- Dictionary of image data with keys as image names and values as 2D arrays [n_voxels, n_features]

  • **kwargs -- Other parameters such as timestamps, subject, etc.

返回:

Feature matrix with shape [n_voxels, n_features]

返回类型:

np.ndarray

get_feature_names() List[str][源代码]

Get feature names

返回:

List of feature names

返回类型:

List[str]

Local Entropy Features

class habit.core.habitat_analysis.extractors.local_entropy_extractor.LocalEntropyExtractor(**kwargs)[源代码]

Extract voxel-level local entropy features from image within mask region Local entropy is a measure of the randomness in the local neighborhood of a voxel

__init__(**kwargs)[源代码]

Initialize local entropy feature extractor

参数:

**kwargs -- Additional parameters including: - kernel_size: Size of the local neighborhood kernel (default: 3) - bins: Number of bins for histogram calculation (default: 32)

extract_features(image_data: str | Image, mask_data: str | Image, **kwargs) DataFrame[源代码]

Extract local entropy features from image within mask region

参数:
  • image_data -- Path to image file or SimpleITK image object

  • mask_data -- Path to mask file or SimpleITK mask object

  • **kwargs -- Additional parameters: - kernel_size: Size of the local neighborhood kernel - bins: Number of bins for histogram calculation

返回:

DataFrame with local entropy values for each voxel in the mask

返回类型:

pd.DataFrame

get_feature_names() List[str][源代码]

Get feature names

返回:

List of feature names

返回类型:

List[str]

Voxel Radiomics Features

class habit.core.habitat_analysis.extractors.voxel_radiomics_extractor.VoxelRadiomicsExtractor(**kwargs)[源代码]

Extract voxel-level radiomics features from image within mask region using PyRadiomics' voxel-based extraction

__init__(**kwargs)[源代码]

Initialize voxel-level radiomics feature extractor

参数:

**kwargs -- Additional parameters

extract_features(image_data: str | Image, mask_data: str | Image, **kwargs) DataFrame[源代码]

Extract voxel-level radiomics features from image within mask region

参数:
  • image_data -- Path to image file or SimpleITK image object

  • mask_data -- Path to mask file or SimpleITK mask object

  • **kwargs -- Additional parameters subj: subject name img_name: Name of the image to append to feature names

返回:

Extracted voxel-level radiomics features

返回类型:

pd.DataFrame

get_feature_names() List[str][源代码]

Get feature names

返回:

List of feature names

返回类型:

List[str]

Supervoxel Radiomics Features

class habit.core.habitat_analysis.extractors.supervoxel_radiomics_extractor.SupervoxelRadiomicsExtractor(params_file: str | None = None, **kwargs)[源代码]

Extract radiomics features for each supervoxel in the supervoxel map

__init__(params_file: str | None = None, **kwargs)[源代码]

Initialize supervoxel radiomics feature extractor

参数:
  • params_file -- Path to PyRadiomics parameter file or YAML string containing parameters

  • **kwargs -- Additional parameters

extract_features(image_data: str | Image, supervoxel_map: str | Image, config_file: str | None = None, **kwargs) DataFrame[源代码]

Extract radiomics features for each supervoxel in the supervoxel map

参数:
  • image_data -- Path to image file or SimpleITK image object

  • supervoxel_map -- Path to supervoxel map file or SimpleITK image object

  • config_file -- Path to PyRadiomics parameter file (overrides the one in constructor)

  • **kwargs -- Additional parameters

返回:

DataFrame with radiomics features for each supervoxel

返回类型:

pd.DataFrame

get_feature_names() List[str][源代码]

Get feature names

返回:

List of feature names

返回类型:

List[str]

自定义特征提取器