# Unable to write dicom file with double values

**URL:** <https://discourse.itk.org/t/unable-to-write-dicom-file-with-double-values/2299>\
**Category:** Beginner Questions\
**Created:** [October 4, 2019, 10:30am UTC](https://discourse.itk.org/t/unable-to-write-dicom-file-with-double-values/2299 "2019-10-04T10:30:44Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Hasna\_R](https://discourse.itk.org/user_avatar/discourse.itk.org/hasna_r/32/1020_2.png) [@Hasna\_R](https://discourse.itk.org/u/Hasna_R)\
**Post date:** [October 9, 2019, 10:23am UTC](https://discourse.itk.org/t/unable-to-write-dicom-file-with-double-values/2299/10 "2019-10-09T10:23:33Z")

</div>

Thank you for the information.  
Now i am trying to add header tag data for rescale intercept . The writer is throwing exception.

```nohighlight
Unhandled Exception: System.Runtime.InteropServices.SEHException: External component has thrown an exception.
   at itk.ImageFileWriter<itk::Image<short,2> >.GenerateData(ImageFileWriter<itk::Image<short\,2> >* ) in C:\ITK_4.13_x86_vs17\ITK\include\ITK-4.13\itkImageFileWriter.hxx:line 429
   at itk.ImageFileWriter<itk::Image<short,2> >.Write(ImageFileWriter<itk::Image<short\,2> >* ) in C:\ITK_4.13_x86_vs17\ITK\include\ITK-4.13\itkImageFileWriter.hxx:line 363
   at itk.ImageFileWriter<itk::Image<short,2> >.Update(ImageFileWriter<itk::Image<short\,2> >* ) in C:\ITK_4.13_x86_vs17\ITK\include\ITK-4.13\itkImageFileWriter.h:line 165

```

This is the code

```auto
using DictionaryType = itk::MetaDataDictionary; 
	DictionaryType& dictionary = inputImage->GetMetaDataDictionary();

 std::string rescaleIntercept("0028|1052");
		std::string rescaleInterceptValue("0");
		itk::EncapsulateMetaData<std::string>(dictionary, rescaleIntercept, rescaleInterceptValue);

		std::string rescaleSlope("0028|1053");
		std::string rescaleSlopeValue("1000");
		itk::EncapsulateMetaData<std::string>(dictionary, rescaleSlope, rescaleSlopeValue);

```

I am not able to update only these two tags. Along with it i changed 2 more tags (“0008|0016” and 0018|6032) .Those are getting updated. But not rescale tags.  
Any help is appreciated.

Thanks & Regards  
Hasna

---

_[View the full topic](https://discourse.itk.org/t/unable-to-write-dicom-file-with-double-values/2299)._
