itasc.cellpose

Cellpose stage + standalone segment/track tool.

Two roles share this package:

  • Integrated app — the local Cellpose-SAM runner (cellpose_runner) and the divergence-derived foreground/contour maps (build_divergence_maps) that the orchestrator’s in-app stage produces for nucleus tracking (itasc-tracking) and cell segmentation.

  • Standalone ``itasc-cellpose`` toolnative_masks captures the Cellpose native masks the runner otherwise discards, and track_laptrack links them across time, giving a self-contained “segment then track” product.

The Cellpose model is the optional [cellpose] extra and laptrack is the [laptrack] extra; both are imported lazily, so importing this package does not require either.

class itasc.cellpose.DivergenceMapsReport(frames, foreground_z_reduction, contour_z_reduction, smoothing_sigma, median_radius, contours_path, foreground_path, foreground_smoothing_sigma=0.0, foreground_median_radius=0)[source]

Bases: object

Summary returned by build_divergence_maps().

Parameters:
  • frames (int)

  • foreground_z_reduction (Literal['mean', 'max'])

  • contour_z_reduction (Literal['mean', 'max'])

  • smoothing_sigma (float)

  • median_radius (int)

  • contours_path (Path)

  • foreground_path (Path)

  • foreground_smoothing_sigma (float)

  • foreground_median_radius (int)

frames: int
foreground_z_reduction: Literal['mean', 'max']
contour_z_reduction: Literal['mean', 'max']
smoothing_sigma: float
median_radius: int
contours_path: Path
foreground_path: Path
foreground_smoothing_sigma: float
foreground_median_radius: int
itasc.cellpose.build_divergence_maps(prob_path, dp_path, contours_out, foreground_out, *, foreground_z_reduction, contour_z_reduction, smoothing_sigma, median_radius, foreground_smoothing_sigma=0.0, foreground_median_radius=0, progress_cb=None, cancel=None)[source]

Compute and write contours and foreground from Cellpose prob/dp.

Output stacks are T x Y x X float32. progress_cb is called for each foreground frame, contour z-slice, and output write. smoothing_sigma / median_radius filter the flow before divergence (contours); the foreground_* knobs filter the reduced foreground map independently.

Return type:

DivergenceMapsReport

Parameters:

Submodules

cellpose_runner

Local Cellpose-SAM runner, Qt-free, used by the napari Cellpose widget.

divergence_maps

Divergence-based foreground & contour maps from Cellpose prob/dp outputs.

flow_following

Flow-following cell segmentation, Qt-free, for the standalone distro.

joint

Joint nucleus-anchored cell segmentation + tracking, Qt-free.

native_masks

Capture Cellpose-SAM native masks, Qt-free, for the standalone distro.

retrack

DB-free greedy retracker for the standalone segment + track corrector.

shape

Layout-free input canonicalisation for the standalone tool.

track_laptrack

Link per-frame native masks across time with laptrack, Qt-free.