ImagingDataCommons / highdicom

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

Allow annotations to reference multiple images #193

Closed hackermd closed 2 years ago

hackermd commented 2 years ago

An annotations object may contain multiple measurements, which may have been derived from different images. Therefore, it is important to allow reference of multiple (multi-frame) image instances.

hackermd commented 2 years ago

Should there not be a check that the different images have the same frame of reference UID (for SCOORD3D) and/or number of rows and columns (for SCOORD)?

That's a good idea.

I realized that we will need to differentiate between the Referenced Image Sequence (Microscopy Bulk Simple Annotations Module) and Referenced Instance Sequence (Common Instance Reference Module). At the moment, we are including a reference for each of the source_images in both sequences.

In my opinion, the design of the Microscopy Bulk Simple Annotations Module is flawed for the use of 2D annotation coordinate type (SCOORD), where coordinates are defined relative to the total pixel matrix of an individual SOP instance, because the assumption that a group of annotations applies to a single image instance may not hold - in particular if measurements are included. For example, objects may be detected in one image and the coordinates will be recorded relative to that image, but then measurements may subsequently be taken from a different image, which will have a different SOP Instance UID but the same Frame of Reference UID. Therefore, I only use 3D annotation coordinate type, where coordinates are defined relative to the frame of reference.

In conclusion, I think we should apply different checks for different annotation coordinate type values. I will update the PR accordingly.