KitwareMedical / SlicerVirtualReality

A Slicer extension that enables user to interact with a Slicer scene using virtual reality.
Apache License 2.0
119 stars 58 forks source link

Add interactive Qt panel to VR scene #43

Open cpinter opened 6 years ago

cpinter commented 6 years ago

A very flexible way for showing menus in VR would be to implement off-line rendering of any Qt widget in a texture that is shown on a VTK plane actor, which can respond to virtual mouse events generated by the laser pointer (currently called probe mode in VTK) in VR.

Tasks that need to be done, start with first and only move to next one once it is done.

Useful UI panels (extend as needs arise):

Related issues

Related pull requests

pieper commented 6 years ago

💯 this will be a great feature!

jcfr commented 5 years ago

To follow up on this, @martinken recently added classes to VTK for adding Qt widget into the VR scene:

cpinter commented 5 years ago

@jcfr Perfect! @mohammadrashid0917 just started working on this. We'll re-adjust the plan to use these classes. Mohammad, please hang on. In the meantime you can look at these classes.

lassoan commented 5 years ago

@jcfr We were lucky this time that minimal/no work was duplicated, but we need to coordinate a bit more closely to make sure we avoid parallel efforts. How could we do that? Where can we find planned VTK virtual reality developments? Do you have a category in the VTK bugtracker, labs page, …?

jcfr commented 5 years ago

How could we do that?

The plan described at the top of this issue is outstanding. I should probably have done a better job communicating about it with folks working on OpenVR at Kitware.

Moving forward, I think sharing the plan like the one at the top of this issue on VTK discourse would help.

Internally, the folks working on OpenVR features know that I am coordinating effort on the Slicer side and I think it worked pretty well as I was able to follow up here.

That said, I agreed that the feedback loop could be shorter.

May be having a list of contact associated with key VTK area would help ?

Where can we find planned VTK virtual reality developments?

Considering that this type of feature are driven by customer needs and often planned and executed in a short time frame, i think it is challenging for us to communicate about this features with a high level of granularity and far ahead.

jcfr commented 5 years ago

To follow up, here is a Slicer PR backporting the specific VTK changes to Slicer/VTK fork. See https://github.com/Slicer/Slicer/pull/1141

I have checked that it compiles on Linux, after someone check that Slicer/VTK compiles on Windows and macOS, it will be integrated.

cpinter commented 2 years ago

We have made some good progress on the GUI widget and the laser pointer. Basically we created a new GUI widget markup that uses a different way to render the Qt widget on the VTK plane as texture (not the shared context as it is in VTK, which crashed when used in Slicer), and we added a little test module that creates a "laser pointer" (just a line) the intersection of which to the Qt widget is calculated and events generated. So as the last larger step we need to support a laser pointer usable from VR with the controller.

I've recently seen some news from Paraview in this topic and thought we could use some bits and pieces from there if compatible. Does anyone has personal experience with VR in Paraview and maybe also with the in-VR GUI widget feature in Paraview?

adamrankin commented 2 years ago

@cpinter do you have any links to the paraview pieces/issues/PRs?

cpinter commented 2 years ago

I don't. I'd just search for usage of vtkQWidgetWidget. Although it doesn't work in Slicer because the context sharing method is somehow not compatible, we could see how the laser pointer is implemented etc.

On Wed, Jan 19, 2022, 21:09 Adam Rankin @.***> wrote:

@cpinter https://github.com/cpinter do you have any links to the paraview pieces/issues/PRs?

— Reply to this email directly, view it on GitHub https://github.com/KitwareMedical/SlicerVirtualReality/issues/43#issuecomment-1016871048, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKDXHEMSUIDXDTMBJ724CDUW4SCNANCNFSM4FYZR7QA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

cpinter commented 1 year ago

Using the branch https://github.com/cpinter/SlicerVirtualReality/tree/gui-widget-20230612 the interactions can be set up to work like shown in this video:

https://github.com/KitwareMedical/SlicerVirtualReality/assets/1325980/851adfd5-ae03-441d-8570-7da7b2b644a6

Note that I had to apply a few workwrounds in the code and use a bunch of scripting to achieve this. Next steps can be: