itasc.segmentation.contour_filtering¶
Filtering helpers for nucleus contour-map stacks.
Functions
|
Return contour maps after median, Gaussian, and memory filtering. |
|
Bidirectional contour memory filter. |
Classes
|
Parameters for spatial and temporal contour-map filtering. |
- class itasc.segmentation.contour_filtering.ContourFilterParams(median_kernel_time=1, median_kernel_space=1, gaussian_sigma_time=0.0, gaussian_sigma_space=0.0, memory_tau=0.0, memory_floor=0.01)[source]¶
Bases:
objectParameters for spatial and temporal contour-map filtering.
- Parameters:
- itasc.segmentation.contour_filtering.contour_memory_filter(contours, tau=0.1, floor=0.01)[source]¶
Bidirectional contour memory filter.
Runs a signal-adaptive EMA forward (t=0→T) and backward (t=T→0), then averages. Strong ridges reset the memory; weak/absent ridges inherit from their temporal neighbours.
- Parameters:
contours ((T, H, W) float32)
tau (Signal threshold controlling the crossover between "trust data") – and “trust memory”. Set to roughly the contour value you consider “weak”. Lower = more aggressive persistence.
floor (Minimum alpha per frame. Prevents permanent ghosting — even) – with zero signal the memory decays at rate
(1 - floor)per frame. At 0.01 a ghost halves in ~69 frames; at 0.05 ~14 frames.
- Returns:
filtered
- Return type:
(T, H, W) float32
- itasc.segmentation.contour_filtering.compute_filtered_contour_maps(contours, params)[source]¶
Return contour maps after median, Gaussian, and memory filtering.
- Return type:
- Parameters:
contours (ndarray)
params (ContourFilterParams)