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.
  • 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.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bioimageflow_segmentation_tools-0.2.0.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bioimageflow_segmentation_tools-0.2.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file bioimageflow_segmentation_tools-0.2.0.tar.gz.

File metadata

  • Download URL: bioimageflow_segmentation_tools-0.2.0.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for bioimageflow_segmentation_tools-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ce6e95c74a199d57740d91c6bcd45a06f5791c00821bd06bfe32e4d14d27222b
MD5 11c829db62b612fb4296b6f54a48daee
BLAKE2b-256 94f492172a12cbe387fcc588fa9504442a3f34b72c49057aa0db979082bdacbc

See more details on using hashes here.

File details

Details for the file bioimageflow_segmentation_tools-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: bioimageflow_segmentation_tools-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for bioimageflow_segmentation_tools-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02753c75aa8bb6c37146e63891683189badfa4d1847d8b16cc52dd5e42f91e61
MD5 83a22e5d813a532c8d02dc1eafc1f195
BLAKE2b-256 f8a1c4f586a391697112c5b9f292bc04141a9493b63781d8313f20e915abb9cf

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.6

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page