You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the state is updated (tools or imageIds) from the parent object, React does not re-render the CornerstoneViewport component to reflect the changes.
A common use case is to use the Pan tool and Length tool with both bound to the left mouse button. This can be achieved with a toggle button that updates the state by making Pan Tool's status be passive and Length Tool's status to be active. Currently, this is not possible as the state of CornerstoneViewport does not gets updated.
The current version of the Viewer does not support updates of tools prop. Once you've set them when initializing the component they are unchanged during the component's lifecycle. The only thing you can do is to change activeTool and/or frameRate, isPlaying, isOverlayVisible props. That and the imageId stack ofc. The rest is not even in the update lifecycle.
burnpiro
added a commit
to burnpiro/react-cornerstone-viewport
that referenced
this issue
Sep 28, 2021
… changed. Call executes on every update and updates the state of all provided tools. This allows to turn tools ON/OFF without initializing entire `CornerstoneViewport` component.
Resolvescornerstonejs#117
If the state is updated (tools or imageIds) from the parent object, React does not re-render the CornerstoneViewport component to reflect the changes.
A common use case is to use the Pan tool and Length tool with both bound to the left mouse button. This can be achieved with a toggle button that updates the state by making Pan Tool's status be
passive
and Length Tool's status to beactive
. Currently, this is not possible as the state of CornerstoneViewport does not gets updated.This can be reproduced at https://react.cornerstonejs.org/basic
Change the state of
ExamplePageBasic
using the React Developer Tools in Chrome.The text was updated successfully, but these errors were encountered: