ITK.js

Hi all,

I’m an old ITK / VTK user (in time not age!). I was very enthusiatic when I found out ITK.js, VTK.js and the ITK-VTK-image-Viewer.js. I’m now a bit confused on what could be achieved…
VTK.js looks like a powerful visualisation toolkit for browser, ok.
Regarding ITK.js, is it actually ITK or only image importers and connector to display them into VTK.js?
Can I write advanced filters in javascript and run these in a web browser?
Thanks for enlightening me!
Laurent

Hello Laurent,

Welcome to the New Age! :new:

Yes, the new JavaScript support is extremely exciting – interactive insights in your web browser without any installation! :star2::rainbow::zap:

itk.js, vtk.js, and itk-vtk-image-viewer will be some powerful tools available to work some magic.

You will be able to harness the power of all of ITK and deliver it via the browser! In practice, you will take an ITK C++ program and build it into WebAssembly.

This functionality still needs to be finalized and documented. I will follow up on this thread when it is available…

4 Likes

@matt.mccormick
Does ITK.js provides all the image filters?

I’m interested in performing Otsu thresholding on a vtkImageData that I have. What is the best library for me to perform this calculation?

Hi @sedghi ,

Yes, ITK.js provides access to all ITK filters!

If the data is in a file itk.js can be used to read the file.

If the data is in a vtk.js vtkImageData, it can be converted to an itk.js Image with the vtk.js convertVtkToItkImage.

For Otsu thresholding download the Threshold an Imaging Using Otsu example, and build it with ITK.js:

curl -O https://itk.org/ITKExamples/src/Filtering/Thresholding/ThresholdAnImageUsingOtsu/ThresholdAnImageUsingOtsu.zip
unzip ThresholdAnImageUsingOtsu.zip
cd ThresholdAnImageUsingOtsu

npm install --global itk
itk-js build .

Then run the pipeline in the browser using the runPipelineBrowser API. More information on how to provide access to the pipeline can be found in the examples.

2 Likes

@matt.mccormick,

I am using vscode as IDE to build react in chrome or edge USING VTK.JS. I have succeeded! THANK YOU! do you think image quality is good? when enlargin the image it becomes really blury for instance in case of MultiSliceImageMapper with headsq.vti?
I have following questions:

  1. vtk.js uses vti format. is it possible to use DICOM format with vtk.js?
  2. I dont know how to huild webassembly objects. do you have a link from kitware i could use to build webassembly objects, and how to use webassembly instructions in react?

I appreciate it in advance

@sag

Hi @sag,

I am using vscode as IDE to build react in chrome or edge USING VTK.JS. I have succeeded! THANK YOU!

Fantastic!

when enlargin the image it becomes really blury for instance in case of MultiSliceImageMapper with headsq.vti?

There is work in progress for a multi-scale representation that improves rendering quality in itk-vtk-viewer that provides the optimal rendering quality based on the hardware of th eclient.

vtk.js uses vti format. is it possible to use DICOM format with vtk.js?

Use itk-wasm (the successor to itk.js) for DICOM support.

I dont know how to huild webassembly objects. do you have a link from kitware i could use to build webassembly objects, and how to use webassembly instructions in react?

itk-wasm provides the functionality you need. in recent versions, there are no extra steps required to use basic functionality in React.

HTH,
Matt