Kitware / glance

Kitware Glance is an open-source web application developed at Kitware for visualizing volumetric images, molecular structures, geometric objects, and point clouds. It is part of the ParaView platform and can serve as a foundation for building custom web-based visualization applications involving ITK.js and VTK.js.
https://kitware.github.io/glance
BSD 3-Clause "New" or "Revised" License
247 stars 87 forks source link

Change default views/transparency/etc of vtkjs/html exported from ParaView #346

Closed liangwang0734 closed 4 years ago

liangwang0734 commented 4 years ago

My goal of using Glance: Share interactive 3d visualization How I use Glance: Use the "Export Scene" feature of ParaView + Open the generated vtkjs/html file in a ParaViewGlance browser The Issue I have: Can I force some of the default behaviours of the generated vtkjs file? My experience with Glance: New user

Example behaviours I want to force:

  1. The default camera seemed to be reset so that the view looks really small in the Glance browser compared to that in a ParaView window
  2. Certain information like the transparency of plane slices is lost.
  3. Colorbar is not shown.

I tried to use the "Save State" feature of ParaViewGlance, but that takes forever to finish (the vtkjs is ~50MB).

Thank you for your suggestions.

ziqiangxu commented 4 years ago

About taking long time to "Save State", that's because of you load a file from local file system, Glance will write all data to a json object, then compress into a file with a .glance extension name, this real take much time. So try to load a file from remote, you can deploy a Girder system by yourself or try Girder on https://data.kitware.com. By this way, Glance just save a remote URL in the .glance file instead of all 3D image data showing in the browser, it will be faster when saving state.

jourdain commented 4 years ago
  1. The camera should not reset when we load from such a state. That is a bug.
  2. Transparency is not as well managed in vtk.js as depth peeling is not implemented. We should be able to capture the amount of transparency and set it back the way it was in ParaView though.
  3. Colorbar is never shown as we don't show it in the 3D view with Glance or vtk.js

FYI @floryst

liangwang0734 commented 4 years ago

About taking long time to "Save State", that's because of you load a file from local file system, Glance will write all data to a json object, then compress into a file with a .glance extension name, this real take much time. So try to load a file from remote, you can deploy a Girder system by yourself or try Girder on https://data.kitware.com. By this way, Glance just save a remote URL in the .glance file instead of all 3D image data showing in the browser, it will be faster when saving state.

Thank you. This is a useful tip.

liangwang0734 commented 4 years ago
  1. The camera should not reset when we load from such a state. That is a bug.
  2. Transparency is not as well managed in vtk.js as depth peeling is not implemented. We should be able to capture the amount of transparency and set it back the way it was in ParaView though.
  3. Colorbar is never shown as we don't show it in the 3D view with Glance or vtk.js

FYI @floryst

Thank you, Sebastien. I'll wait patiently for progress on the first two issues.

floryst commented 4 years ago

I'll look into (1) and (2). (1) is definitely a bug, and I'd have to look into (2) for image slices.

A request for clarification: when you say "certain information...is lost", are there more properties that you expect should be saved but aren't? Or is it just plane slice transparency?

liangwang0734 commented 4 years ago

Hi Forrest, for slice images, the information lost refers to the transparency.

Is it possible to consider fixing a few other issues (I can open another ticket if you prefer.):

floryst commented 4 years ago

Yeah, another ticket for those would be great. Thanks.

jourdain commented 4 years ago

:tada: This issue has been resolved in version 4.9.12 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

jourdain commented 4 years ago

FWIW, lineWidth in WebGL is a difficult thing to do as it is not supported by the standard.