# ImageSeriesWriter in rare cases writes image position (0020,0032) incorrectly

**URL:** <https://discourse.itk.org/t/imageserieswriter-in-rare-cases-writes-image-position-0020-0032-incorrectly/2839>\
**Category:** Engineering\
**Tags:** dicom, gdcmimageio, itk-4122\
**Created:** [March 17, 2020, 9:32am UTC](https://discourse.itk.org/t/imageserieswriter-in-rare-cases-writes-image-position-0020-0032-incorrectly/2839 "2020-03-17T09:32:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![svg](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/e68b1a/32.png) [@svg](https://discourse.itk.org/u/svg)\
**Post date:** [March 17, 2020, 9:32am UTC](https://discourse.itk.org/t/imageserieswriter-in-rare-cases-writes-image-position-0020-0032-incorrectly/2839/1 "2020-03-17T09:32:10Z")

</div>

Hi

Over the last year or so I have, on some machines using ITK, run into troubles regarding the image position header being written incorrectly.

Short example of the problem:  
I use the ImageSeriesWriter to write 2D images from a 3D image. In order to add the correct image positions to each 2D image I add that header to the metadata dictionary. You know like all the examples and guides tell you to do 🙂 . Almost all of the time it works perfectly and the image position gets written correct. However, on some ubuntu machines the header gets written incorrectly ALL of the time.

- \*\*Correct header: \*\* (0020,0032) ?? (DS) [-119.013374328613-125.03343963623-26.4799346923828] # 52,3 Image Position (Patient)

- \*\*Incorrect header: \*\* (0020,0032) ?? (DS) [-119\4.44659081257122e-323\3.93542391372225e-62] # 48,3 Image Position (Patient)

As you can see y and z positions are incorrectly set to zero. I have been trying to locate the error for a while know and there seems to be no posts about it for the last two years. However, there seems to be older post (such as [https://itk.org/pipermail/insight-users/2011-August/042224.html](https://itk.org/pipermail/insight-users/2011-August/042224.html)) reporting similar issues. But because ITK (I guess) has moved to github I cannot read the bugfix commits or comments to check if I am affected by the same issue.

Does anyone know if this old bug has been fixed or has some inputs for me 🙂?

best regards,  
Simon
