# Integrate itk-wasm with VTK example

**URL:** https://discourse.itk.org/t/integrate-itk-wasm-with-vtk-example/5101
**Category:** Beginner Questions
**Created:** [June 17, 2022, 7:17am UTC](https://discourse.itk.org/t/integrate-itk-wasm-with-vtk-example/5101 "2022-06-17T07:17:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Albers\_Steven](https://discourse.itk.org/user_avatar/discourse.itk.org/albers_steven/32/2763_2.png) [@Albers\_Steven](https://discourse.itk.org/u/Albers_Steven)
#### Post date: [June 17, 2022, 7:17am UTC](https://discourse.itk.org/t/integrate-itk-wasm-with-vtk-example/5101/1 "2022-06-17T07:17:10Z")

</div>

I want to try VTK C++ [ClipUnstructuredGridWithPlane](https://kitware.github.io/vtk-examples/site/Cxx/UnstructuredGrid/ClipUnstructuredGridWithPlane/) example with itk-wasm just like [Hello World](https://wasm.itk.org/examples/hello_world.html) `hello.cxx`.

After download ClipUnstructuredGridWithPlane example file and npm install itk-wasm globel. I run `itk-wasm build` in that folder. But i got this error `ClipUnstructuredGridWithPlane: Unable to find the VTK build folder.`.

 ![image](https://discourse.itk.org/uploads/default/original/2X/6/6e2289961110889e8967d938c721578fd98ed4af.png)

this is because in c++ file, it will detect if VTK is installed. Code is blow.

 ![image](https://discourse.itk.org/uploads/default/original/2X/a/aa8d5a9f2111bf34d85550143db41ce49821286e.png)

So, I try `itk-wasm build` with some args to tell where my vtk directory is. But still the problem occur.

 ![image](https://discourse.itk.org/uploads/default/original/2X/4/4d0eceba40b278644a2b69c7d4bb5cfd5a720674.png)

And I see when `itk-wasm build`, it will start a docker progress. So i want to know how do i pass my environment setup to build?

---

<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: [June 27, 2022, 11:44am UTC](https://discourse.itk.org/t/integrate-itk-wasm-with-vtk-example/5101/2 "2022-06-27T11:44:37Z")

</div>

Does the C++ version of the example build correctly on your machine? You need to get that working first. There is a warning about AMD64 vs ARM64 platform mismatch. I suggest starting there.

---

<div class="post-metadata">

### Author: ![sag](https://discourse.itk.org/user_avatar/discourse.itk.org/sag/32/2041_2.png) [@sag](https://discourse.itk.org/u/sag)
#### Post date: [July 19, 2022, 2:11pm UTC](https://discourse.itk.org/t/integrate-itk-wasm-with-vtk-example/5101/3 "2022-07-19T14:11:43Z")

</div>

@Albers_Steven , @dzenanz  
firstly i would check that if itkwasm/emscripten is pulled down by your docker-desktop.

> docker images  
> the above will give you list of docker images in your system linux/amd64, itkwasm/emscripten is the toolchain called by itk-wasm build and start building your project and translating it to webassembly module , per experts javascript language.

1. vscode EDI terminal check the itk-wasm is installed. npm ls will give you that.
2. do you have vtk installed on your system and all the necessary paths setup in linux.  
please post your cmake file(ask @dzenanz do you need VTK installed on you machine?)  
here is the itkwasm/emscripten toolchain image. you must have it other wise build fails  
 ![itk-wasm-docker-images](https://discourse.itk.org/uploads/default/original/2X/c/c1c0a4f36e61ec0c97b0b08b631330939847611d.png)

p.s: i have built another example under wsl/ubuntu but it crashes when i run it. so i am ahead of you but still not working, i just posted a big question on ITK discussion forum and i am confused how itk-wasm really works for itk pipelines we write. i tried add noise to binary image example and it is built but crashing. refer to my question i posted it one hour ago
