Kitware / itk-vtk-viewer

2D / 3D web image, mesh, and point set viewer using itk-wasm and vtk.js
https://kitware.github.io/itk-vtk-viewer/
BSD 3-Clause "New" or "Revised" License
212 stars 65 forks source link

Visualising a time series of mesh-based data #327

Open timokoch opened 4 years ago

timokoch commented 4 years ago

I'm using the embedded viewer via CDN to visualise some unstructured grid data. The reader works great. Thanks for this cool tool.

However, most of my data will be time series data. I thought of using a simple solution with an external controller that allows to click through the data files and on-click changes the data-url attribute of the itk-vtk-viewer div. However that doesn't seem to trigger a reload of the source data. Also changing the data-loaded attribute back to false doesn't seem to have any effect. Moreover, for viewing time series data this way I would need to have control over some viewer option, e.g. if a certain data field was selected and the source file changes, the new data should be also loaded with the same data field enabled.

Is there a way to achieve what I'm trying to do? I saw there is a publicAPI which is not documented. Is it possible to modify the viewer using that API?

Is there a much better way to realise time-series data visualisation currently?

Any pointers are highly appreciated.

thewtex commented 4 years ago

I'm using the embedded viewer via CDN to visualise some unstructured grid data. The reader works great. Thanks for this cool tool.

Thank you for the kind words -- they are appreciated!

Is there a way to achieve what I'm trying to do? I saw there is a publicAPI which is not documented. Is it possible to modify the viewer using that API?

Yes, to update the mesh, use setGeometries. If the data is a File, readFiles may be helpful.

Is there a much better way to realise time-series data visualisation currently?

We are also adding zarr support for meshes, which allows them to be loaded quickly for time series visualization. Consider using that once available.

renefritze commented 1 year ago

Has zarr support landed yet? Is there an example time series visualization? Maybe @timokoch could share something from his experiments?

timokoch commented 1 year ago

@renefritze Looking at setGeometry and readFiles helped a lot to understand what is possible. But we ended up using vtk.js directly (plus the ITKPolyDataReader and itk/readPolyDataArrayBuffer) to realize a simple time series viewer in a react frontend (https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-web-app/-/blob/master/services/client/react-frontend/src/components/VTKViewer/index.jsx). So, unfortunately, I haven't followed up on using itk-vtk-viewer for this.

renefritze commented 1 year ago

My goal is viewing time series data in a jupyter notebook/lab setup. Your example could still be helpful if I get a ipywidgets<->vtk.js bridge working (again). So thanks for the link @timokoch !