Closed SilverViking closed 2 months ago
Most likely an issue in the voronoi library, and not easy to get a fix for. Does the exception disappear when no cropping is done? Does it disappear for other crop locations/sizes?
Does the exception disappear when no cropping is done? Still needs to be tested.
Does it disappear for other crop locations/sizes? The exception indeed disappears when a different crop region is selected.
The function
sdata=fc.create_voronoi_boundaries( sdata,radius=20, shapes_layer='segmentation_mask_boundaries' )
sometimes throws this exception:GEOSException: TopologyException: unable to assign free hole to a shell at 7562.2586206896549 5066.9482758620688
This happens in script_liver_sparrow_generalized_update.ipynb, when
crop_segment=True
andcrop_param=[ 5000, 3000, 4000 ]
on the Resolve liver dataset.It seems that the segmentation polygons are valid (
sdata['segmentation_mask_boundaries'].is_valid
isTrue
for all rows in the GeoDataFrame).What causes the exception and what can be done about it?