VTK WebAssembly Experiment

logo

Performance of VTK isosurface contouring algorithms in the browser as of 2018-03-30.

Sources on GitHub

ImageMarchingCubes vtk.jsMedicalDemo1 asm.jsMedicalDemo1 wasmFlyingEdges asm.jsFlyingEdges wasmGenerateModelsFromLabels asm.jsGenerateModelsFromLabels wasmITK pipeline asm.jsITK pipeline wasm02000400060008000
File Size (KB) - Smaller is BetterFile size (KB)
0100020003000400050006000GenerateModelsFromLabels Linux Native BinaryGenerateModelsFromLabels Linux Chrome 65.0.3325.162 First RunGenerateModelsFromLabels Linux Chrome 65.0.3325.162 Second RunGenerateModelsFromLabels Linux Chrome 65.0.3325.162 ExecutionGenerateModelsFromLabels Linux Firefox 59.0.1 First RunGenerateModelsFromLabels Linux Firefox 59.0.1 Second RunGenerateModelsFromLabels Linux Firefox 59.0.1 ExecutionFlyingEdges Linux Native BinaryFlyingEdges Linux Chrome 65.0.3325.162 First RunFlyingEdges Linux Chrome 65.0.3325.162 Second RunFlyingEdges Linux Chrome 65.0.3325.162 ExecutionFlyingEdges Linux Firefox 59.0.1 First RunFlyingEdges Linux Firefox 59.0.1 Second RunFlyingEdges Linux Firefox 59.0.1 ExecutionMedicalDemo1 Linux Native BinaryMedicalDemo1 Linux Chrome 65.0.3325.162 First RunMedicalDemo1 Linux Chrome 65.0.3325.162 Second RunMedicalDemo1 Linux Chrome 65.0.3325.162 ExecutionMedicalDemo1 Linux Firefox 59.0.1 First RunMedicalDemo1 Linux Firefox 59.0.1 Second RunMedicalDemo1 Linux Firefox 59.0.1 ExecutionImageMarchingCubes Linux Chrome 65.0.3325.162 ExecutionImageMarchingCubes Linux Firefox 59.0.1 Execution
Timing (milliseconds) - Lower is BetterDuration (ms)

Execute the Pipelines in Your Browser!

Input volume

MedicalDemo1

Based on VTKExamples MedicalDemo1.



FlyingEdges

Based on vtkFlyingEdges3D.



GenerateModelsFromLabels

Based on VTKExamples GenerateModelsFromLabels. Run with this input volume.



To build a VTK pipeline to JavaScript and WebAssembly:

1. Install Node.js

2. Install Docker

3. Add the itk-js script to your PATH with: npm install -g itk

4. Download and unpack a VTK Example

5. Remove rendering code from the sources (which can otherwise remain unmodified), and add calls to web_add_executable and web_target_link_libraries in the CMakeLists.txt.

6. In a bash shell: itk-js build -i kitware/itk-js-vtk /path/to/VTK/Example/Source

vjk.js vtkImageMarchingCubes

To test the handwritten ImageMarchingCubes JavaScript implementation, load this volume in ParaView Glance. Open the browser developer console (Ctrl + Shift + I), and run the Contour Filter on the volume with Contour Value set to 500 and Compute Normals and Merge Points enabled.