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

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 Interactive canvas within Jupyter Notebooks 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:

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

@jbednar
Copy link
Member

jbednar commented Aug 20, 2019

Cool!

Copy link
Member

@jbednar jbednar left a comment

Choose a reason for hiding this comment

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

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

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 Paused label Aug 23, 2019
@xavArtley
Copy link
Collaborator Author

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

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

xavArtley commented Sep 16, 2019

solve : pyvista/pyvista#300
before
image
after
image

@xavArtley
Copy link
Collaborator Author

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

Amazing work, @xavArtley!

@xavArtley xavArtley force-pushed the vtk_orientation_widget_and_binds branch from 95a121d to b595405 Compare September 17, 2019 16:15
@xavArtley xavArtley added the type: enhancement Minor feature or improvement to an existing feature 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

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

This PR begin to be consequent

@xavArtley xavArtley force-pushed the vtk_orientation_widget_and_binds branch from 536327f to daf4f37 Compare September 30, 2019 07:49
@xavArtley xavArtley force-pushed the vtk_orientation_widget_and_binds branch from daf4f37 to b6c135b Compare September 30, 2019 08:19
@philippjfr
Copy link
Member

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 September 30, 2019 10:42
@xavArtley xavArtley force-pushed the vtk_orientation_widget_and_binds branch from 81ca3ef to efa749c Compare September 30, 2019 11:20
@philippjfr
Copy link
Member

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

@banesullivan
Copy link
Contributor

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 commented Oct 17, 2019 via email

@banesullivan
Copy link
Contributor

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 October 19, 2019 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: WIP type: enhancement Minor feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants