fishtank.seg.masks_to_polygons#
- fishtank.seg.masks_to_polygons(masks, tolerance=0.5, id='cell', z='z')#
Covert segmentation masks to polygons.
- Parameters:
masks (
ndarray) – a (Y,X) or (Z,Y,X) numpy array of segmentation masks.tolerance (
float(default:0.5)) – The maximum allowed geometry displacement. The higher this value, the smaller the number of vertices in the resulting geometry.id (
str(default:'cell')) – The name of the id column in the resulting GeoDataFramez (
str(default:'z')) – The name of the z column in the resulting GeoDataFrame
- Return type:
- Returns:
polygons a GeoDataFrame of cell outlines.