itasc.core.imageops

Generic, deterministic image operations shared across ITASC pieces.

Pure functions with no ITASC dependencies, usable by segmentation, tracking, and any other consumer without pulling in a heavier subpackage.

Functions

residual(frame, window[, strength])

Local-mean-subtracted residual: clip(frame - strength*localmean(frame), 0).

itasc.core.imageops.residual(frame, window, strength=1.0)[source]

Local-mean-subtracted residual: clip(frame - strength*localmean(frame), 0).

Flattens each map’s per-nucleus offset so a single global threshold works everywhere while staying ~0 in flat background. window is forced odd.

strength blends between the raw map and the fully-flattened residual: 1.0 subtracts the whole local background (default), 0.0 subtracts nothing so the result is the raw (non-negative) map, and values in between partially flatten. Lowering it trades uniform-threshold behaviour for keeping more of the original signal where the background is already flat.

Return type:

ndarray

Parameters: