# \[sitk.ImageFileWriter()\] Unable to read a saved image when moved to a different location

**URL:** <https://discourse.itk.org/t/sitk-imagefilewriter-unable-to-read-a-saved-image-when-moved-to-a-different-location/3560>\
**Category:** Uncategorized\
**Tags:** simpleitk\
**Created:** [October 22, 2020, 12:07pm UTC](https://discourse.itk.org/t/sitk-imagefilewriter-unable-to-read-a-saved-image-when-moved-to-a-different-location/3560 "2020-10-22T12:07:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmody](https://discourse.itk.org/user_avatar/discourse.itk.org/pmody/32/1757_2.png) [@pmody](https://discourse.itk.org/u/pmody)\
**Post date:** [October 22, 2020, 12:07pm UTC](https://discourse.itk.org/t/sitk-imagefilewriter-unable-to-read-a-saved-image-when-moved-to-a-different-location/3560/1 "2020-10-22T12:07:14Z")

</div>

Hi,  
I save a file with _.mha_ extension as follows.

> writer = sitk.ImageFileWriter()  
> writer.SetFileName(filepath)  
> writer.SetUseCompression(compression)  
> writer.Execute(data)

**Problem**

- I am able to read the file via `sitk.ImageFileReader()` and also load it into 3D Slicer/MeVisLab.
- But weirdly, when I move the file to another file location, I am unable to read the file using all the the three method mentioned above. I suspect the problem is with `writer.SetFileName()`, but I could not find any relevant issues/documentation to back this claim.

**Platform**

- Windows 10
- sitk. **version** == 2.0.0

---

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [October 22, 2020, 1:31pm UTC](https://discourse.itk.org/t/sitk-imagefilewriter-unable-to-read-a-saved-image-when-moved-to-a-different-location/3560/2 "2020-10-22T13:31:01Z")

</div>

Hello @pmody,

Given that you are working on windows I suspect there are unique characters (non ascii) in the file path and that this isn’t an issue with the writing itself.

Below is simplified code for writing that you can try:

```auto
import SimpleITK as sitk

sitk.WriteImage(sitk.GaussianSource(), 'gauss.mha')

```
