View Issue Details

IDProjectCategoryView StatusLast Update
0004344Slicer4Core: CLI infrastructurepublic2018-05-29 23:24
ReporterpieperAssigned Tojcfr 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
PlatformallOSOS Version
Product Version 
Target VersionbacklogFixed in Version 
Summary0004344: Create a DICOM Series module makes invalid DICOM
Description

Using the DICOM export feature, you can end up with strings that have embedded null characters. This can cause some dicom parsers to (correctly) reject the data. The result of dciodvfy is pasted in the info below.

The underlying issue appears to be with itk, because the windowCenter and windowWidth fields are both set with the identical code, but in the output one has a null character at the end and the other does not.

https://github.com/Slicer/Slicer/blob/eefeac9286f48552e8418a11f412b2823a09b407/Modules/CLI/CreateDICOMSeries/CreateDICOMSeries.cxx#L278-L283

Additional Information

0000017 Slicer (master=)$ ~/Downloads/dicom3tools/dciodvfy /tmp/xx/dicom/1.2.826.0.1.3680043.2.1125.1.34027065691713096181869243555208536/1.2.826.0.1.3680043.2.1125.1.60570920072252354871500178658621494/1.2.826.0.1.3680043.2.1125.1.70748948830687791038514864791546742 | less

Error - Value invalid for this VR - (0x0008,0x0030) TM Study Time TM - Trailing character invalid for this VR = '' (0)
Error - Value invalid for this VR - (0x0008,0x0050) SH Accession Number SH - Trailing character invalid for this VR = '' (0)
Warning - Value dubious for this VR - (0x0008,0x0090) PN Referring Physician's Name PN [0] = <Unknown> - Retired Person Name form
Error - Value invalid for this VR - (0x0008,0x0090) PN Referring Physician's Name PN - Trailing character invalid for this VR = '' (0)
Error - Value invalid for this VR - (0x0008,0x103e) LO Series Description LO - Trailing character invalid for this VR = '' (0)
Error - Value invalid for this VR - (0x0008,0x1090) LO Manufacturer's Model Name LO - Trailing character invalid for this VR = '' (0)
Warning - Value dubious for this VR - (0x0010,0x0010) PN Patient's Name PN [0] = <MRHead> - Retired Person Name form
Error - Value invalid for this VR - (0x0010,0x0032) TM Patient's Birth Time TM - Trailing character invalid for this VR = '' (0)
Error - Value invalid for this VR - (0x0010,0x0040) CS Patient's Sex CS - Trailing character invalid for this VR = '' (0)
Error - Value invalid for this VR - (0x0018,0x0050) DS Slice Thickness DS - Trailing character invalid for this VR = '' (0)
Error - Value invalid for this VR - (0x0018,0x5100) CS Patient Position CS - Trailing character invalid for this VR = '' (0)
Error - Value invalid for this VR - (0x0020,0x0010) SH Study ID SH - Trailing character invalid for this VR = '' (0)
Error - Value invalid for this VR - (0x0020,0x0011) IS Series Number IS - Trailing character invalid for this VR = '' (0)
Error - Value invalid for this VR - (0x0028,0x1051) DS Window Width DS - Trailing character invalid for this VR = '' (0)
Error - Dicom dataset contains invalid data values for Value Representations
Warning - Retired attribute - (0x0032,0x4000) LT Study Comments
Warning - Dicom dataset contains retired attributes
CTImage
Error - Missing attribute Type 2C Conditional Element=<Laterality> Module=<GeneralSeries>
Warning - Unrecognized defined term <US> for value 1 of attribute <Rescale Type>
Error - If RescaleType is present, must be HU for ORIGINAL non-LOCALIZER images - attribute <RescaleType>
Error - Missing attribute Type 2 Required Element=<KVP> Module=<CTImage>
Error - Missing attribute Type 2 Required Element=<AcquisitionNumber> Module=<CTImage>
Warning - Attribute is not present in standard DICOM IOD - (0x0032,0x4000) LT Study Comments
Warning - Dicom dataset contains attributes not present in standard DICOM IOD - this is a Standard Extended SOP Class

TagsNo tags attached.

Relationships

related to 0003255 acknowledgedmillerjv Create DICOM Seris output has multiple standard non-compliance issues 

Activities

pieper

pieper

2017-02-13 19:48

administrator   ~0014331

ITK issue reported: https://issues.itk.org/jira/browse/ITK-3523

