vtk.js in medical image processing

Hi, I have a question with vtk.js in medical image processing. vtk.js has a powerful image display function. But for processing medical images like segmentation on the web, is this feasible? When we develop desktop software, sometimes we can find the API provided by ITK. However, for web software, I don’t know how to achieve. Can anyone answer my confusion or have a better solution? Any suggestions will be helpful.

vtk.js works well with itk.js (ITK => WebAssembly). @agirault @Forrest might be able to provide more informations.

Following up on this. You can check out itk.js, but note that currently you must do some extra development to bring ITK filters into the web world. If you’re interested in that, then I can provide some more concrete examples.

There isn’t much in the way of performing segmentations in the web. I would instead take a client-server model if that suits your needs. If you must perform segmentation in the web, then I would try the itk.js approach outlined above.

Hi, Forrest. Thanks for your reply. As a beginner, any example is helpful for me. And I noticed the paraview-glance realized the median filter. Did it use itk.js to build js files from c++? Additionally, does the “extra development” mean we need to refactor the code which can run correctly in the environment of c++?

About the client-server model, this may be what I am trying recently! I tried to use Vue to build client app and run the sever written in python. Such as regional growth, maybe I can send the seed points obtained on the web to sever and do some process with the help of toolkit like SimpleITK, and then feedback the data to client? I’m not sure if this is reasonable.

Yes, itk.js is used to cross-compile the C++ code into js. The “extra development” is merely some extra boilerplate code to call ITK C++ code from javascript. The median filter in ParaView Glance is a good example of such.

This is a good starting approach! You can always do this way and try itk.js cross-compiled filters at a later point.

Can you provide the link to the examples?
I want to apply something like the imageGaussain smoothing function on the output which I receive from Itk before I send it to vtk. But I couldn’t figure out how can I achieve that.
In this link: Examples | itk-js I couldn’t find much example or help.
If you any helpful example. Please suggest me
Thank you!

@thewtex will know more about how to do this. In the meantime, check out the Hello World, which generates a custom WASM bundle. I don’t think itk.js exposes filters just yet, so you’ll have to essentially write a small C++ program that does it (similar to the command line), compile it to WASM, and then use that in your web application.