cellcoloc.analyze_existing_masksο
- cellcoloc.analyze_existing_masks(loaded_images, roi_labels_2d, cell_masks, marker_masks, colocalization_config, optional_region_result=None, optional_region_masks=None, analysis_z_bounds=None, cell_refinement_context=None, marker_refinement_context=None, optional_region_refinement_context=None, cell_model_config=None, marker_model_config=None, optional_region_model_config=None)[source]ο
Recompute colocalization tables from existing label masks.
This helper is used both after the initial Cellpose segmentation and after any later manual or threshold-based refinement of the label masks.
- Parameters:
loaded_images β Loaded raw analysis channels and dataset metadata.
roi_labels_2d β Drawn or generated 2D ROI label mask.
cell_masks, marker_masks β Full-stack label masks for the two primary analysis channels. They may originate from Cellpose, thresholding, or manual relabeling.
colocalization_config β Thresholds controlling how per-cell overlaps are interpreted.
optional_region_result, optional_region_masks β Optional third-channel segmentation supplied either as the legacy result wrapper or directly as a label image. When both are provided,
optional_region_maskstakes precedence.analysis_z_bounds β Optional global z interval used for the current analysis. Labels outside this interval are ignored internally but the stored masks keep full-stack shape.
cell_refinement_context, marker_refinement_context β Optional cached Cellpose network outputs used for later threshold-only refinement.
cell_model_config, marker_model_config, optional_region_model_config β Optional channel configs reused here mainly so postfilters can be applied consistently when masks are reanalyzed.
- Return type:
- Returns:
ColocalizationRunResult β Structured masks and tables reflecting the provided segmentation state.