fedorov

fedorov

2017-02-16 11:29

developer   ~0014339

@pieper can you update this issue and let us know if Andras patcher fixes this issue?

If it does, maybe patcher should be done automatically on DICOM export from Slicer?

pieper

pieper

2017-02-16 11:59

administrator   ~0014340

@fedorov you are right, the patcher fixes the trailing null characters!

Some of the other issues remain, but they aren't problematics for my use case.

I agree that running the patcher as a step in the export process is a good workaround.

$ ~/Downloads/dicom3tools/dciodvfy /tmp/slicer-export-patched/pa000/st000/se000/mr100.dcm
Error - Media Storage SOP Instance UID different from SOP Instance UID
Warning - Value dubious for this VR - (0x0008,0x0090) PN Referring Physician's Name PN [0] = <Unknown> - Retired Person Name form
Warning - Value dubious for this VR - (0x0010,0x0010) PN Patient's Name PN [0] = <MRHead> - Retired Person Name form
Warning - Retired attribute - (0x0032,0x4000) LT Study Comments
Warning - Dicom dataset contains retired attributes
CTImage
Error - Missing attribute Type 2C Conditional Element=<Laterality> Module=<GeneralSeries>
Warning - Unrecognized defined term <US> for value 1 of attribute <Rescale Type>
Error - If RescaleType is present, must be HU for ORIGINAL non-LOCALIZER images - attribute <RescaleType>
Error - Missing attribute Type 2 Required Element=<KVP> Module=<CTImage>
Error - Missing attribute Type 2 Required Element=<AcquisitionNumber> Module=<CTImage>
Warning - Attribute is not present in standard DICOM IOD - (0x0032,0x4000) LT Study Comments
Warning - Dicom dataset contains attributes not present in standard DICOM IOD - this is a Standard Extended SOP Class

pieper

pieper

2017-02-16 12:03

administrator   ~0014341

It is probably just a matter of adding these lines (a subset of the ones from [1])

logic = DICOMPatcherLogic()
logic.addRule("GenerateMissingIDs")
logic.addRule("NormalizeFileNames")
logic.patchDicomDir(inputTestDir, outputTestDir)

To this code:

https://github.com/Slicer/Slicer/blob/master/Modules/Scripted/DICOMLib/DICOMExportScalarVolume.py#L128

[1] https://github.com/Slicer/Slicer/blob/master/Modules/Scripted/DICOMPatcher/DICOMPatcher.py#L659-L666

pieper

pieper

2017-02-16 12:07

administrator   ~0014342

Reminder sent to: lassoan

Hi @lassoan can you look at the suggested use of the DICOMPatcher in the notes here and suggest if the patcher should be used this way (i.e. if other rules should be used?) Thanks.

fedorov

fedorov

2017-02-16 12:16

developer   ~0014343

Steve, great news!

Does QuantitativeReporting work with this dataset after you patch it?

pieper

pieper

2017-02-16 12:21

administrator   ~0014344

@fedorov - yes, this fixes QuantitativeReporting as well!

I think that adding this as a suggestion in an FAQ for the QR module would be good.

fedorov

fedorov

2017-02-16 12:28

developer   ~0014345

Good idea, thanks! I added an issue here: https://www.gitbook.com/book/qiicr/quantitativereporting-guide/discussions/1

I personally never used DICOM patcher, so wanted to look into it before adding that as a suggestion.

lassoan

lassoan

2018-05-29 23:24

developer   ~0015781

Retargeting stale issues to backlog.

Issue History

Date Modified Username Field Change
2017-02-13 19:43 pieper New Issue
2017-02-13 19:43 pieper Status new => assigned
2017-02-13 19:43 pieper Assigned To => jcfr
2017-02-13 19:48 pieper Note Added: 0014331
2017-02-16 11:24 fedorov Relationship added related to 0003255
2017-02-16 11:29 fedorov Note Added: 0014339
2017-02-16 11:59 pieper Note Added: 0014340
2017-02-16 12:03 pieper Note Added: 0014341
2017-02-16 12:07 pieper Note Added: 0014342
2017-02-16 12:16 fedorov Note Added: 0014343
2017-02-16 12:21 pieper Note Added: 0014344
2017-02-16 12:28 fedorov Note Added: 0014345
2018-05-29 23:24 lassoan Target Version => backlog
2018-05-29 23:24 lassoan Note Added: 0015781