Overhauled the entire convert_mask_to_xml.py script with several key enhancements:
Enabled hierarchy-aware cv2_polygonize to address the issue of excluding regions within holes of the same class, eliminating the need for the previous fill_holes option.
Enhanced convert_polygons_to_annotations.py by updating how holes and types are set. The script now reflects the current state of WSD, where these are class properties. Note: Further clarification may be needed on the underlying mechanics.
Significantly improved the main function with the following features:
(I) Merged the enhanced functions mentioned above.
(II) Upgraded mask handling, allowing polygon creation for label 0. Users can specify exclusion of label 0 polygons through custom values.
(III) Optimized mask and WSI spacing handling, with added processing spacing determining mask reading and polygon creation. Spacing is written using WSI ratios for accurate XML reading in WSI viewers.
(IV) Introduced an option for exporting additional JSON.
(V) Updated the convert_annotations_to_json function to accept an optional spacing ratio. A reconsideration suggests integrating this into write_json_annotation.
(VI) Added an option to simplify polygons and compute their union.
Overhauled the entire
convert_mask_to_xml.py
script with several key enhancements:Enabled hierarchy-aware
cv2_polygonize
to address the issue of excluding regions within holes of the same class, eliminating the need for the previousfill_holes
option.Enhanced
convert_polygons_to_annotations.py
by updating how holes and types are set. The script now reflects the current state of WSD, where these are class properties. Note: Further clarification may be needed on the underlying mechanics.Significantly improved the main function with the following features:
convert_annotations_to_json
function to accept an optional spacing ratio. A reconsideration suggests integrating this intowrite_json_annotation
.