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

[Bug] Widget handles not pickable within vtkVolume #3163

Open
clementDebuy opened this issue Oct 30, 2024 · 5 comments
Open

[Bug] Widget handles not pickable within vtkVolume #3163

clementDebuy opened this issue Oct 30, 2024 · 5 comments
Labels
module: picking module: widget Gaps and errors in interactive widgets type: bug 🐞 Errors in functionality

Comments

@clementDebuy
Copy link

Bug description

I am trying to create a box, that highlights a certain area of a CT volume, that needs to be resizable.
I tried creating a widget based on vtkImageCroppingWidget to add handles to the box for resizing.
However, when placing the widget within the CT volume, the handles are not accessible anymore.

Steps to reproduce

  1. Add a vtkVolume to a the renderer
  2. Add a vtkWidgetManager and a vtkImageCroppingWidget
  3. Set the six cropping planes so that at least one of the handles lie within the volume.
  4. Try to interact with the handle contained within the volume

Detailed Behavior

Once the widget's handles are contained within the volume, they are no longer accessible with the cursor.
Not accessible meaning that the usual hand cursor to select the handle doesn't show anymore and we can not manipulate the handle.

Expected Behavior

There should be an option that allows widget handles to be prioritized over other props.
The behavior should be similar to the following example: Vtk BoxWidget Example

Environment

  • vtk.js version: 32.5.1
  • Browsers: Chrome
  • OS: Windows 10
@clementDebuy clementDebuy added the type: bug 🐞 Errors in functionality label Oct 30, 2024
@finetjul
Copy link
Member

Do you confirm that you have the same behavior with the ImageCroppingWidget example ? https://kitware.github.io/vtk-js/examples/ImageCroppingWidget.html

Can you try with older versions of VTK.js, I wonder if it is a regression...

@finetjul finetjul added module: widget Gaps and errors in interactive widgets module: picking labels Oct 30, 2024
@clementDebuy
Copy link
Author

Thank you for your prompt answer.
I tested using the suggested example while commenting the "onModified" function to disable the interaction between the cropping widget and the volume mapper.
I tested with the latest vtkjs version and it didn't work, I then downgraded until version 27 where the widget did not work anymore.
I then upgraded to version 28 where the widget works but the handle issue still persists.
You can see here a visual representation of the situation causing the issue:
image

@clementDebuy
Copy link
Author

After the test it appears that the behavior has been like this in older versions as well. To me it seems clear that the handles should remain pickable even if inside a volume but maybe this does not fit in the scope of a bug. What do the maintainers think?

@finetjul
Copy link
Member

finetjul commented Nov 4, 2024

You can disable the picking of the volume rendering with myVolume.setPickable(false).
If that works for you, I think it could be a good default for the example. Can you create a PR with such modification for the ImageCroppingWidget example ?

Ideally (if you have time or funding...), the Volume rendering mapper, for the picking pass, should render ONLY where opacity > 0 (or a specific threshold).

@clementDebuy
Copy link
Author

Thank you for the pointer. Setting the picking of the volume to false works perfectly in any version tested (27 and 32.5.1 used in my project). However in my project it didn't work at first. It turns out that the flag was reinitialized to true at some point. After setting it right before creating the widget it worked well.
As for the example I may take a look at it but I don't think I have the budget at the moment.
Thank you again for your reactivity and the help provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: picking module: widget Gaps and errors in interactive widgets type: bug 🐞 Errors in functionality
Projects
None yet
Development

No branches or pull requests

2 participants