# ImageToVTKImageFilter usage in python

**URL:** https://discourse.itk.org/t/imagetovtkimagefilter-usage-in-python/1023
**Category:** Beginner Questions
**Tags:** python
**Created:** [June 21, 2018, 9:47am UTC](https://discourse.itk.org/t/imagetovtkimagefilter-usage-in-python/1023 "2018-06-21T09:47:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Edern\_Haumont](https://discourse.itk.org/letter_avatar_proxy/v4/letter/e/a9adbd/32.png) [@Edern\_Haumont](https://discourse.itk.org/u/Edern_Haumont)
#### Post date: [June 21, 2018, 9:47am UTC](https://discourse.itk.org/t/imagetovtkimagefilter-usage-in-python/1023/1 "2018-06-21T09:47:55Z")

</div>

Good morning,  
I am back with another (potentially trivial for a non-beginner) problem !

I have an image read by a ImageSeriesReader.  
Now I want to pass it through an ImageToVTKImageFilter to get an ImageData and apply some transforms, visualize it, etc.

The thing is, the output of my ImageToVTKImageFilter is always None.

What I did so far:

- I checked hat the input image is valid by writing it as a vtk file and visualizing it in paraview.
- I tried to create manually an image and pass it instead as the input. Same result.
- I printed the filter and got the output you can see below

ImageToVTKImageFilter (0x1920120)  
RTTI typeinfo: itk::ImageToVTKImageFilter\<itk::Image\<short, 3u\> \>  
Reference Count: 1  
Modified Time: 1784  
Debug: Off  
Object Name:  
Observers:  
none  
Inputs:  
Primary: (0)  
Indexed Inputs:  
0: Primary (0)  
No Required Input Names  
NumberOfRequiredInputs: 0  
Outputs:  
Primary: (0)  
Indexed Outputs:  
0: Primary (0)  
NumberOfRequiredOutputs: 0  
Number Of Threads: 8  
ReleaseDataFlag: Off  
ReleaseDataBeforeUpdateFlag: On  
AbortGenerateData: Off  
Progress: 0  
Multithreader:  
RTTI typeinfo: itk::PoolMultiThreader  
Reference Count: 1  
Modified Time: 1783  
Debug: Off  
Object Name:  
Observers:  
none

Here is the piece of code not working:  
itkToVtkFilter = itk.ImageToVTKImageFilter[ImageType].New()  
itkToVtkFilter.SetInput(image)  
itkToVtkFilter.Update()  
volume = itkToVtkFilter.GetOutput()

Do you have an idea of what is wrong here ?  
Thanks a lot.  
Edern
