Convert binary label map into 2D contours (ideally splines) and back

Storing and managing segmentation data in a series of 2D contours is a legacy method, and so far we only needed it for DICOM-RT Structure Set, and did not want to encourage its use (especially that there is the DICOM Segmentation Object, which is much superior to RTSS). This is why we did not even implement a conversion rule going from labelmap to planar contour, but the code that does the conversion is in the exporter function itself:

If you want it could be outsourced though. Any thoughts @lassoan @Sunderlandkyl?

With the recent addition of the new Markup type of closed curve this would be much easier to do than before. The only thing we’d need is a converter from/to planar contour segmentations (and the abovementioned labelmap → contours conversion, since the other way is implemented already).