# Python - Rendering multiple stacked vtkImageData in 2D

**URL:** https://discourse.vtk.org/t/python-rendering-multiple-stacked-vtkimagedata-in-2d/6160
**Category:** Support
**Created:** [July 9, 2021, 1:45pm UTC](https://discourse.vtk.org/t/python-rendering-multiple-stacked-vtkimagedata-in-2d/6160 "2021-07-09T13:45:10Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Birkl](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/db5fbb/32.png) [@Birkl](https://discourse.vtk.org/u/Birkl)
#### Post date: [July 9, 2021, 1:45pm UTC](https://discourse.vtk.org/t/python-rendering-multiple-stacked-vtkimagedata-in-2d/6160/1 "2021-07-09T13:45:10Z")

</div>

Hello,

Right to the point:  
I’ve got several vtkImageData stored in an array. I want to take slice from each image and render them on top of each other.  
I also need to be able to set different images active and inactive.

When I’m displaying just 1 image I’m using the vtkImageViewer2 and setting the correct slice and the position of the slice as I need it.

Now I need something similar but with several images on top of each other.  
I stumbled across the vtkImageStack during my research but it needs a vtkImageSlice as input for the AddImage and I don’t reall know how I would get that from my imageData in the correct way.  
I also don’t know how the render the resulting image from the stack into my render window.

TL;DR  
Got multiple images and need to render slices from them on top of each other. How?

Thanks for your help.  
Greatly appreciated.
