Skip to main content

Pluggable supervoxel splitting algorithms with a uniform interface.

Project description

supervoxel-splitter

codecov

Pluggable supervoxel-splitting algorithms behind a uniform Splitter interface.

What it does

Given a 3-D foreground mask, source seeds, and sink seeds, return a labeled volume that partitions the foreground into a source side and a sink side. Useful for proofreading workflows that need to split a single supervoxel without touching the rest of the segmentation.

The package ships multiple techniques behind the same Splitter protocol:

  • GeodesicSplitter — anisotropic geodesic carve via an EDT-derived speed field. Default technique; preserves the neck-aware behavior used in PyChunkedGraph today.
  • WatershedSplitter — seeded watershed on the distance transform.
  • NoopSplitter — reference implementation; documents the protocol shape for downstream plugin authors (e.g. a learned splitter).

Install

Requires Python 3.14 or newer.

pip install supervoxel-splitter           # core
pip install "supervoxel-splitter[fast]"   # adds dijkstra3d as the geodesic backend

The uniform interface

Every splitter satisfies the same Splitter protocol. Technique-specific knobs live on the constructor; split() itself stays clean.

from supervoxel_splitter import GeodesicSplitter

splitter = GeodesicSplitter(backend="dj3d")
result = splitter.split(
    mask=foreground_3d_bool,
    sources=src_seeds_xyz,
    sinks=snk_seeds_xyz,
    voxel_size=(4.0, 4.0, 40.0),
)

# result.labels: uint8 in {0, SOURCE, SINK, STRAY}
# result.side_of_label: {SOURCE: 1, SINK: 2}
# result.diagnostics: per-stage timings, label counts, etc.

Plugin authors implement the protocol structurally — no base class to inherit:

class MyLearnedSplitter:
    def __init__(self, *, model_path):
        ...
    def split(self, mask, sources, sinks, *,
              voxel_size=(1.0, 1.0, 1.0),
              vol_order="xyz", vox_order="xyz", seed_order="xyz"):
        ...
        return SplitResult(...)

assert isinstance(MyLearnedSplitter(model_path="..."), Splitter)

Boundary

The package knows nothing about ChunkedGraph, BigTable, IDs, or edges. It takes voxels in and gives labels back. New-ID minting, edge updates, and persistence are the consumer's responsibility.

Status

v0.1.0 covers GeodesicSplitter. WatershedSplitter and NoopSplitter ship as small reference impls demonstrating the protocol; production-quality parity with geodesic is out of scope for v0.1.0.

License

MIT.

Project details


Download files

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

Source Distribution

supervoxel_splitter-0.1.0.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

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

supervoxel_splitter-0.1.0-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file supervoxel_splitter-0.1.0.tar.gz.

File metadata

  • Download URL: supervoxel_splitter-0.1.0.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for supervoxel_splitter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d1f6d847c75d25945ef8209a6f7dac863d945b7d031eb3d0c25d38a414b14968
MD5 d1c014427cbd79340285e9d950792305
BLAKE2b-256 0d3d63ff7bf7107a303b1c6fed7bfc90d3a0bdd9f97043b48414b1f08039905c

See more details on using hashes here.

Provenance

The following attestation bundles were made for supervoxel_splitter-0.1.0.tar.gz:

Publisher: test.yml on CAVEconnectome/supervoxel-splitter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file supervoxel_splitter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for supervoxel_splitter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b89d7aeaff37360716794fb0af7c582e5aca2566528782092385f197545eec8
MD5 37006ad60f721dfff407d8b27438b307
BLAKE2b-256 07c3786ebaa11c1a7ad1bade8e94ec87acd2d2ca2ee0c6cabcda3edb054b5a7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for supervoxel_splitter-0.1.0-py3-none-any.whl:

Publisher: test.yml on CAVEconnectome/supervoxel-splitter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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