Unable to create RTStruct from X-Ray DICOM via export using OHIF XNAT Viewer

Issue #41 wontfix
Tom Roberts created an issue

Hi there – hope this is the right place to post.

We have X-Ray DICOM data. We are using XNAT to de-identify the DICOMs imported from our PACS system. We use custom scripts for this. The output of the final de-identified DICOM is attached.

We want to draw a contour on this DICOM using the OHIF XNAT Viewer and output an RTStruct. When we draw the contour and export, it outputs an AIM Instance file in the ROI Collection, but no RTStruct.

Things we have tried:

  • We found the discussion here: https://groups.google.com/g/xnat_discussion/c/N2gt5a-hQIw. Our original patient DICOMs do not contain a FrameOfReferenceUID, so we tried to insert this tag into the DICOM and generate a dummy UID using the hashUID function, however this did not result in a DICOM that produces an RTStruct. We also tried creating the tag as an empty string, which also didn’t work.
  • We have uploaded a singleframe MRI DICOM to OHIF XNAT Viewer, drawn a contour and exported. This successfully generated an RTStruct.

So… it seems like there is a problem with our X-Ray DICOMs, which means we cannot generate the RTStruct files.

Appreciate your help in advance.

Many thanks,

Tom Roberts

(tom.roberts@gstt.nhs.uk – email me if easier to discuss on there, or happy to post elsewhere).

