torchcell.sga.CellposeSegConfig

class CellposeSegConfig(*, n_rows: int = 14, n_cols: int = 22, polarity: str = 'auto', node_tol: float = 0.55, stray_tol: float = 1.0, circularity_flag: float = 0.8, circularity_reject: float = 0.65, neighbor_invalidate: bool = True, neighbor_dist: float = 0.85, gel_detect: bool = True, edge_policy: str = 'flag', flow_threshold: float = 0.4, cellprob_threshold: float = 0.0, diameter: float | None = None, contrast: str = 'none', clahe_clip: float = 0.01, min_instance_area: int = 20, tighten_size: bool = True, tighten_min_frac: float = 0.2, tighten_grow_px: int = 3, relax_grid: bool = True, homography_refit: bool = True, correct_row_shift: bool = True, edge_margin_frac: float = 0.5, multi_min_frac: float = 0.35, multi_min_sep_frac: float = 0.3, recover_missed_wells: bool = True, recover_depth_thresh: float = 12.0)[source]

Bases: BaseModel

Parameters for Cellpose-SAM plate segmentation.

node_tol/stray_tol are fractions of the fitted colony pitch: an instance whose centroid is within node_tol * pitch of a grid node is that well’s colony; one within stray_tol * pitch (but farther than node_tol) is a near-stray that INVALIDATES the well (flag M); one farther than stray_tol from every node is an off-grid contaminant colony (counted, assigned to no well). diameter=None uses Cellpose-SAM’s diameter-agnostic default; set it (px) only if faint colonies under-segment.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].