# why I can't include header file 'itkVTKImageToImageFilter.h'

**URL:** https://discourse.vtk.org/t/why-i-cant-include-header-file-itkvtkimagetoimagefilter-h/10076
**Category:** Support
**Tags:** code
**Created:** [December 5, 2022, 7:23pm UTC](https://discourse.vtk.org/t/why-i-cant-include-header-file-itkvtkimagetoimagefilter-h/10076 "2022-12-05T19:23:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Sterben\_01](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sterben_01/32/6142_2.png) [@Sterben\_01](https://discourse.vtk.org/u/Sterben_01)
#### Post date: [December 5, 2022, 7:23pm UTC](https://discourse.vtk.org/t/why-i-cant-include-header-file-itkvtkimagetoimagefilter-h/10076/1 "2022-12-05T19:23:23Z")

</div>

Hi!  
I want to convert `vtkImageData` to `itk::Image`, so I found a class called `itk::VTKImageToImageFilter`

But after I included the header file `include <itkVTKImageToImageFilter.h>`, it pops some error like ：

```auto
/home/zhaoz22/Desktop/FINAL/src/Butterworth.cxx:19:10: fatal error: itkVTKImageToImageFilter.h: No such file or directory
   19 | #include <itkVTKImageToImageFilter.h>
      | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/Butterworth.dir/build.make:63: CMakeFiles/Butterworth.dir/Butterworth.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/Butterworth.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

```

This is my CMakeList：

```auto
cmake_minimum_required(VERSION 3.16)
project (Butterworth)

find_package (VTK REQUIRED)
find_package (ITK REQUIRED)

include (${ITK_USE_FILE})
include (${VTK_USE_FILE})
add_executable (Butterworth Butterworth.cxx)

target_link_libraries (Butterworth ${VTK_LIBRARIES})
target_link_libraries (Butterworth ${ITK_LIBRARIES})

```

---

<div class="post-metadata">

### Author: ![fab672000](https://discourse.vtk.org/user_avatar/discourse.vtk.org/fab672000/32/5808_2.png) [@fab672000](https://discourse.vtk.org/u/fab672000)
#### Post date: [December 5, 2022, 8:11pm UTC](https://discourse.vtk.org/t/why-i-cant-include-header-file-itkvtkimagetoimagefilter-h/10076/2 "2022-12-05T20:11:07Z")

</div>

Also a beginner with VTK but was lucky to be already there once:

You need to build ITK (or get a version of ITK that has) with the option named: ITKVtkGlue (change it to ON).  
Once you do you need to add the ITKVTK.lib as well to your build options for your linker.

---

<div class="post-metadata">

### Author: ![Sterben\_01](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sterben_01/32/6142_2.png) [@Sterben\_01](https://discourse.vtk.org/u/Sterben_01)
#### Post date: [December 5, 2022, 8:14pm UTC](https://discourse.vtk.org/t/why-i-cant-include-header-file-itkvtkimagetoimagefilter-h/10076/3 "2022-12-05T20:14:52Z")

</div>

Thank you but could you please provide some details?

---

<div class="post-metadata">

### Author: ![fab672000](https://discourse.vtk.org/user_avatar/discourse.vtk.org/fab672000/32/5808_2.png) [@fab672000](https://discourse.vtk.org/u/fab672000)
#### Post date: [December 5, 2022, 8:25pm UTC](https://discourse.vtk.org/t/why-i-cant-include-header-file-itkvtkimagetoimagefilter-h/10076/4 "2022-12-05T20:25:19Z")

</div>

You just need to add to your cmake build of ITK: the build option : -DITKVtkGlue=ON or use cmake\_gui and check the Module\_ITKVtkGlue ON.

You’ll find more details [here](https://discourse.itk.org/t/build-itk-with-itk-vtk-glue/2521)

There is also a getting started powerpoint presentation I found [here](https://www.na-mic.org/w/img_auth.php/e/ed/Insight-VTK.ppt)

If still you need more details and/or you’re not confortable with customizing itk + vtk, kitware offers great support [here](https://vtk.org/contact-us/)