Comments (7)

  1. Tom Roberts reporter

    SOPClassUID = ComputedRadiographyImageStorage

    Apologies, think I didn’t attach dcmdump output. See below:


    Dicom-File-Format

    Dicom-Meta-Information-Header

    Used TransferSyntax: Little Endian Explicit

    (0002,0000) UL 182 # 4, 1 FileMetaInformationGroupLength
    (0002,0001) OB 00\01 # 2, 1 FileMetaInformationVersion
    (0002,0002) UI =ComputedRadiographyImageStorage # 26, 1 MediaStorageSOPClassUID
    (0002,0003) UI [1.3.12.2.1107.5.4.4.1385.30000010110508145200000000048] # 54, 1 MediaStorageSOPInstanceUID
    (0002,0010) UI =LittleEndianExplicit # 20, 1 TransferSyntaxUID
    (0002,0012) UI [1.2.40.0.13.1.1] # 16, 1 ImplementationClassUID
    (0002,0013) SH [dcm4che-2.0] # 12, 1 ImplementationVersionName

    Dicom-Data-Set

    Used TransferSyntax: Little Endian Explicit

    (0008,0005) CS [ISO_IR 100] # 10, 1 SpecificCharacterSet
    (0008,0008) CS [DERIVED\SECONDARY\CSA RESAMPLED] # 32, 4 ImageType
    (0008,0016) UI =ComputedRadiographyImageStorage # 26, 1 SOPClassUID
    (0008,0018) UI [1.3.12.2.1107.5.4.4.1385.30000010110508145200000000048] # 54, 1 SOPInstanceUID
    (0008,0020) DA [20101114] # 8, 1 StudyDate
    (0008,0021) DA [20101114] # 8, 1 SeriesDate
    (0008,0022) DA [20101114] # 8, 1 AcquisitionDate
    (0008,0023) DA [20101114] # 8, 1 ContentDate
    (0008,0030) TM (no value available) # 0, 0 StudyTime
    (0008,0033) TM (no value available) # 0, 0 ContentTime
    (0008,0050) SH [1542-1542_SCHXR_1_M_W_47] # 24, 1 AccessionNumber
    (0008,0060) CS [CR] # 2, 1 Modality
    (0008,0070) LO [SIEMENS] # 8, 1 Manufacturer
    (0008,0090) PN (no value available) # 0, 0 ReferringPhysicianName
    (0008,1030) LO [XR Scaphoid Rt] # 14, 1 StudyDescription
    (0008,1032) SQ (Sequence with undefined length #=1) # u/l, 1 ProcedureCodeSequence
    (fffe,e000) na (Item with undefined length #=3) # u/l, 1 Item
    (0008,0100) SH [XSCAR] # 6, 1 CodeValue
    (0008,0102) SH [SECTRA] # 6, 1 CodingSchemeDesignator
    (0008,0104) LO [XR Scaphoid Rt] # 14, 1 CodeMeaning
    (fffe,e00d) na (ItemDelimitationItem) # 0, 0 ItemDelimitationItem
    (fffe,e0dd) na (SequenceDelimitationItem) # 0, 0 SequenceDelimitationItem
    (0008,103e) LO [X Scaphoid DP] # 14, 1 SeriesDescription
    (0008,1090) LO [SIEMENS FD-X] # 12, 1 ManufacturerModelName
    (0010,0010) PN [1542] # 4, 1 PatientName
    (0010,0020) LO [1542] # 4, 1 PatientID
    (0010,0030) DA (no value available) # 0, 0 PatientBirthDate
    (0010,0040) CS [M] # 2, 1 PatientSex
    (0010,1010) AS [047Y] # 4, 1 PatientAge
    (0010,1030) DS [0] # 2, 1 PatientWeight
    (0012,0064) SQ (Sequence with undefined length #=1) # u/l, 1 DeidentificationMethodCodeSequence
    (fffe,e000) na (Item with undefined length #=4) # u/l, 1 Item
    (0008,0100) SH [289354] # 6, 1 CodeValue
    (0008,0102) SH [XNAT] # 4, 1 CodingSchemeDesignator
    (0008,0103) SH [1.0] # 4, 1 CodingSchemeVersion
    (0008,0104) LO [XNAT DicomEdit 6 Script] # 24, 1 CodeMeaning
    (fffe,e00d) na (ItemDelimitationItem) # 0, 0 ItemDelimitationItem
    (fffe,e0dd) na (SequenceDelimitationItem) # 0, 0 SequenceDelimitationItem
    (0018,0010) LO (no value available) # 0, 0 ContrastBolusAgent
    (0018,0015) CS [WRIST] # 6, 1 BodyPartExamined
    (0018,0060) DS [60] # 2, 1 KVP
    (0018,1020) LO [VB21B] # 6, 1 SoftwareVersions
    (0018,1110) DS [934] # 4, 1 DistanceSourceToDetector
    (0018,1150) IS [5] # 2, 1 ExposureTime
    (0018,1151) IS [394] # 4, 1 XRayTubeCurrent
    (0018,1152) IS [2] # 2, 1 Exposure
    (0018,1153) IS [2210] # 4, 1 ExposureInuAs
    (0018,115e) DS [0.06] # 4, 1 ImageAndFluoroscopyAreaDoseProduct
    (0018,1160) SH [NONE] # 4, 1 FilterType
    (0018,1164) DS [0.143\0.143] # 12, 2 ImagerPixelSpacing
    (0018,1166) CS [NONE] # 4, 1 Grid
    (0018,1180) SH [----] # 4, 1 CollimatorGridName
    (0018,1401) LO [0] # 2, 1 AcquisitionDeviceProcessingCode
    (0018,1405) IS [1455] # 4, 1 RelativeXRayExposure
    (0018,5100) CS (no value available) # 0, 0 PatientPosition
    (0018,5101) CS (no value available) # 0, 0 ViewPosition
    (0018,6000) DS [400] # 4, 1 Sensitivity
    (0018,7000) CS [YES] # 4, 1 DetectorConditionsNominalFlag
    (0018,7001) DS [42] # 2, 1 DetectorTemperature
    (0020,000d) UI [1.2.840.113619.2.243.339070193158.40485.4839.225393] # 52, 1 StudyInstanceUID
    (0020,000e) UI [1.3.12.2.1107.5.4.4.1385.30000010110508281131200000047] # 54, 1 SeriesInstanceUID
    (0020,0010) SH [1542_SCHXR_1_M_W_471542] # 24, 1 StudyID
    (0020,0011) IS [1] # 2, 1 SeriesNumber
    (0020,0012) IS [1] # 2, 1 AcquisitionNumber
    (0020,0013) IS [1] # 2, 1 InstanceNumber
    (0020,0020) CS (no value available) # 0, 0 PatientOrientation
    (0020,0060) CS (no value available) # 0, 0 Laterality
    (0028,0002) US 1 # 2, 1 SamplesPerPixel
    (0028,0004) CS [MONOCHROME2] # 12, 1 PhotometricInterpretation
    (0028,0010) US 964 # 2, 1 Rows
    (0028,0011) US 964 # 2, 1 Columns
    (0028,0100) US 16 # 2, 1 BitsAllocated
    (0028,0101) US 12 # 2, 1 BitsStored
    (0028,0102) US 11 # 2, 1 HighBit
    (0028,0103) US 0 # 2, 1 PixelRepresentation
    (0028,0301) CS [NO] # 2, 1 BurnedInAnnotation
    (0028,1050) DS [1299] # 4, 1 WindowCenter
    (0028,1051) DS [1220] # 4, 1 WindowWidth
    (0028,2110) CS [00] # 2, 1 LossyImageCompression
    (0032,1064) SQ (Sequence with undefined length #=1) # u/l, 1 RequestedProcedureCodeSequence
    (fffe,e000) na (Item with undefined length #=3) # u/l, 1 Item
    (0008,0100) SH [XSCAR] # 6, 1 CodeValue
    (0008,0102) SH [BROKER] # 6, 1 CodingSchemeDesignator
    (0008,0104) LO [XR Scaphoid Rt] # 14, 1 CodeMeaning
    (fffe,e00d) na (ItemDelimitationItem) # 0, 0 ItemDelimitationItem
    (fffe,e0dd) na (SequenceDelimitationItem) # 0, 0 SequenceDelimitationItem
    (0040,0260) SQ (Sequence with undefined length #=1) # u/l, 1 PerformedProtocolCodeSequence
    (fffe,e000) na (Item with undefined length #=3) # u/l, 1 Item
    (0008,0100) SH [XSCAR] # 6, 1 CodeValue
    (0008,0102) SH [BROKER] # 6, 1 CodingSchemeDesignator
    (0008,0104) LO [XR Scaphoid Rt] # 14, 1 CodeMeaning
    (fffe,e00d) na (ItemDelimitationItem) # 0, 0 ItemDelimitationItem
    (fffe,e0dd) na (SequenceDelimitationItem) # 0, 0 SequenceDelimitationItem
    (0040,2016) LO (no value available) # 0, 0 PlacerOrderNumberImagingServiceRequest
    (0040,2017) LO (no value available) # 0, 0 FillerOrderNumberImagingServiceRequest
    (0040,a073) SQ (Sequence with explicit length #=0) # 0, 1 VerifyingObserverSequence
    (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
    (0040,a075) PN (no value available) # 0, 0 VerifyingObserverName
    (0040,a088) SQ (Sequence with explicit length #=0) # 0, 1 VerifyingObserverIdentificationCodeSequence
    (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
    (0040,a123) PN (no value available) # 0, 0 PersonName
    (0070,0001) SQ (Sequence with explicit length #=0) # 0, 1 GraphicAnnotationSequence
    (fffe,e0dd) na (SequenceDelimitationItem for re-encod.) # 0, 0 SequenceDelimitationItem
    (0070,0084) PN (no value available) # 0, 0 ContentCreatorName
    (2050,0020) CS [IDENTITY] # 8, 1 PresentationLUTShape
    (7fe0,0010) OW 0000\0000\0000\0000\0000\0000\0000\0000\0000\0000\0000\0000\0000... # 1858592, 1 PixelData

  2. James Darcy

    Hi Tom

    The ComputedRadigraphyImageStorage IOD does not contain the ImagePlane module. The ImagePlane module contains the ImagePositionPatient and ImageOrientationPatient fields that define where an image is in 3D space. Compare to the MRImageStorage IOD which does contain the ImagePlane module. CR images being formed by projection through the patient means that they don’t have a meaningful location in 3D space. MR and CT images in contrast are tomographic images where images do have a location in 3D space.

    RTStructs contain contours where each vertex has coordinates in 3D. As such, it is not possible to generate an RTStruct for an image that has no 3D location. This is not a bug, I’m afraid, it is a consequence of CR images and RTStructs fundamentally not being compatible.

    I would also note that the CR image IOD does not contain the FrameOfReference module. This is for the same reason it does not have ImagePlane. Two images sharing a common frame of reference means that they have the same origin and axes for coordinates in 3D. CR doesn’t have any coordinates in 3D. Adding a FrameOfReferenceUID to a CR image is not valid in the IOD and makes the image not compliant with the standard. As such I recommend against doing so.

    We would like to support contours for 2D images in a proper DICOM file but I’m not aware of a suitable IOD to do so. It may exist but the DICOM standard is a big beast and I haven’t read all of it.

    Best regards

    James

  3. Tom Roberts reporter

    Hi James

    Thanks for the really clear response – super useful thank you, even though not what we were hoping for!

    We have also tried using the Mask tool on the same XRay DICOM data, but we get the following error:

    Error exporting mask collection
    Cannot read property ‘_vrMap’ of undefined

    Is this also caused by our data being 2D CR? Or is it a separate problem entirely?

    If this is possible avenue for us to progress, that would be great as then we can keep the segmentation we need to do within XNAT, otherwise we’ll need to investigate another way.

    Many thanks,

    Tom

  4. James Darcy

    That looks like a completely different problem. Could you file a new issue with steps to reproduce the problem, please?

  5. Log in to comment