# ITK error : GDCM could not read the DICOM image showing “DicomImageReadWrite.exe has triggered a breakpoint.” error while debugging.

**URL:** https://discourse.itk.org/t/itk-error-gdcm-could-not-read-the-dicom-image-showing-dicomimagereadwrite-exe-has-triggered-a-breakpoint-error-while-debugging/2155
**Category:** Uncategorized
**Created:** [August 16, 2019, 8:52am UTC](https://discourse.itk.org/t/itk-error-gdcm-could-not-read-the-dicom-image-showing-dicomimagereadwrite-exe-has-triggered-a-breakpoint-error-while-debugging/2155 "2019-08-16T08:52:26Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![mihail.isakov](https://discourse.itk.org/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@mihail.isakov](https://discourse.itk.org/u/mihail.isakov)
#### Post date: [August 19, 2019, 9:03pm UTC](https://discourse.itk.org/t/itk-error-gdcm-could-not-read-the-dicom-image-showing-dicomimagereadwrite-exe-has-triggered-a-breakpoint-error-while-debugging/2155/5 "2019-08-19T21:03:38Z")

</div>

Interesting… That example, i took it from actual master branch Examples folder and run with arguments _IMG019 out1.dcm out2.mha out3.dcm_, seems to work for me if i comment out line:  
`writer3->SetImageIO( gdcmImageIO );`

Could you reproduce? Thanks. ( **Edit** : i don’t have DCMTKIO compiled)  
With or without setting UseInputMetaDataDictionaryOff.  
So generally GDCMIO still can write UCHAR images.

 ![qq1](https://discourse.itk.org/uploads/default/original/1X/6bae1ec7b6f5ff13acf12f7a1ec1426aa3725715.jpeg)

The problem without editing the example seems to be  
Slope=1 **Intercept=-1024**  
Where it comes from is not clear just now ( **edit** : it is from setting old gdcmImageIO, s. next post), writer takes re-scaled data and slope/intercept have to be **1/0** and function _Rescaler::InverseRescale_ should exit [here](https://github.com/InsightSoftwareConsortium/ITK/blob/0774730bc8b5ecc03fb361063cdd1ff9490d528a/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmRescaler.cxx#L304) , before the switch with assert(0).

**Edit** : BTW, _IMG019_ has rather seldom transfer syntax _Explicit VR Big Endian_, but i don’t think it is related to problems, just FYI, if someone will investigate the issue.

---

_[View the full topic](https://discourse.itk.org/t/itk-error-gdcm-could-not-read-the-dicom-image-showing-dicomimagereadwrite-exe-has-triggered-a-breakpoint-error-while-debugging/2155)._
