Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vtk various enhancements #606

Merged
merged 19 commits into from Sep 30, 2019
Merged

Vtk various enhancements #606

merged 19 commits into from Sep 30, 2019

Conversation

xavArtley
Copy link
Collaborator

@xavArtley xavArtley commented Aug 20, 2019

This PR corrects several bugs and add new fonctionnalities.
Bug fixes:

New:

  • serialization_policy (define when the serialization of the scene happened): in pyvista no need to set auto_close to false anymore since the new default behavior is to serialize the scene when the panel is created and not displayed pyvista/pyvista#364

  • orientation_widget: widget in the 3D view showing the orientation of the scene. Can be clicked to rotate along orthographic views (display is controled with orientation_widget=True|False)
    image

  • possibility to display colorbars of the objects renderer in the scene (added in doc):
    image

  • VTKVolume panel: The VTK panel represent objects by extracting the mesh surface of objects. However if we want to analyse the 3D volumetric data surface representation is not sufficient. Moreover to found some intersting information specific tools are needed like interactive color and opacity transfer function, gradient opactity functions... vtkjs propose very interesting application for this: https://kitware.github.io/vtk-js/examples/VolumeViewer/VolumeViewer.html?fileURL=https://data.kitware.com/api/v1/item/59e12e988d777f31ac6455c5/download. VTKVolume panel is just an helper to embed this application in a notebook and allow to work directly with vtkImageData or 3d numpy arrays. As the size of volume data can be very big a subsampling is implemented to limit the size of data transfered to javascript.
    A new notebook for this panel was added

Issue not corrected:

  • Linewidth but it's related to
    Kitware/vtk-js#673
    - Opacity seems not be handle correctly (to investigate) Actualy it works

VTKVolume panel:
I have several improvements in mind but I think it should follow in an other PR

@xavArtley xavArtley force-pushed the vtk_orientation_widget_and_binds branch from d4f42b5 to 74b7403 Compare Aug 20, 2019
@jbednar
Copy link
Member

@jbednar jbednar commented Aug 20, 2019

Cool!

Copy link
Member

@jbednar jbednar left a comment

Seems very useful! I couldn't see anything in the source code about enabling or disabling this feature, and it seems like not all users will want to have it. Can you explain how to control its presence?

@xavArtley
Copy link
Collaborator Author

@xavArtley xavArtley commented Aug 20, 2019

Hello for the moment nothing control it that's why I labeled it WIP.
I'll had some control later and I'll update the doc in the same time
However once the widget is added I don't know if we can remove it.

@philippjfr
Copy link
Member

@philippjfr philippjfr commented Aug 20, 2019

However once the widget is added I don't know if we can remove it.

In that case just set the parameter controlling it to constant.

@xavArtley xavArtley changed the title Vtk orientation widget and binds Vtk various enhancements Aug 23, 2019
@xavArtley xavArtley added the status: paused label Aug 23, 2019
@xavArtley
Copy link
Collaborator Author

@xavArtley xavArtley commented Sep 13, 2019

This PR enable culling possibilities: cf pyvista/pyvista#292
before:
image
after:
image

@xavArtley xavArtley removed the status: paused label Sep 13, 2019
@xavArtley
Copy link
Collaborator Author

@xavArtley xavArtley commented Sep 16, 2019

solve : pyvista/pyvista#300
before
image
after
image

@xavArtley
Copy link
Collaborator Author

@xavArtley xavArtley commented Sep 16, 2019

I succeed to plot colorbars but the way I have done it seems to me pretty ugly
image

image

@xavArtley
Copy link
Collaborator Author

@xavArtley xavArtley commented Sep 17, 2019

We can control the display of the orientation widget now and control of key binding is re-eanabled
image

@banesullivan I ping you to let you know some imporvements of the vtk viewer on our side

@xavArtley
Copy link
Collaborator Author

@xavArtley xavArtley commented Sep 17, 2019

I changed the way I create colorbar to have a more flexible layout
Need to update the doc

image

https://xavartley.github.io/panel/vtk_examples/vtkEnhancement.html

@banesullivan
Copy link
Contributor

@banesullivan banesullivan commented Sep 17, 2019

Amazing work, @xavArtley!

@xavArtley xavArtley force-pushed the vtk_orientation_widget_and_binds branch from 95a121d to b595405 Compare Sep 17, 2019
@xavArtley xavArtley requested a review from jbednar Sep 17, 2019
@xavArtley xavArtley added the type: enhancement label Sep 17, 2019
panel/links.py Outdated
@@ -141,6 +141,11 @@ class GenericLink(Link):
A dictionary mapping between source specification to target
specification.""")

args = param.Dict(default={}, doc="""
Copy link
Member

@philippjfr philippjfr Sep 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@xavArtley
Copy link
Collaborator Author

@xavArtley xavArtley commented Sep 27, 2019

This PR begin to be consequent

@xavArtley xavArtley force-pushed the vtk_orientation_widget_and_binds branch from 536327f to daf4f37 Compare Sep 30, 2019
@xavArtley xavArtley force-pushed the vtk_orientation_widget_and_binds branch from daf4f37 to b6c135b Compare Sep 30, 2019
@philippjfr
Copy link
Member

@philippjfr philippjfr commented Sep 30, 2019

Thanks so much for this work. I've mostly reviewed the documentation and made some suggestions.

@xavArtley xavArtley force-pushed the vtk_orientation_widget_and_binds branch from 5e84d12 to e158f0a Compare Sep 30, 2019
xavArtley and others added 2 commits Sep 30, 2019
Update examples/reference/panes/VTK.ipynb

Co-Authored-By: Philipp Rudiger <prudiger@anaconda.com>
@xavArtley xavArtley force-pushed the vtk_orientation_widget_and_binds branch from 81ca3ef to efa749c Compare Sep 30, 2019
@philippjfr
Copy link
Member

@philippjfr philippjfr commented Sep 30, 2019

Thanks for the fixes. The Python2 test failures are unrelated so I'll merge and fix them indepedently.

@philippjfr philippjfr merged commit f4f2579 into master Sep 30, 2019
0 of 3 checks passed
@banesullivan
Copy link
Contributor

@banesullivan banesullivan commented Oct 17, 2019

serialization_policy (define when the serialization of the scene happened): in pyvista no need to set auto_close to false anymore since the new default behavior is to serialize the scene when the panel is created and not displayed pyvista/pyvista#364

@xavArtley, did these changes not make it onto version 0.6.4? I'm having trouble making these plots and still having trouble with needing to turn off auto_close

@xavArtley
Copy link
Collaborator Author

@xavArtley xavArtley commented Oct 17, 2019

@banesullivan
Copy link
Contributor

@banesullivan banesullivan commented Oct 17, 2019

Ah okay, thanks! I saw this was merged to master before 0.6.4 was released and thought something was weird.

I look forward to 0.7!

@xavArtley xavArtley deleted the vtk_orientation_widget_and_binds branch Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: WIP type: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants