itasc.cellpose.joint

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

When the standalone tool has both channels, this composes the existing pieces into one nucleus-anchored path:

  1. Nucleus native masks (native_masks.run_nucleus_masks_stack()) → track them (track_laptrack.track_masks()) → tracked nucleus labels.

  2. Cell flows (cellpose_runner.run_cell_stack()prob, dp); the cell foreground is sigmoid(prob) > fg_threshold.

  3. Per z-plane, flow-follow each cell-foreground pixel to a nucleus (flow_following.flow_follow_movie()). Cell labels inherit the tracked nucleus ids, so the cell stack is tracked by construction — one cell per nucleus, sharing its id.

Everything here reuses functions the app also imports (read-only); it adds no new behaviour to the app’s Cellpose stage.

Functions

cell_foreground_from_prob(prob, threshold)

Boolean cell foreground from a Cellpose probability map via the sigmoid.

joint_segment_track(nucleus_stack, ...[, ...])

Run the joint path; return (nucleus_tracked, cell_tracked) (T,Z,Y,X).

itasc.cellpose.joint.cell_foreground_from_prob(prob, threshold)[source]

Boolean cell foreground from a Cellpose probability map via the sigmoid.

Matches the app’s sigmoid(prob) foreground convention; threshold is the exposed cutoff on the [0, 1] sigmoid.

Return type:

ndarray

Parameters:
itasc.cellpose.joint.joint_segment_track(nucleus_stack, cell_stack, nucleus_params, cell_params, flow_params, *, max_distance=15.0, max_frame_gap=0, progress_cb=None, cancel_cb=None)[source]

Run the joint path; return (nucleus_tracked, cell_tracked) (T,Z,Y,X).

Both outputs are int32 and share label ids: a cell carries the id of the nucleus it was assigned to. max_distance/max_frame_gap tune the nucleus tracker; the cell stack inherits its tracks.

Return type:

tuple[ndarray, ndarray]

Parameters: