# displaying imagedata and polydata in same reander

**URL:** https://discourse.vtk.org/t/displaying-imagedata-and-polydata-in-same-reander/6367
**Category:** Web
**Created:** [August 13, 2021, 2:23am UTC](https://discourse.vtk.org/t/displaying-imagedata-and-polydata-in-same-reander/6367 "2021-08-13T02:23:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ewing](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ewing/32/3795_2.png) [@Ewing](https://discourse.vtk.org/u/Ewing)
#### Post date: [August 13, 2021, 2:23am UTC](https://discourse.vtk.org/t/displaying-imagedata-and-polydata-in-same-reander/6367/1 "2021-08-13T02:23:01Z")

</div>

Hello,I want displaying imagedata and polydata in the same reander,use vtkjs.  
The effect is like this, in 3DSlicer

 ![20210813101856](https://discourse.vtk.org/uploads/default/original/2X/8/87375b043cadd5f60dc4076f11e163ba1f667301.jpeg)

but when load imagedata and polydata.I find the position of imagedata is not right.  
the imagedata and polydata not in same position,  
what should i do?  
thank you a lot

---

<div class="post-metadata">

### Author: ![zhang-qiang-github](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhang-qiang-github/32/2519_2.png) [@zhang-qiang-github](https://discourse.vtk.org/u/zhang-qiang-github)
#### Post date: [August 13, 2021, 6:58am UTC](https://discourse.vtk.org/t/displaying-imagedata-and-polydata-in-same-reander/6367/2 "2021-08-13T06:58:45Z")

</div>

You may need to print the origin/spacing/direction of your `vtkImageData` to confirm that the position of `vtkImageData` & `vtkPolyData` is the same.

---

<div class="post-metadata">

### Author: ![Ewing](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ewing/32/3795_2.png) [@Ewing](https://discourse.vtk.org/u/Ewing)
#### Post date: [August 19, 2021, 10:39am UTC](https://discourse.vtk.org/t/displaying-imagedata-and-polydata-in-same-reander/6367/3 "2021-08-19T10:39:09Z")

</div>

origin is same,[0,0,0]  
vtkPolyData no spacing  
vtkImageData direction is [1,0,0,0,1,0,0,0,1]

 ![WX20210819-183816@2x](https://discourse.vtk.org/uploads/default/original/2X/7/7ddcd8886c9c8d3efa95a165766890182f7a9251.jpeg)

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dzenanz/32/212_2.png) [@dzenanz](https://discourse.vtk.org/u/dzenanz)
#### Post date: [August 19, 2021, 10:07pm UTC](https://discourse.vtk.org/t/displaying-imagedata-and-polydata-in-same-reander/6367/4 "2021-08-19T22:07:59Z")

</div>

Older versions of Slicer use [RAS orientation](https://www.slicer.org/wiki/Coordinate_systems), which is different from LPS usually used by medical images. I think that current nightlies use LPS by default. You might need to have RAS to LPS transform applied to your mesh before exporting it from Slicer.

---

<div class="post-metadata">

### Author: ![Ewing](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ewing/32/3795_2.png) [@Ewing](https://discourse.vtk.org/u/Ewing)
#### Post date: [August 20, 2021, 2:56am UTC](https://discourse.vtk.org/t/displaying-imagedata-and-polydata-in-same-reander/6367/5 "2021-08-20T02:56:43Z")

</div>

I find the problem.  
I use vedo(python lib,really powerful) to convert slicerimage data from nii.gz to vti  
and use 3DSlicer convert polydata from nii.gz to obj.  
so the mistake happened,  
I only use vedo get vti and obj file,the problem is solved.

 ![WX20210820-105605@2x](https://discourse.vtk.org/uploads/default/original/2X/8/8e150f944eb9e860bce20a71165c7ee6c9bbcc56.jpeg)

thinks!
