Coder Social home page Coder Social logo

Comments (23)

thewtex avatar thewtex commented on July 20, 2024 5

Currently,

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.

agirault avatar agirault commented on July 20, 2024 2

Cutter was added.

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024 1

https://thewtex.github.io/VTKWebAssemblyExperiment/

from vtk-js.

thewtex avatar thewtex commented on July 20, 2024 1

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

https://github.com/InsightSoftwareConsortium/itk-js/blob/26da85c0c66d3ca0a4657bfc535053757421537d/test/runPipelineNodeTest.js#L122-L152

from vtk-js.

wschroed avatar wschroed commented on July 20, 2024

We are working on contouring now. Would you be willing to test?

from vtk-js.

doczoidberg avatar doczoidberg commented on July 20, 2024

I can try. Are the other filters also planned?

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024

They are planned but I don't think we have a concrete date for when they will be available.

from vtk-js.

alfredomp avatar alfredomp commented on July 20, 2024

Any news on contour creation capabilities?

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024

Contour is available on vtkImageData: https://kitware.github.io/vtk-js/examples/VolumeContour.html

from vtk-js.

alfredomp avatar alfredomp commented on July 20, 2024

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.

jourdain avatar jourdain commented on July 20, 2024

They are some initiatives but it is mostly work in progress without a clear timeline.

from vtk-js.

doczoidberg avatar doczoidberg commented on July 20, 2024

can you tell a bit more about the webassembly integration in vtkjs? what are the plans, what is the state?

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024

@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.

BotellaA avatar BotellaA commented on July 20, 2024

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.

thewtex avatar thewtex commented on July 20, 2024

@BotellaA yes, a minimal example is desirable, but there is no current timeline for this.

from vtk-js.

anastasia-r avatar anastasia-r commented on July 20, 2024

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.

jourdain avatar jourdain commented on July 20, 2024

You can use ParaView

  1. Load your data
  2. Apply filter "Extract Surface"
  3. Save the result of the filter as vtp (append+zlib)

from vtk-js.

anastasia-r avatar anastasia-r commented on July 20, 2024

OK, thanks. And is there a way to view the color scale with polydata/vtp or not?

from vtk-js.

jourdain avatar jourdain commented on July 20, 2024

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.

anastasia-r avatar anastasia-r commented on July 20, 2024

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.

jourdain avatar jourdain commented on July 20, 2024

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.

thewtex avatar thewtex commented on July 20, 2024

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.

jourdain avatar jourdain commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.