QIICR / dcmqi

dcmqi (DICOM for Quantitative Imaging) is a free, open source C++ library for conversion between imaging research formats and the standard DICOM representation for image analysis results
https://qiicr.gitbook.io/dcmqi-guide/
BSD 3-Clause "New" or "Revised" License
232 stars 62 forks source link

Missing image reference with tid1500reader #440

Closed fordanic closed 3 years ago

fordanic commented 3 years ago

Working on some DICOM SR objects using TID 1500 to encode a set of landmarks and then using the tid1500reader to convert them to JSON objects. However, after the conversion, the references to the images and pixel coordinates are missing.

Example output from dcsrdump of the DICOM SR object:

>CONTAINS: CONTAINER: (126010,DCM,"Imaging Measurements")  [SEPARATE]
        >>CONTAINS: CONTAINER: (125007,DCM,"Measurement Group")  [SEPARATE]
                >>>HAS OBS CONTEXT: TEXT: (112039,DCM,"Tracking Identifier")  = "76CF16B1D9619FF3"
                >>>HAS OBS CONTEXT: UIDREF: (112040,DCM,"Tracking Unique Identifier")  = "1.2.826.0.1.3680043.8.498.13341971519731910880378332129613836942"
                >>>CONTAINS: CODE: (121071,DCM,"Finding")  = (764722006,SCT,"Structure of greater trochanter of right femur")
                >>>HAS CONCEPT MOD: CODE: (363698007,SCT,"Finding Site")  = (71341001,SCT,"Bone structure of femur")
                >>>CONTAINS: CODE: (758637006,SCT,"Anatomical locations")  = (26216008,SCT,"Center")
                        >>>>INFERRED FROM: SCOORD:  = POINT {95,301}
                                >>>>>SELECTED FROM: IMAGE:  = (1.2.840.10008.5.1.4.1.1.2,1.3.6.1.4.1.9328.50.4.840)

Corresponding data from the JSON objects:

{
    "Finding" : 
    {
        "CodeMeaning" : "Structure of greater trochanter of right femur",
        "CodeValue" : "764722006",
        "CodingSchemeDesignator" : "SCT"
    },
    "FindingSite" : 
    {
        "CodeMeaning" : "Bone structure of femur",
        "CodeValue" : "71341001",
        "CodingSchemeDesignator" : "SCT"
    },
    "TrackingIdentifier" : "76CF16B1D9619FF3",
    "TrackingUniqueIdentifier" : "1.2.826.0.1.3680043.8.498.13341971519731910880378332129613836942",
    "measurementItems" : [],
    "qualitativeEvaluations" : 
    [
        {
            "conceptCode" : 
            {
                "CodeMeaning" : "Anatomical locations",
                "CodeValue" : "758637006",
                "CodingSchemeDesignator" : "SCT"
            },
            "conceptValue" : 
            {
                "CodeMeaning" : "Center",
                "CodeValue" : "26216008",
                "CodingSchemeDesignator" : "SCT"
            }
        }
    ]
},

Is something wrong in my structure of the DICOM SR or is there something missing in the tid1500reader?

fedorov commented 3 years ago

How is your set of landmarks represented? There is nothing in your JSON file that points to a segmentation (and currently dcmqi can only support SRs where regions of interest are defined by segmentations).

fordanic commented 3 years ago

Sorry for the late response.

As these are just landmarks there are no associated segmentations. The landmarks are just represented by the referenced SOP instance and the pixel coordinates.

fedorov commented 3 years ago

This type of annotations is not supported by dcmqi. You can look into using https://github.com/MGHComputationalPathology/highdicom for creating this flavor of TID 1500.

fordanic commented 3 years ago

I already have creates them. Was more looking to you the reader as an easy way for someone else to parse them without to detailed knowledge of DICOM or pydicom.

fedorov commented 3 years ago

I understand. https://github.com/MGHComputationalPathology/highdicom should also be helpful to read them.