scip.features package#

scip.features.compute_features(images, channel_names, types, loader_meta, prefix)#
scip.features.extract_features(*, images: Bag, channel_names: list, types: list, loader_meta: Mapping[str, type] | None = {}) DataFrame#

Extracts requested features from pixel values in images.

Keyword Arguments:
Returns:

dataframe containing all extracted features (columns) for all

images (rows) in the input bag.

scip.features.features_partition(part: Iterable[dict], *, loader_meta_keys: Iterable[str], types: Iterable[str], lengths: Mapping[str, int])#

Submodules#

scip.features.bbox module#

scip.features.bbox.bbox_features(p: Mapping) Mapping[str, Any]#

Extracts bbox features from image.

The bbox consist of four values: bbox_minr, bbox_minc, bbox_maxr, bbox_maxc.

Parameters:

p – Contains a sequence of 4 numbers under key bbox.

Returns:

Extracted features.

scip.features.intensity module#

scip.features.intensity.intensity_features(pixels: ndarray, mask: ndarray, combined_mask: ndarray, background: ndarray, combined_background: ndarray) ndarray#

Compute intensity features.

Find following intensity features based on masked pixel values:
  • ‘mean’,

  • ‘max’,

  • ‘min’,

  • ‘var’,

  • ‘mad’,

  • ‘skewness’,

  • ‘kurtosis’,

  • ‘sum’,

  • ‘modulation’

The features are computed on 8 different views on the pixel data:
  1. Raw values of channel specific mask

  2. Background substracted values of channel specific mask

  3. Edge values of channel specific mask

  4. Background substracted edge values of channel specific mask

  5. Raw values of union of masks

  6. Background substracted values of union of masks

  7. Edge values of union of masks

  8. Background substracted edge values of union of masks

Parameters:

sample (Mapping) – mapping with pixels, mask, combined_mask, background and combined background keys.

Returns:

extracted features

Return type:

Mapping[str, Any]

scip.features.raw_intensity module#

scip.features.raw_intensity.raw_intensity_features(pixels: ndarray) ndarray#

Compute intensity features.

Find following intensity features based on masked pixel values:
  • ‘mean’,

  • ‘max’,

  • ‘min’,

  • ‘var’,

  • ‘mad’,

  • ‘skewness’,

  • ‘kurtosis’,

  • ‘sum’,

  • ‘modulation’

The features are computed on raw values of channel

Parameters:

sample (Mapping) – mapping with pixels

Returns:

extracted features

Return type:

Mapping[str, Any]

scip.features.shape module#

scip.features.shape.shape_features(mask: ndarray, combined_mask: ndarray, image: ndarray) ndarray#

Extracts shape features from image.

The shape features are extracted using :func:regionprops from scikit-image. These include features like eccentricity, convex area or equivalent diameter.

Parameters:

sample (Mapping[str, Any]) – mapping with mask and combined mask keys.

Returns:

extracted shape features.

Return type:

Mapping[str, Any]

scip.features.texture module#

scip.features.texture.texture_features(sample: Mapping[str, Any])#

Extracts texture features from image.

Texture features are computed based on the gray co-occurence level matrix and sobel map. From the former, a contrast, dissimilarity, homogeneity, energy, correlation and ASM metric is computed. From the latter, mean, standard deviation, maximum and minimum values are computed.

Features are not computed on background-substracted values (as in :func:scip.features.intensity.intensity_features), because all features are computed on relative changes of neighbouring pixels; a substraction does not influence these values.

Parameters:

sample (Mapping[str, Any]) – mapping with pixels, mask and combined mask keys.

Returns:

extacted features.

Return type:

Mapping[str, Any]