loki2.inference.overlap_cell_cleaner

Clean overlapping cells from a list of detected cells.

This module provides functionality for post-processing detected cells to remove duplicates and overlaps that occur at patch boundaries.

Module Contents

class loki2.inference.overlap_cell_cleaner.OverlapCellCleaner(cell_list: List[Dict[str, Any]], logger: logging.Logger)

Post-processor for removing overlapping cells from detection results.

This class handles cleaning of cells detected at patch boundaries, removing duplicates and merging overlapping detections.

logger
cell_df
mid_cells
cell_df_margin
clean_detected_cells() pandas.DataFrame

Main Post-Processing coordinator, entry point

Returns:

DataFrame with post-processed and cleaned cells

Return type:

pd.DataFrame

convert_coordinates_vectorized(cell_df: pandas.DataFrame) pandas.DataFrame

Convert the coordinates of the cells to a string representation for fast querying.

Parameters:

cell_df – DataFrame with cells containing patch_coordinates.

Returns:

DataFrame with converted coordinates as strings.

Return type:

pd.DataFrame

loki2.inference.overlap_cell_cleaner.convert_coordinates(row: pandas.Series) pandas.Series

Convert a row from x,y type to one string representation of the patch position for fast querying Repr: x_y

Parameters:

row (pd.Series) – Row to be processed

Returns:

Processed Row

Return type:

pd.Series