I am using insighttoolkit/itk-js in docker and it works great for both examples mentioned there (Hello World and Median filter test). I can build javascript (as well as wasm), run it with runPipelineNode and runPipelineBrowser.
I need to use vtkItkLevelTracingImageFilter to generate vtkPolyData. However, I do not know if I can convert vtkItk Library with Emscripten to js at all.
I did a small experiment : just added #include “vtkItkLevelTracingImageFilter.h” to MedianFilterTest.cxx code and then I had error as below
Yes, it should be possible. A Docker image is provided with both ITK and VTK available, and if your CMakeList.txt contains find_package(ITK) or find_package(VTK), they will be found without any other steps required. To use this kitware/itk-js-vtk image, specify it via the itk-js CLI:
@Andrzej_Marciniak
Hi,
I am new to itk-wasm and itk.js. I want to use both in my application. i am trying NodeHelloWorld example from itk-wasm. this is what i have done:
if you read the example in the itk-wasm you would see after you do npx itk-wasm build the running docker downloads and calls itk-wasm/emscripten toolchain and build everything into web-build folder. at the last stage i have following code in index.js file:
E:\Projects\vs2019\react\ITK-JS\NodeHelloWorld_1\index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (E:\Projects\vs2019\react\ITK-JS\NodeHelloWorld_1\index.js:2:25)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions…js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
code: ‘MODULE_NOT_FOUND’,
requireStack: [ ‘E:\Projects\vs2019\react\ITK-JS\NodeHelloWorld_1\index.js’ ]
why it does not run the helloworld example in node.js? am i missing something here? should i import 'itk/runPipelineNode?
i appreciate if you send me these examples you shared with matt maccormic, I am basically image processing developer, and i need to work with web as well to build an application, so i need some median filter from itk or some segmentation or registration example.
I could not find itk.js repo? because i get forwarded to the itk-wasm?!
Hi,
I am sorry that I will not be able to help you much, but I haven’t been touching itk for over a year, and I do not remember details. Since the .js code generated by Emscripten was not meeting my performance requirements, I have decided to not use it (implement my own filters in js).
Moreover, I have never been using itk-wasm - I was just using itk v.“9.3.2”. According to what you wrote, it seems to me that you just do not have dependecies in node_modules. Please look at my package.json and package-lock.json files below - I had installed itk in node_modules with “runPipelineNode”. Maybe npm i itk
would make it work?
As I wrote, I do not remember what exactly I was doing, but I made this short instruction for myself (below you will find files) so maybe this will help:
Compilation and running of pipelines with Emscripten
Be sure that docker is running.
Use Ubuntu or git bash
cd ../WebstormProjects/nodehelloworld
Prepare CMakeLists.txt file (see examples) and execute in Ubuntu bash:
./insighttoolkit-itk-js-latest web-build
Prepare runPipelineNode (see index.js, medianTest.js) and execute for example:
npx node ./medianTest.js
or npx node ./index.js
etc.
Links
Example of segmentation pipeline written ITK / C++ (see links inside):