ImagingDataCommons / highdicom

High-level DICOM abstractions for the Python programming language
https://highdicom.readthedocs.io
MIT License
168 stars 35 forks source link

Add support for instance segmentation with LABELED segmentation type #184

Open hackermd opened 2 years ago

hackermd commented 2 years ago

This PR introduces changes to support storing multiple connected components for the same segment (labeled mask) in a DICOM Segmentation instance. This is currently not supported by the DICOM standard, but is necessary for many image analysis use cases in computational pathology (e.g., instance segmentation of single cells in whole slide microscopy images).

To support these use cases, all that would be necessary is a new segmentation type, which I called "LABELED".

Since we need to encode a potentially large number of instances (e.g., a whole slide image may easily contain > 100, 000 cells), support for larger bit depths (16-bit and 32-bit) is also required. This PR therefore also introduces changes to allow for encoding of segments with 32-bit unsigned integer pixels (currently restricted to "LABELED" segmentation type to not break existing behavior).

cc @fedorov @dclunie

hackermd commented 2 years ago

We may want to define a separate Instance Segmentation IOD and implement it as a separate highdicom.seg.InstanceSegmentation class.