Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

Improve support of DICOM SR TID1500 containing groups of measurements derived from SEG

Open sedghi opened this issue 2 years ago • 13 comments

Describe the Bug

Seems like we don't have support for TID1500, Here is the sample data from the dcmqi

https://www.dropbox.com/s/k6bdq4tt6itbcfp/Archive.zip?dl=0

Steps to Reproduce:

  1. First step
  2. Second step
  3. ...
Please use code blocks to show formatted errors or code snippets

The current behavior

A clear and concise description of what happens instead of the expected behavior.

The expected behavior

A clear and concise description of what you expected to happen.

:warning: Reports we cannot reproduce are at risk of being marked stale and closed. The more information you can provide, the more likely we are to look into and address your issue.

sedghi avatar May 12 '23 19:05 sedghi

@sedghi to update estimate

james-hanks avatar Oct 25 '23 17:10 james-hanks

@fedorov @igoroctaviano Can you guys provide some insight about what is specific about this DICOM SR that we are not able to render correctly by looking into its tags?

Based on my debugging, it seems that we don't even reach the processTID14010Measurement function because there is no valueType of SCOORD and SCOORD3D.

https://github.com/OHIF/Viewers/blob/master/extensions/cornerstone-dicom-sr/src/getSopClassHandlerModule.ts#L368-L374

In 3D Slicer it looks like it maps to a fiducial?

Image

sedghi avatar Nov 22 '23 21:11 sedghi

SR TID1500 does not have to contain SCOORD or SCOORD3D. This specific SR contains a list of measurements corresponding to a region defined by a segment in the referenced DICOM SEG. Below is a portion of output of the DCMTK dsrdump command line tool. It does not look like Slicer handles this SR correctly. SR is not commonly used in Slicer, so I am not surprised.

Enhanced SR Document

