# How to run examples from https://itk.org/Wiki/ITK/Examples where we need both ITK and VTK?

**URL:** <https://discourse.itk.org/t/how-to-run-examples-from-https-itk-org-wiki-itk-examples-where-we-need-both-itk-and-vtk/1674>\
**Category:** Uncategorized\
**Created:** [March 15, 2019, 6:23pm UTC](https://discourse.itk.org/t/how-to-run-examples-from-https-itk-org-wiki-itk-examples-where-we-need-both-itk-and-vtk/1674 "2019-03-15T18:23:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![EE18D504\_SINDHURA\_C](https://discourse.itk.org/letter_avatar_proxy/v4/letter/e/b3f665/32.png) [@EE18D504\_SINDHURA\_C](https://discourse.itk.org/u/EE18D504_SINDHURA_C)\
**Post date:** [March 15, 2019, 6:23pm UTC](https://discourse.itk.org/t/how-to-run-examples-from-https-itk-org-wiki-itk-examples-where-we-need-both-itk-and-vtk/1674/1 "2019-03-15T18:23:36Z")

</div>

I wanted to try the examples from [https://itk.org/Wiki/ITK/Examples](https://itk.org/Wiki/ITK/Examples).  
This needs "ITK-VTK glue " to be built. I am not understanding how to do this.  
I have installed ITK and tried executing a few examples.  
Do I need to download VTK separately and then install ITK-VTK glue?

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [March 15, 2019, 6:33pm UTC](https://discourse.itk.org/t/how-to-run-examples-from-https-itk-org-wiki-itk-examples-where-we-need-both-itk-and-vtk/1674/2 "2019-03-15T18:33:55Z")

</div>

You need to download and build VTK. Then configure ITK with `Module_ITKVtkGlue` **ON**. It is **OFF** by default. You will also need to set a path for `VTK_DIR`. Finally compile ITK. Then the few classes from [ITKVtkGlue module](https://itk.org/Doxygen/html/group__ITKVtkGlue.html) should be available.

---

<div class="post-metadata">

**Author:** ![EE18D504\_SINDHURA\_C](https://discourse.itk.org/letter_avatar_proxy/v4/letter/e/b3f665/32.png) [@EE18D504\_SINDHURA\_C](https://discourse.itk.org/u/EE18D504_SINDHURA_C)\
**Post date:** [March 16, 2019, 4:14am UTC](https://discourse.itk.org/t/how-to-run-examples-from-https-itk-org-wiki-itk-examples-where-we-need-both-itk-and-vtk/1674/3 "2019-03-16T04:14:55Z")

</div>

I have configured ITK , VTK and then configured ITKVTKGlue on top of it.  
I tried executing an example from [https://itk.org/Wiki/ITK/Examples/EdgesAndGradients/SobelEdgeDetectionImageFilter](https://itk.org/Wiki/ITK/Examples/EdgesAndGradients/SobelEdgeDetectionImageFilter)  
After building it, I tried debugging, But the error is shown as below. What can it be about?

 ![image](https://discourse.itk.org/uploads/default/original/1X/cea1d1826f66bc0cc0c86483491c43d22f69a208.png)

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [March 18, 2019, 3:16pm UTC](https://discourse.itk.org/t/how-to-run-examples-from-https-itk-org-wiki-itk-examples-where-we-need-both-itk-and-vtk/1674/4 "2019-03-18T15:16:01Z")

</div>

You need to add VTK’s bin folder [to the path](https://www.google.com/search?q=add+folder+to+path+windows) so the DLLs are found. Or build VTK as static libraries by setting `BUILD_SHARED_LIBS` to **OFF** in CMake configuration of VTK.

---

<div class="post-metadata">

**Author:** ![Neptilo](https://discourse.itk.org/user_avatar/discourse.itk.org/neptilo/32/1397_2.png) [@Neptilo](https://discourse.itk.org/u/Neptilo)\
**Post date:** [April 20, 2020, 10:08am UTC](https://discourse.itk.org/t/how-to-run-examples-from-https-itk-org-wiki-itk-examples-where-we-need-both-itk-and-vtk/1674/5 "2020-04-20T10:08:23Z")

</div>

Hello @dzenanz . I’m also struggling to use ITK-VTK glue. I did everything you described but everytime I add a `Module_ITKVtkGlue` boolean set to **ON** in the CMake configuration, it gets removed when the configuration completes.

I have also tried with the `ITK_BUILD_DEFAULT_MODULES` option turned off, and also with the `ITKGroup_Bridge` option turned on…

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [April 20, 2020, 1:12pm UTC](https://discourse.itk.org/t/how-to-run-examples-from-https-itk-org-wiki-itk-examples-where-we-need-both-itk-and-vtk/1674/6 "2020-04-20T13:12:41Z")

</div>

Maybe another option requires it, so it is hidden because it has to be `ON`? Have you tried going through with generation, compilation and trying to use it in your example? VTKGlue might be turn on.
