# Dicom reslice upside down problem

**URL:** https://discourse.vtk.org/t/dicom-reslice-upside-down-problem/7631
**Category:** Support
**Created:** [January 13, 2022, 2:38am UTC](https://discourse.vtk.org/t/dicom-reslice-upside-down-problem/7631 "2022-01-13T02:38:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![syj](https://discourse.vtk.org/user_avatar/discourse.vtk.org/syj/32/7253_2.png) [@syj](https://discourse.vtk.org/u/syj)
#### Post date: [January 13, 2022, 2:38am UTC](https://discourse.vtk.org/t/dicom-reslice-upside-down-problem/7631/1 "2022-01-13T02:38:12Z")

</div>

Hi guys,

I import dicom data Using vtkDICOMImageReader(). The 3-plane result is upside-down, as follows:  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/b/b268662994c5bd4f67be48e096e5a8c218be1d12.png)  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/3/3bf88e0e390696d81c7dacd0c81136dd598b808f.png)  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/d/d61d1ec028478f513997bb2a9e74914b219d488e.png)

But if I convert the DICOM files to .mha or .nii.gz, and using vtk to visualize them, there is no upside-down problem.

I have read many documents about this problem.The most related I found is the below one:  
[https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Spatial\_Coordinates](https://www.nitrc.org/plugins/mwiki/index.php/dcm2nii:MainPage#Spatial_Coordinates)  
According to this ,DICOM images are saved to disk in the order we read English: with the first line at the top of the screen and subsequent lines descending.  
It seems the reason cause the problem.

But here is my question: Is there a standard inside way to deal with this using vtk? Or we must use transform to get the volume direction right ?

Ps: I know extend dicom support using vtk-dicom, but I’m using python. As far as I kown, the package don’t support python.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [January 13, 2022, 4:07am UTC](https://discourse.vtk.org/t/dicom-reslice-upside-down-problem/7631/2 "2022-01-13T04:07:38Z")

</div>

You can try setting the FileLowerLeft flag on the reader:

```python
reader.FileLowerLeftOn()

```

This may change the slice ordering as a side-effect, however.

---

<div class="post-metadata">

### Author: ![syj](https://discourse.vtk.org/user_avatar/discourse.vtk.org/syj/32/7253_2.png) [@syj](https://discourse.vtk.org/u/syj)
#### Post date: [January 19, 2022, 6:25am UTC](https://discourse.vtk.org/t/dicom-reslice-upside-down-problem/7631/3 "2022-01-19T06:25:28Z")

</div>

> [@dgobbi](#):
>
> `FileLowerLeftOn()`

Thanks for your replay. But it seems that this does not work… Nothing changed compared to the old. Here is my code:

```auto
reader0 = vtk.vtkDICOMImageReader()
reader0.SetDirectoryName("D:\\project\\py\\slicer_-script\\lab\\Coordinate\\data\\patient1_Sorted")
reader0.Update()
reader0.FileLowerLeftOff()

```

Did I do anything wrong?

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [January 19, 2022, 3:32pm UTC](https://discourse.vtk.org/t/dicom-reslice-upside-down-problem/7631/4 "2022-01-19T15:32:20Z")

</div>

Like this:

```auto
reader0 = vtk.vtkDICOMImageReader()
reader0.SetDirectoryName("D:\\project\\py\\slicer_-script\\lab\\Coordinate\\data\\patient1_Sorted")
reader0.FileLowerLeftOn()
reader0.Update()

```
