Defense-Circuits-Lab / findmycells

An end-to-end bioimage analysis pipeline with state-of-the-art tools for non-coding experts
https://defense-circuits-lab.github.io/findmycells/
GNU General Public License v3.0
2 stars 1 forks source link

Assert for validity of .roi files #8

Closed KonKob closed 1 year ago

KonKob commented 1 year ago

if there are roi-files with less than 3 coordinates given, the roi can't be created and the shapely pckg will throw an error "ValueError: A LinearRing must have at least 3 coordinate tuples"

image image
KonKob commented 1 year ago

SOLUTION: rois.py, line 63: assert (len(row_coords) > 2) & (len(col_coords) > 2), f"The .roi-file {loaded_rois[idx].name} has less than 3 coordinates!"

KonKob commented 1 year ago

Alternatively, if the .roi files have only two coordinates on purpose, create a different shapely object (Line)