Comments (23)
Currently,
- It is possible to quickly and simply build a VTK/C++ features/algo/readers to WebAssembly. See the instructions at the bottom of this page.
- This can be used to generate a vtkPolyData ASCII file ArrayBuffer that could be read in vtk.js (untested). Or generated itk.js
itk/Image
could be used in vtk.js with ITKHelper.
This is the most basic functionality. There are many improvements that could be made.
- Create a vtk.js wrapper that provides
SetInputConnection
,SetOutputConnection
algorithm interface. With a few specifications of the pipeline to run and the types of the inputs and outputs, it could provide a simplified interface that works well with the current vtk.js pipelining infrastructure. Internally, it could take care of passing the data where it needs to go and executing the pipeline. @agirault has thought about this a bit. - We can add better support in itk.js and vtk.js for passing their native types to JavaScript/WebAssembly.
- We can work towards making the VTK WebAssembly smaller, which is important for performance.
- We can do other performance optimizations.
We are currently looking for ways to fund these improvements.
from vtk-js.
Cutter was added.
from vtk-js.
https://thewtex.github.io/VTKWebAssemblyExperiment/
from vtk-js.
I looked at your examples, the C++ code defines a main entry. I do not see if it will be possible to use a WebAssembly algorithm directly on the vtk-js PolyData for instance. Do you plan on building a minimal example of such feature?
We have a test / example for generating a vtk.js PolyData in a VTK C++ pipeline compiled to WebAssembly here:
https://github.com/InsightSoftwareConsortium/itk-js/tree/master/test/WriteVTKPolyDataPipeline
from vtk-js.
We are working on contouring now. Would you be willing to test?
from vtk-js.
I can try. Are the other filters also planned?
from vtk-js.
They are planned but I don't think we have a concrete date for when they will be available.
from vtk-js.
Any news on contour creation capabilities?
from vtk-js.
Contour is available on vtkImageData: https://kitware.github.io/vtk-js/examples/VolumeContour.html
from vtk-js.
Thank you @jourdain . I am also interested in manual 2D contours for region selection/annotation/segmentation, are there any demos or initiatives on this?
from vtk-js.
They are some initiatives but it is mostly work in progress without a clear timeline.
from vtk-js.
can you tell a bit more about the webassembly integration in vtkjs? what are the plans, what is the state?
from vtk-js.
@thewtex do you mind providing more inputs?
The plan is to allow users to write a piece of library in C++ that expose VTK/C++ features/algo/readers. We would provide tools to build and bundle such external
lib and allow users to integrate that lib in a JS application while using vtk.js as rendering engine.
from vtk-js.
Do you have any news about this workflow?
I looked at your examples, the C++ code defines a main entry. I do not see if it will be possible to use a WebAssembly algorithm directly on the vtk-js PolyData for instance. Do you plan on building a minimal example of such feature?
from vtk-js.
@BotellaA yes, a minimal example is desirable, but there is no current timeline for this.
from vtk-js.
I'm trying to figure out how to convert a .vtk file with an unstructured grid into something that vtk.js can visualize. Is there any tool for converting this to a POLYDATA or vtp file?
from vtk-js.
You can use ParaView
- Load your data
- Apply filter "Extract Surface"
- Save the result of the filter as vtp (append+zlib)
from vtk-js.
OK, thanks. And is there a way to view the color scale with polydata/vtp or not?
from vtk-js.
You can create an image using the lookupTable and then with some HTML elements you can make it as overlay the 3D view. We currently don't have anything inside the 3d view.
You can look at this for input on how to do it.
from vtk-js.
Thanks for your help. Unfortunately when trying to run updateColorCanvas
I get the error:
Attempting to lookup a value with no points in the function
Which makes me think my .vtp file is in the wrong format. Can Paraview be used to create .vti file folders?
from vtk-js.
ParaView will build the proper format based on your selected data (vti, vtp, ...).
I think that just means that your lookup table is not available or properly created. I don't think your file is corrupted especially if it render just fine.
from vtk-js.
I'm trying to figure out how to convert a .vtk file with an unstructured grid into something that vtk.js can visualize. Is there any tool for converting this to a POLYDATA or vtp file?
A tracking issue for this is here:
InsightSoftwareConsortium/ITK-Wasm#255
from vtk-js.
In term of filtering here is the current status:
- slice
- polydata > slice
- imagedata > image mapper (slice along i,j,k)
- image data > reslice cursor (camera driven)
- contour
- imagedata > contour
- streamlines
- imagedata > streamlines
For more complex setup, you will have to involve a server or leverage WebAssembly.
Closing for now as we are not planning to implement all of those algorithm in JS but rather enable them via WebAssembly. But we still don't have an estimate on such availability.
from vtk-js.
Related Issues (20)
- How to slice the polydata (cfd volume grid data) with vtk.js and see the grid on the slice? HOT 9
- Optimise matrices copy when multiplying in vtkMath HOT 2
- [Feature]
- [Bug] Headless Chrome - Cannot read property 'blendFuncSeparate' of null HOT 5
- [Bug] Cannot display Float32 images on iOS Safari HOT 14
- [Bug] Handling of clamped arrays? HOT 2
- [Bug] `vtkStringArray.newClone` raises error HOT 4
- [Feature] Support for LZMA vtk files HOT 5
- The vtkPLYReader parseAsText method reported an error [Bug] HOT 5
- [Bug] Incorrect interface for `insertNextPoint` on `vtkPoints` HOT 1
- STLReader and ORJReader parsing obj file with incorrect number of points[Bug]
- Middle and right mouse button interactor issue on Safari HOT 2
- [Feature] Rendering with OffscreenCanvas HOT 3
- [Bug] Issues in PR(Share GPU ressources across render windows) HOT 1
- [Bug] Memory leak in WidgetState HOT 2
- Can vtk.js read VTK files with the 'DATASET UNSTRUCTURED_GRID' format? HOT 7
- Mobile end lag issue HOT 1
- [Bug] Opacity problem on stl file when backface culling is enabled HOT 11
- [Bug] ESM doesn't work without "type": "module" in node HOT 1
- [Bug] HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vtk-js.