Skip to main content

Standalone pythomics feature extraction

Extract per-object lumen and epithelium measurements and block-summed density maps from an integer label-map image. This folder is self-contained and does not import the repository's model/inference code.

Install

From this directory, install the listed dependencies into your environment:

python -m pip install -r requirements.txt

Image readers are provided by scikit-image. Install glymur (python -m pip install glymur) to enable multi-threaded JPEG2000 decoding; otherwise JPEG2000 files use the scikit-image reader. Object-level tables are Parquet, density arrays are compressed NPZ, and MAT output is optional.

CLI

Run from the repository root:

python -m pythomics_standalone path/to/labels.png --output-dir output --save-mat

To regenerate a MAT file using an existing label map and object tables:

python -m pythomics_standalone path/to/labels.png \
  --lumen-parquet output/labels_lumen.parquet \
  --epithelium-parquet output/labels_epithelium.parquet \
  --output-dir output

The default label values are lumen=1, epithelium=2, stroma=4, epithelial-cells=5, stromal-cells=6. Override with --lumen-label, --epithelium-label, --stroma-label, --epithelial-cells-label, and --stromal-cells-label. --min-area sets the minimum connected component size in source pixels (default 2048); --block-size HEIGHT WIDTH sets density aggregation blocks (default 20 20).

Epithelium regions include both epithelium and epithelial-cell pixels. Stroma density includes stromal-cell pixels. Connected components are labeled independently in each tissue mask. Tables contain source-pixel area, circularity (roundness), and for epithelium average skeleton thickness and epithelial-cell fraction. Density NPZ arrays are block sums, with edge blocks padded with zeros. MAT density maps are block sums; per-object maps at density resolution are pixel-area-weighted means of the feature values for included objects in each block, excluding background and regions filtered out by --min-area. --save-full-mat writes those per-object maps at source-pixel resolution instead.

Outputs are <input-stem>_lumen.parquet, <input-stem>_epithelium.parquet, and <input-stem>_densities.npz; with --save-mat, also <input-stem>_features.mat at density (block) resolution, or full resolution with --save-full-mat. To build a MAT file from an existing label map and tables, pass --lumen-parquet and --epithelium-parquet. -j/--jobs sets worker threads for JPEG2000 decoding and large-image mask, density, component-labeling, and feature-map calculations (default: up to 12 CPUs); specify a higher value to use more.

Metadata

Release files for lavlab-pythomics 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lavlab-pythomics 0.2.1
File Size Uploaded Provenance Actions
lavlab_pythomics-0.2.1.tar.gz 24.0 kB With provenance Details for lavlab_pythomics-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lavlab-pythomics 0.2.1
File Interpreter ABI Platform Actions
lavlab_pythomics-0.2.1-py3-none-any.whl Python 3 none any Details for lavlab_pythomics-0.2.1-py3-none-any.whl

Total release size: 36.5 kB

Release files / lavlab_pythomics-0.2.1.tar.gz

Download URL lavlab_pythomics-0.2.1.tar.gz
Size 24.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4b8aa62ac9ed49207563ea90e4da1bfa84f56aabeddfcf7aa48a7eea04b8b468
BLAKE2b-256 checksum
How to use checksums
ca648cf0fd66a45ec37a9c1c33d2081835be23f38df872b1d2290eed1c27ce2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / lavlab_pythomics-0.2.1-py3-none-any.whl

Download URL lavlab_pythomics-0.2.1-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f550efa4c7c2ca15e1c4f90d41b70d936852cc203b6f81cdc417015b10c0e2f
BLAKE2b-256 checksum
How to use checksums
32790fa543c512636ac0407e248a880117d2ecc745e26a3733b3692d0287a344
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Security for lavlab-pythomics 0.2.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lavlab_pythomics-0.2.1.tar.gz

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 Oct 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page