fast-regionprops
A faster (vectorized) version of regionprops that supports a subset of
region-property features, yielding a typical ~10-80× speedup (especially for many regions).
Can be used as a drop-in replacement for skimage.measure.regionprops_table for the following
set of properties:
label, area, centroid, bbox, equivalent_diameter_area,
intensity_mean, intensity_min, intensity_max, intensity_std,
inertia_tensor, border_dist
| Dim | Image size | #Regions | skimage (ms) | fast (ms) | Speedup |
|---|---|---|---|---|---|
| 2D | 512×512 | 100 | 10.5 | 0.4 | 26.8× |
| 2D | 512×512 | 400 | 40.8 | 0.5 | 77.8× |
| 2D | 1024×1024 | 1600 | 163.1 | 2.0 | 82.8× |
| 2D | 2048×2048 | 3600 | 368.7 | 6.5 | 57.0× |
| 3D | 128×128×128 | 512 | 76.5 | 3.3 | 23.5× |
| 3D | 256×256×256 | 1728 | 229.6 | 19.6 | 11.7× |
Install
pip install fast-regionprops
# dev / tests
pip install -e ".[test]"
# dev / tests / pre-commit
pip install -e ".[dev]"
pre-commit install
Usage
import numpy as np
from skimage.data import binary_blobs
from skimage.measure import label
from fast_regionprops import regionprops_table_fast
# example data: blobs as mask, random image as intensity
mask = label(binary_blobs(length=512, blob_size_fraction=0.05, volume_fraction=0.1))
intensity = np.random.default_rng(0).random(mask.shape).astype("float32")
# drop-in for skimage.measure.regionprops_table (same column names)
table = regionprops_table_fast(
mask,
intensity,
properties=("label", "area", "centroid", "intensity_mean", "inertia_tensor"),
)
table["centroid-0"], table["inertia_tensor-0-1"] # 1D arrays, one row per label
Output is a dict[str, np.ndarray] (same as for skimage.measure.regionprops_table)
Property notes
-
Calling
regionprops_table_fast(label_image)uses the same default properties asskimage.measure.regionprops_table:labelandbbox. -
label_imagemust be an integer 2D or 3D label image. Boolean and floating point inputs are rejected as ambiguous; labels<= 0are ignored. -
intensity_imagemay have the same shape aslabel_image, or one extra trailing channel axis. Multichannel intensity columns follow skimage naming, for exampleintensity_mean-0,intensity_mean-1. -
border_distis an extra property (not in skimage): the minimum pixel distance from each label to any image border. The per-axis distances are returned asborder_dist-0,border_dist-1, and, for 3D images,border_dist-2. -
properties needing a convex hull / perimeter / topology (
solidity,perimeter,euler_number, etc.) are not yet supported.
License
BSD-3-Clause.
Metadata
Release files for fast-regionprops 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fast_regionprops-0.2.0.tar.gz | 11.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fast_regionprops-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.8 kB
Release files / fast_regionprops-0.2.0.tar.gz
| Download URL | fast_regionprops-0.2.0.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
058958e227eae053c389a3d007a75de03587c78756dfccf1b11e58e087e12d98
|
|
BLAKE2b-256 checksum How to use checksums |
9d256b5f2e50cbdd7c92a4cbf32b8974065d44f70ab4dfde43ada13cc986afc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency logRelease files / fast_regionprops-0.2.0-py3-none-any.whl
| Download URL | fast_regionprops-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
afa9e96871d3de56c55c90d47563f85d0fa7990668ce33aeeea7189290535ca0
|
|
BLAKE2b-256 checksum How to use checksums |
5004b0f4d0d908e1e833ba694850349e31337e1a0d4eabc15b568d74b0ab588c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.
Transparency log