Skip to content

Commit

Permalink
Plot holes if any within annotations (#43)
Browse files Browse the repository at this point in the history
* plot holes if any within annotations

* moved hole plotting in polygon if statement
  • Loading branch information
tsikup authored Nov 7, 2023
1 parent fc8fd7c commit 6e181e4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wholeslidedata/visualization/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ def plot_annotations(
ax.scatter(*coordinates, color=color)
elif isinstance(annotation, PolygonAnnotation):
ax.plot(*list(zip(*coordinates)), color=color, linewidth=2)
holes = [np.array(hole) * scale for hole in annotation.holes]
for hole in holes:
ax.plot(*list(zip(*hole)), color=color, linewidth=2)
else:
raise ValueError(f"invalid annotation {type(annotation)}")

Expand Down

0 comments on commit 6e181e4

Please sign in to comment.