itk-wasm wasi build for c++ program

@matt.mccormick , @dzenanz ,

Hi,

I need help to link hdf5 libraries of ITK-5.2.1/ITK-5.3 to a itk-wasm/wasi build. It seems to complain about hdf5 libraries.

  1. the c++ code: include <itkImageFileReader.h> causes the fdh5 link error. seems cannot find relevant libraries. please refer to cmake file and you will see i have do my bes to link those libraries into the HelloWorld final executable project.

  1. the below picture is result of build command using itk-wasm for wasi build!

  2. is the cmake file for the c++ program build.

  3. this is the list of file and folder in the PROJECT_SOURCE_DIR. I copied ITK/include & ITK/lib OF THE BUILD ITK TOOLKIT INTO MY PROJECT. THUS , you would understand the CMake file. still i am getting weird build failure like itk-wasm/itkwasi does not understand thecmake file how to build this.
    Note: when i remove <itkImageFileReader.h> header with the c++ program everything compiles just fine because HDF5 libriaris not linked into the final HelloWorld project.!?

node -v : v18.4.0
npm -v : 8.12.1

what is it that i am doing wrong. Any help appreciate

regards,
@sag

Hi @sag,

The CMake configuration code should only need,

find_package(ITK REQUIRED)
include(${ITK_USE_FILE})

[...]

target_link_libraries(${PROJECT_NAME} ${ITK_LIBRARIES})

However, when reading an image with itk-wasm, you want to use itk::wasm::Pipeline and itk::wasm::InputImage. Please review this example that provides more documentation:

1 Like

@matt.mccormick, @dzenanz
Hi,

Thank you matt i just could try both wasi and wasm project for hellopipeline and MedianImageFilter. Both worked like a charm. I also checked out new commitments in ITK-WASM and it is very useful and nice.
@matt.mccormick & @dzenanz appreciate the effort. I am wondering do you have any links for articles or docs that can help me to understand pipeline mechanism in both wasi and node.js.

BR
@sag

1 Like

@sag great to hear, thanks for testing!

There is not yet a journal article, but we are working towards it.