Skip to main content

bioimageflow-segmentation-tools

Segmentation-focused tool package for BioImageFlow.

Tools

  • Cellpose3: Cellpose v3 pretrained model wrapper.
  • CellposeSAM: Cellpose-SAM pretrained model wrapper.
  • StarDistSegmenter: StarDist 2D pretrained model wrapper.
  • InstanSegSegment: selected-target nuclei or cell segmentation with named or local InstanSeg models.
  • Nagini3DSegment: volumetric NAGINI-3D segmentation with probability, parametric surfaces, and curvature outputs.
  • ThresholdSegment: threshold an intensity image and label connected foreground objects.
  • OtsuThresholdSegment: compute a global Otsu threshold and label foreground objects.
  • LocalThresholdSegment: compute a Sauvola local threshold and label foreground objects.
  • WatershedSegment: split foreground regions from marker labels or connected components.
  • DistanceWatershedSegment: split foreground with marker-free distance-transform watershed.
  • SplitTouchingObjects: split clumped labels using distance-transform watershed.
  • FilterLabels: remove labels by area, border contact, intensity, and shape constraints.
  • PostprocessLabels: remove small labels and relabel label images sequentially.

Classical connected-component tools use face connectivity by default and treat image > threshold as foreground when above is enabled. Label inputs are validated as finite, integral, non-negative arrays, and object counts are based on distinct positive IDs rather than the largest ID. Default label-output paths use TIFF rather than inheriting an input extension that may be lossy or unable to store UInt32 label IDs.

Package discovery requires only bioimageflow-core. Classical image dependencies and heavy model dependencies are declared in worker EnvironmentSpec objects and imported only inside process_row. Importing this package does not require ImageIO, NumPy, SciPy, scikit-image, Cellpose, TensorFlow, StarDist, or other model packages in the main process. Cellpose3, CellposeSAM, and StarDistSegmenter lazily keep one model per worker-side tool instance. Repeated calls with the same model selection reuse the weights; changing model_type or model_name replaces the cached model, and clear_model_cache() releases it explicitly. Applications can invalidate remote worker caches by stopping the corresponding Wetlands environment.

NAGINI-3D license boundary

Nagini3DSegment installs and executes the third-party nagini3D runtime, which is distributed under AGPL-3.0. The BioImageFlow wrapper remains BSD-4-Clause, but downstream distributors must review and comply with NAGINI-3D's license before publishing an environment or product containing that runtime. NAGINI model weights and datasets are not bundled in this package.

The former nnInteractive wrapper was removed because nnInteractive requires a stateful volumetric inference session; its public point-list-to-2D-mask contract did not represent the upstream API.

Example

from bioimageflow_core import Arguments
from bioimageflow_segmentation_tools import ThresholdSegment

segment = ThresholdSegment()
result = segment.process_row(
    Arguments(
        input_image="input.tif",
        threshold=128.0,
        labels="labels.tif",
        above=True,
    )
)

Workflow graph construction with segment(...) requires installing the main-process bioimageflow orchestrator alongside this package.

Metadata

Release files for bioimageflow-segmentation-tools 0.3.2

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

Source distribution (sdist)

Source distribution for bioimageflow-segmentation-tools 0.3.2
File Size Uploaded
bioimageflow_segmentation_tools-0.3.2.tar.gz 35.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bioimageflow-segmentation-tools 0.3.2
File Interpreter ABI Platform
bioimageflow_segmentation_tools-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 63.3 kB

Release files / bioimageflow_segmentation_tools-0.3.2.tar.gz

Download URL bioimageflow_segmentation_tools-0.3.2.tar.gz
Size 35.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c03c581b0b3f44a77a85c03710a4faf11b9526fbc2b3d2b214e384b4d0e9dfac
BLAKE2b-256 checksum
How to use checksums
852988a104223a741d598458230d264ad0433c455ea56fe8b154bccbd46a0993
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / bioimageflow_segmentation_tools-0.3.2-py3-none-any.whl

Download URL bioimageflow_segmentation_tools-0.3.2-py3-none-any.whl
Size 27.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6477df5d3d8a554bdd7377e901386ba6b5d291ba0cc0c4aacd32b7328be22098
BLAKE2b-256 checksum
How to use checksums
2780a8ef9df2ac20859c8e96f900fcdcaee5b17b2c859f9849c8f97c8ffa5a35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

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