e0404 / matRad

An open source multi-modality radiation treatment planning sytem developed by e0404 @ DKFZ
http://www.matRad.org
Other
221 stars 175 forks source link

[BUG] Unable to import DICOM #566

Closed uyousafzai54 closed 2 years ago

uyousafzai54 commented 2 years ago

Describe the bug While trying to import a DICOM dataset, I get the following error.

Unrecognized field name "SpacingBetweenSlices".

Error in matRad_importDicomCt (line 84)
        ctInfo(i).SliceThickness = tmpDicomInfo.SpacingBetweenSlices;

I believe this due to different headers in my DICOM dataset. Is there any documentation on the required headers for importing DICOMs? I can send the dataset if required to find out what the issue is.

Desktop (please complete the following information):

wahln commented 2 years ago

There is no documentation so far, but the DICOM tag "SpacingBetweenSlices" is required and it is apparently not there, so that's the issue. Are you importing a normal CT or something else? Which system was it exported from?

uyousafzai54 commented 2 years ago

I am importing normal CT scans. The headers for a sample DICOM from this set are shown below.

                       Filename: '/Users/umaryousafzai/Downloads/$20110113/CT.$20110113.Image 188.dcm'
                       FileModDate: '30-May-2022 02:14:00'
                          FileSize: 525620
                            Format: 'DICOM'
                     FormatVersion: 3
                             Width: 512
                            Height: 512
                          BitDepth: 16
                         ColorType: 'grayscale'
    FileMetaInformationGroupLength: 180
        FileMetaInformationVersion: [2×1 uint8]
           MediaStorageSOPClassUID: '1.2.840.10008.5.1.4.1.1.2'
        MediaStorageSOPInstanceUID: '1.2.246.352.71.3.661909214.1170173.20110113093106'
                 TransferSyntaxUID: '1.2.840.10008.1.2'
            ImplementationClassUID: '1.2.246.352.70.2.1.160.3'
         ImplementationVersionName: 'DCIE 2.2'
              SpecificCharacterSet: 'ISO_IR 192'
                         ImageType: 'ORIGINAL\PRIMARY\AXIAL'
              InstanceCreationDate: '20211208'
              InstanceCreationTime: '174531'
                       SOPClassUID: '1.2.840.10008.5.1.4.1.1.2'
                    SOPInstanceUID: '1.2.246.352.71.3.661909214.1170173.20110113093106'
                         StudyDate: '20110113'
                        SeriesDate: '20110113'
                       ContentDate: '20110113'
                         StudyTime: '092753.953'
                        SeriesTime: '092754'
                       ContentTime: '093106.127'
                   AccessionNumber: ''
                          Modality: 'CT'
                      Manufacturer: 'Varian Medical Systems'
            ReferringPhysicianName: [1×1 struct]
                       StationName: 'GRH500'
                  StudyDescription: 'ARIA RadOnc Study'
                 SeriesDescription: 'Generated empty phantom image set'
                     OperatorsName: [1×1 struct]
             ManufacturerModelName: 'Aria RadOnc'
                       PatientName: [1×1 struct]
                         PatientID: '$20110113'
                  PatientBirthDate: ''
                        PatientSex: ''
                    SliceThickness: []
                               KVP: []
                DeviceSerialNumber: '661909214'
                  SoftwareVersions: '8.9.09'
                   PatientPosition: 'HFS'
                  StudyInstanceUID: '1.2.246.352.71.1.661909214.116800.20110113092754'
                 SeriesInstanceUID: '1.2.246.352.71.2.661909214.681641.20110113092754'
                           StudyID: '$20110113'
                      SeriesNumber: 1
                 AcquisitionNumber: []
                    InstanceNumber: 188
              ImagePositionPatient: [3×1 double]
           ImageOrientationPatient: [6×1 double]
               FrameOfReferenceUID: '1.2.246.352.71.8.661909214.681641.20110113092754'
        PositionReferenceIndicator: ''
                   SamplesPerPixel: 1
         PhotometricInterpretation: 'MONOCHROME2'
                              Rows: 512

For the SpacingBetweenSlices tag, what is type of the expected data to be (string, float etc)?

amitantony commented 2 years ago

I believe SpacingBetweenSlices is a float value src: [ https://dicom.innolitics.com/ciods/ct-performed-procedure-protocol/performed-ct-reconstruction/00189934/00180050 ]

wahln commented 2 years ago

It seems like the information on resolution of your CT phantom is missing. I would suggest to set the tags SliceThickness (z resolution) and PixelSpacing (x-y resolution) to actual resolutions, as matRad prefers "SliceThickness" and only uses "SpacingBetweenSlices" as back-up.

uyousafzai54 commented 2 years ago

Thank you for getting back. I fixed these issues and now the error is the following.

Warning: Field SourceToSurfaceDistance not found on beam sequence Item_1. No field shape import performed! 
> In matRad_importFieldShapes (line 75)
In matRad_importDicomRTPlan (line 125)
In matRad_importDicom (line 106)
In matRad_importDicomGUI>import_button_Callback (line 330)
In gui_mainfcn (line 95)
In matRad_importDicomGUI (line 53)
In matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)matRad_importDicomGUI('import_button_Callback',hObject,eventdata,guidata(hObject)) 
Output argument "collimation" (and possibly others) not assigned a value in the execution with "matRad_importFieldShapes" function.

Error in matRad_importDicomRTPlan (line 125)
    pln.propStf.collimation  = matRad_importFieldShapes(BeamSequence,fractionSequence);

I'm not completely sure as to why my dataset is leading to this. Any insights?