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

I wanted to try the examples from 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?

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 should be available.

2 Likes

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
After building it, I tried debugging, But the error is shown as below. What can it be about?

You need to add VTK’s bin folder to the path so the DLLs are found. Or build VTK as static libraries by setting BUILD_SHARED_LIBS to OFF in CMake configuration of VTK.

1 Like

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…

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.