Series              : QIN CT challenge: alg02 run2segmentation result - pyradiomics features (#1)
Manufacturer        : QIICR (https://github.com/QIICR/dcmqi.git, #0)
Completion Flag     : PARTIAL
Verification Flag   : UNVERIFIED
Content Date/Time   : 2018-11-05 16:45:23

<CONTAINER:(,,"Imaging Measurement Report")=SEPARATE>
  <has concept mod CODE:(,,"Language of Content Item and Descendants")=(eng,RFC5646,"English")>
  <has obs context CODE:(,,"Observer Type")=(121007,DCM,"Device")>
  <has obs context UIDREF:(,,"Device Observer UID")="1.3.6.1.4.1.43046.3.1.4.0.13541.1541454322.848790">
  <has obs context TEXT:(,,"Device Observer Name")="pyradiomics">
  <has obs context TEXT:(,,"Device Observer Model Name")="2.1.0.post36+g41000f5">
  <has concept mod CODE:(,,"Procedure reported")=(P0-0099A,SRT,"Imaging procedure")>
  <contains CONTAINER:(,,"Image Library")=SEPARATE>
    <contains CONTAINER:(,,"Image Library Group")=SEPARATE>
      <has acq context CODE:(,,"Modality")=(CT,DCM,"Computed Tomography")>
      <has acq context CODE:(,,"Target Region")=(T-D3000,SRT,"Chest")>
      <has acq context DATE:(,,"Study Date")="20000101">
      <has acq context DATE:(,,"Content Date")="20000101">
      <has acq context DATE:(,,"Acquisition Date")="20000101">
      <has acq context UIDREF:(,,"Frame of Reference UID")="1.3.6.1.4.1.14519.5.2.1.6279.6001.661736173813057305918521148633">
      <has acq context NUM:(,,"Pixel Data Rows")="512" ({pixels},UCUM,"pixels")>
      <has acq context NUM:(,,"Pixel Data Columns")="512" ({pixels},UCUM,"pixels")>
      <has acq context NUM:(,,"Horizontal Pixel Spacing")="0.78125" (mm,UCUM,"millimeter")>
      <has acq context NUM:(,,"Vertical Pixel Spacing")="0.78125" (mm,UCUM,"millimeter")>
      <has acq context NUM:(,,"Slice Thickness")="1.0" (mm,UCUM,"millimeter")>
      <has acq context NUM:(,,"Image Position (Patient) X")="-201" (mm,UCUM,"millimeter")>
      <has acq context NUM:(,,"Image Position (Patient) Y")="-59" (mm,UCUM,"millimeter")>
      <has acq context NUM:(,,"Image Orientation (Patient) Row X")="1" ({-1:1},UCUM,"{-1:1}")>
      <has acq context NUM:(,,"Image Orientation (Patient) Row Y")="0" ({-1:1},UCUM,"{-1:1}")>
      <has acq context NUM:(,,"Image Orientation (Patient) Row Z")="0" ({-1:1},UCUM,"{-1:1}")>
      <has acq context NUM:(,,"Image Orientation (Patient) Column X")="0" ({-1:1},UCUM,"{-1:1}")>
      <has acq context NUM:(,,"Image Orientation (Patient) Column Y")="1" ({-1:1},UCUM,"{-1:1}")>
      <has acq context NUM:(,,"Image Orientation (Patient) Column Z")="0" ({-1:1},UCUM,"{-1:1}")>
      <contains IMAGE:=(CT image,)>
        <has acq context NUM:(,,"Image Position (Patient) Z")="-456.800049" (mm,UCUM,"millimeter")>
      <contains IMAGE:=(CT image,)>
        <has acq context NUM:(,,"Image Position (Patient) Z")="-590.800049" (mm,UCUM,"millimeter")>
      <contains IMAGE:=(CT image,)>
        <has acq context NUM:(,,"Image Position (Patient) Z")="-644.800049" (mm,UCUM,"millimeter")>
      <contains IMAGE:=(CT image,)>
        <has acq context NUM:(,,"Image Position (Patient) Z")="-453.800049" (mm,UCUM,"millimeter")>

fedorov avatar Nov 22 '23 21:11 fedorov

Sorry, the dump above is image library. The most relevant part is the measurement group:

<contains CONTAINER:(,,"Imaging Measurements")=SEPARATE>
    <contains CONTAINER:(,,"Measurement Group")=SEPARATE>
      <has obs context TEXT:(,,"Tracking Identifier")="Mass">
      <has obs context UIDREF:(,,"Tracking Unique Identifier")="1.3.6.1.4.1.43046.3.1.4.0.13541.1541454323.848791">
      <contains CODE:(,,"Finding")=(M-03000,SRT,"Mass")>
      <contains IMAGE:(,,"Referenced Segment")=(SG image,,1)>
      <contains UIDREF:(,,"Source series for segmentation")="1.3.6.1.4.1.14519.5.2.1.6279.6001.154677396354641150280013275227">
      <contains NUM:(,,"Surface to volume ratio")="4.961525E-01" (1,UCUM,"no units")>
      <contains NUM:(,,"Flatness")="6.349019E-01" (1,UCUM,"no units")>
      <contains NUM:(,,"Maximum 3D diameter")="2.190890E+01" (1,UCUM,"no units")>
      <contains NUM:(,,"Surface area")="9.509589E+02" (1,UCUM,"no units")>
      <contains NUM:(,,"Elongation")="8.757179E-01" (1,UCUM,"no units")>
      <contains NUM:(,,"shape_Maximum2DDiameterRow")="2.039608E+01" (1,UCUM,"no units")>
      <contains NUM:(,,"Approximate volume")="1.992000E+03" (1,UCUM,"no units")>
      <contains NUM:(,,"Least axis length")="1.116752E+01" (1,UCUM,"no units")>
      <contains NUM:(,,"Minor axis length")="1.540332E+01" (1,UCUM,"no units")>
      <contains NUM:(,,"Major axis length")="1.758936E+01" (1,UCUM,"no units")>
      <contains NUM:(,,"shape_Maximum2DDiameterColumn")="2.000000E+01" (1,UCUM,"no units")>
      <contains NUM:(,,"Volume")="1.916667E+03" (1,UCUM,"no units")>
      <contains NUM:(,,"Sphericity")="7.846695E-01" (1,UCUM,"no units")>
      <contains NUM:(,,"shape_Maximum2DDiameterSlice")="2.000000E+01" (1,UCUM,"no units")>

fedorov avatar Nov 22 '23 21:11 fedorov

One challenge in using TID1500 is that it has different "branches" that cover different situations (volumetric vs planar annotations, quantitative vs qualitative measurements), and is quite complex - like most things in DICOM, unfortunately.

But, as @pieper likes to say, it's not like we are dealing with a simple problem. The world of image-based measurements is complex, and the template reflects this reality.

fedorov avatar Nov 22 '23 21:11 fedorov

@fedorov Thanks a lot for fast investigation

This specific SR contains a list of measurements corresponding to a region defined by a segment in the referenced DICOM SEG

So I guess my data is missing that DICOM SEG. Do expect the viewer load the SEG and show the annotation on the SEG or you expect it to work on the referenced Image only?

How commonly are TID1500 used? I'm trying to understand the scope for this, as it seems like a complicated task.

sedghi avatar Nov 22 '23 21:11 sedghi

I think it might be best to meet to discuss this, as I do not know the background for this issue. OHIF already supports some "variants" of TID 1500 - this is what is used to encode content discussed in https://github.com/OHIF/Viewers/issues/3358 and https://github.com/OHIF/Viewers/issues/2404.

The specific variant in this issue encodes radiomics features extracted from an image region defined by a segment, which is quite a common use case, in my view. But how commonly those are used, I do not know. We do have some of those samples in IDC. E.g., see SRs in this study for LIDC-IDRI: https://viewer.imaging.datacommons.cancer.gov/viewer/1.3.6.1.4.1.14519.5.2.1.6279.6001.224985459390356936417021464571. In this case, it is a much smaller list of measurements, with just volume and surface area of the segment.

fedorov avatar Nov 22 '23 21:11 fedorov

Any Updates on this? or possible solutions that can work out of the box ?

highoncarbs avatar Jun 13 '24 04:06 highoncarbs

@highoncarbs We offer extensive support for TID1500. You can refer to the sr extension for more information. Have you anonymized your data for sharing?

sedghi avatar Jun 14 '24 16:06 sedghi

@sedghi Hello, apologies for the delay. Here's the dicomJSON - ( extracted using the script from OHIF docs )

jack-doe.json

Do you also want me to share the dicom files ?

image

highoncarbs avatar Jun 17 '24 05:06 highoncarbs

Yes, ideally the anonymized dicom files for us to see if it is dicom json issue or sr issue

sedghi avatar Jun 18 '24 02:06 sedghi

@sedghi sure Jack_Doe_DICOM.zip

highoncarbs avatar Jun 18 '24 04:06 highoncarbs

The above screen shot is not related to showing groups of measurements from SEG, but is related to showing other types of SRs. The screen shot shows does report and come from a SIemens does report object created on the modality. There is also a DICOM initiative to add a quality report SR instance.

wayfarer3130 avatar Jun 27 '24 14:06 wayfarer3130