# Errors on a very simple ITK+VTK+Qt program

**URL:** https://discourse.vtk.org/t/errors-on-a-very-simple-itk-vtk-qt-program/2169
**Category:** Support
**Created:** [November 27, 2019, 4:53pm UTC](https://discourse.vtk.org/t/errors-on-a-very-simple-itk-vtk-qt-program/2169 "2019-11-27T16:53:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![BorisM](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/c0e974/32.png) [@BorisM](https://discourse.vtk.org/u/BorisM)
#### Post date: [November 27, 2019, 4:53pm UTC](https://discourse.vtk.org/t/errors-on-a-very-simple-itk-vtk-qt-program/2169/1 "2019-11-27T16:53:37Z")

</div>

I am new to ITK/VTK programming.  
I have written a very simple program using ITK,VTK and Qt, inspired from VTK examples (mainly Examples/GUI/Qt/FourPaneViewer). It simply allows to visualize a 3D image, loaded via ITK.

I would like to be able to load the image via an “open file” menu entry for example and thus build/show the VTK/Qt machinery without having an image yet.  
But if I do not load an image at construction, I get the errors:

> ERROR: In /home/mansenca/tools/VTK-8.2.0/Common/ExecutionModel/vtkDemandDrivenPipeline.cxx, line 709  
> vtkCompositeDataPipeline (0x55f5b43cfc50): Input port 0 of algorithm vtkImageMapToWindowLevelColors(0x55f5b4361d40) has 0 connections but is not optional.

I have a repository that reproduces my problem here:

> **[GitHub - BorisMansencal/SimpleItkVtkQtTest](https://github.com/BorisMansencal/SimpleItkVtkQtTest)**
>
> Contribute to BorisMansencal/SimpleItkVtkQtTest development by creating an account on GitHub.

If I execute this program without an image as parameter, I get these errors.  
If I pass a valid 3D image as parameter, I don’t get these errors.

Tested with:  
Ubuntu 18.04.3  
gcc 7.4.0  
cmake 3.13.4  
InsightToolkit 5.0.1  
VTK 8.2.0  
Qt 5.9.5

What’s wrong with my code ?

I have found several (very old) threads on the old mailing list with the same problems, but they do not give the solution.

Thanks,  
Boris.
