alanaberdeen / AIDA

Annotation of Image Data by Assignment.
https://alanaberdeen.github.io/AIDA
MIT License
56 stars 15 forks source link

add support for displaying closed paths with holes #23

Closed stefano-malacrino closed 4 years ago

stefano-malacrino commented 4 years ago

Add support for visualizing path with holes (useful to display machine-generated tissue segmentation). This implementation uses paperjs CompoundPath class with evenodd filling rule. The AIDA type is cpath, the holes are represented as a list valid paperjs closed paths or shapes, e.g.

{"class":"test","type":"cpath","children":[
    {"type":"path","segments":[[1000,1000],[2000,1000],[2000,2000],[1000,2000]],"closed":true},
    {"type":"path","segments":[[1400,1400],[1600,1400],[1600,1600],[1400,1600]],"closed":true}
]}
alanaberdeen commented 4 years ago

Hey @stefano-malacrino,

Cool, I was also thinking these would be useful.

In the new revision of the schema based on GeoJSON, the polygons spec includes internal and external LinearRings...

Do you think this is a reasonable representation in the annotation schema?

As for actually drawing it in PaperJS, compound paths make sense.

alanaberdeen commented 4 years ago

LGTM