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.

Heavy model dependencies are declared in isolated EnvironmentSpec objects and imported only inside process_row. Importing this package does not require Cellpose, TensorFlow, StarDist, or other model packages to be installed 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.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 bioimageflow-segmentation-tools 0.3.1
File Size Uploaded
bioimageflow_segmentation_tools-0.3.1.tar.gz 32.2 kB Details

Built distribution (wheel)

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

Total release size: 58.8 kB

Release files / bioimageflow_segmentation_tools-0.3.1.tar.gz

Download URL bioimageflow_segmentation_tools-0.3.1.tar.gz
Size 32.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e7c724fc900296a87bbc660eab1e92daa16a25df717a0344f7547205e34bdb48
BLAKE2b-256 checksum
How to use checksums
564c0776c7116760982782399ba125a5375a5863544beb9adf06c64058e7cd32
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.1-py3-none-any.whl

Download URL bioimageflow_segmentation_tools-0.3.1-py3-none-any.whl
Size 26.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7126a5eb8595354034093828f953a66f3596f4f0ac71ba8ab315282b9ca1e421
BLAKE2b-256 checksum
How to use checksums
14c1afa3320c75a1a1f24d1a4236c5c4ca26fc8818db8abc3b89377604517fa5
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

0.3.2

2 release files

This release

0.3.1 This release

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