InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.43k stars 666 forks source link

BUG: some DICOM files crash GDCMIO (and Slicer, ITK-Snap, etc) #851

Closed issakomi closed 5 years ago

issakomi commented 5 years ago

Particular DICOM files crash GDCMIO and related applications. To reproduce crash drag-and-drop a file onto Slicer window or ITK-Snap. Here is trivial test.

Particular files has Bits Allocated 16 and Bits Stored 8. Crash happens because here pixel type is taken from gdcm::Rescaler without check of intercept and slope values ("are they different from 1 / 0?"). And here re-scale is applied only if intercept and slope are different from 1 / 0. gdcm::Rescaler returns UINT8 for the files, even if slope = 1 and intercept = 0. The bug is very old, at least 5 years.

Here is patch

Just close the issue if don't want fix, i don't rely on this code. Thanks.

FYI @malaterre

dzenanz commented 5 years ago

Can the linked images be added to a unit test?

issakomi commented 5 years ago

They are public, i hope, AFAIK from old DCMTK demo CD, also available here https://www.creatis.insa-lyon.fr/~jpr/PUBLIC/gdcm

in _gdcmSampleData/Philips_Medical_Images/Integris_H_3_V11 folder, but compressed (.Z)

issakomi commented 5 years ago

Obviously no interest, closing

dzenanz commented 5 years ago

The automatic "timeout" for no interest is set to warn after 3 months, and close after 6. 13 days is a bit aggressive, in my opinion.