OHIF / Viewers

OHIF zero-footprint DICOM viewer and oncology specific Lesion Tracker, plus shared extension packages
https://docs.ohif.org/
MIT License
3.29k stars 3.32k forks source link

Tool abstraction for vtk.js #1285

Closed dannyrb closed 1 year ago

dannyrb commented 4 years ago

Tool abstraction for vtk.js

Context

react-vtkjs-viewport has slowly grown to include more and more features. We're now at the point where we need the ability to change "tool" bindings based on user input, or the context in which the viewer is currently being used.

Currently, we accomplish this be leveraging:

RenderWindowInteractor (Interactor) --> InteractorStyleXXX (InteractorStyle) --> Manipulators

Where RenderWindowInteractor normalizes browser interactions and exposes those normalized events to an InteractorStyle. Interactor styles can then optionally handle each of those events. @JamesAPetts has pointed to the InteractorStyleManipulator as a good example.

We can only have one InteractorStyle, and we're currently extending and swapping them out depending on which behaviors we would like to have active. We have the ability to modify manipulators on the InteractorStyle even after it's set; where manipulators or sort of like "one-button tools".

(I'm stating this in the hopes that someone corrects me if I've missed the mark.)

Discussion

It has been suggested that the current pattern mirrors that of cornerstone-tools@2, where listeners for behaviors/tools would compete with each other. We could model our changes to make the same enhancements we accomplished in cornerstone-tools@3 by:

Perhaps the biggest difference here would be for "tools" that do more than modify the viewport/camera. vtk.js renders annotations differently from cornerstone-tools, and how that fits in is still unclear.

This is a discussion piece to get the ball rolling. Please feel free to weigh in.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

dannyrb commented 4 years ago

👢 💨 🤖

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

sedghi commented 1 year ago

Since we have moved to cornerstone3D I will close this, thanks