Registry / ai-ml / histomicstk

histomicstk

JSON →
library1.4.0pypypiunverified

HistomicsTK is a Python toolkit for histopathology image analysis, providing algorithms for segmentation, feature extraction, and classification of whole-slide images. Current version is 1.4.0, with a release cadence of approximately 2-3 months.

pip install histomicstk
INSTALL
IMPORT
SIG · HISTOMICSTK
H
histomicstk
ai-mlpythonv1.4.0
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

histomicstk
import histomicstk as htk
import HistomicsTK
Case-sensitive; package is lowercase
segmentation.nuclear_segmentation
from histomicstk.segmentation import nuclear_segmentation
from histomicstk.segmentation.nuclei import nuclear_segmentation
Old path deprecated; use nuclear_segmentation submodule
features.compute_haralick_features
from histomicstk.features import compute_haralick_features
from histomicstk.features.haralick import compute_haralick_features
Haralick features moved to top-level features module in v1.4.0

Basic example of computing Haralick features from a 2D image. For whole-slide images, you need to install 'large_image' and use it to read tiles.

import histomicstk as htk import numpy as np # Load a sample image (replace with your own) # For whole-slide images, use large_image # Here we simulate a 2D grayscale image image = np.random.rand(100, 100).astype(np.float32) # Compute Haralick texture features from histomicstk.features import compute_haralick_features haralick = compute_haralick_features(image, return_labels=True) print(haralick['Harmonic mean']) # Nuclear segmentation (requires stain normalization first) from histomicstk.segmentation import nuclear_segmentation # nuclei_df, nuclei_im = nuclear_segmentation.nuclei_segmentation(image) # requires proper staining
histomics --version
Debug
Known issues
breakingIn v1.4.0, Python 3.8 support was dropped. You must use Python >=3.9.
fix
Upgrade Python to 3.9+ or pin histomicstk to <1.4.0.
affects: >=1.4.0
deprecatedDirect import of submodules like histomicstk.features.haralick is deprecated. Use histomicstk.features instead.
fix
Update imports to use top-level module: from histomicstk.features import compute_haralick_features
affects: >=1.4.0
gotchacompute_haralick_features expects float32 image in [0,1] range. Passing integer or unnormalized images yields incorrect results.
fix
Normalize image: image = image.astype(np.float32) / 255.0
affects: all
gotchaNuclear segmentation functions require stain normalization (e.g., Reinhard) before use. Skipping this step leads to poor segmentation.
fix
Use histomicstk.preprocessing.color_normalization.reinhard first.
affects: all
Upgrade
Version history
1.4.0latest on PyPI · released Feb 7, 2025
Audit
Dependencies
large_imageoptionalFor reading whole-slide images (openslide, DICOM, etc.)
numpyrequiredCore numerical computation
scikit-imagerequiredImage processing algorithms
pandasrequiredDataFrame operations for features
shapelyrequiredGeometric operations for annotations
Agent activity
10 hits · last 30 days
node
10
Resources
histomicstk — pip install histomicstk · libregistry