cells#

Segmentation of cells in thresholded image

find(image: ndarray, x: int, y: int, r: int, r_reltol: float = 0.004, area_min: int = 6, area_max: int = 1000) DataFrame[source]#

Performs the cell segmentation by finding connected components.

The center (x, y) and radius r of the circle must be given. r_reltol denotes the relative tolerance for considering cells as outside the circle, even though strictly speaking they are still within the radius. Detected cells must have an area in pixels between area_min and area_max.

draw(canvas: ndarray, cells: DataFrame) ndarray[source]#

Draws the bounding boxes of given cells onto the image canvas.

This is meant as an illustration rather than doing anything computational with it.

write(file: Path, cells: DataFrame)[source]#

Writes cell-segmentation results to given file.

The data is written as a tab-separated table with one header row containing the column titles of the cells DataFrame.

read(file: Path) DataFrame[source]#

Reads cell-segmentation results from given file.

The data is expected to be tab-separated table with one header row, just like the one produced by write().