stlearn.pp.extract_feature¶
- stlearn.pp.extract_feature(adata: AnnData, cnn_base: Literal['resnet50', 'vgg16', 'inception_v3', 'xception'] = 'resnet50', n_components: int = 50, seeds: int = 1, verbose: bool = False, copy: bool = False) AnnData | None[source]¶
Extract latent morphological features from H&E images using pre-trained convolutional neural network base
- Parameters:
adata – Annotated data matrix.
cnn_base – Established convolutional neural network bases choose one from [‘resnet50’, ‘vgg16’, ‘inception_v3’, ‘xception’]
n_components – Number of principal components to compute for latent morphological features
seeds – Fix random state
verbose – Verbose output
copy – Return a copy instead of writing to adata.
- Returns:
Depending on copy, returns or updates adata with the following fields.
**X_morphology** (adata.obsm field) – Dimension reduced latent morphological features.
- Raises:
ValueError – If any image fails to process or if tile_path column is missing.