cornerstonejs / cornerstone

JavaScript library to display interactive medical images including but not limited to DICOM
https://docs.cornerstonejs.org/
MIT License
2.04k stars 598 forks source link

Simple way to update the viewport when adding / removing layers? #542

Closed shanebenlolo closed 3 years ago

shanebenlolo commented 3 years ago

Hello,

I am working on bringing the Layers API into OHIF. I am running into an issue though of not having a way to update the viewport to show the current layers which are associated with the viewport. The viewport always seems to show the last set of layers which was uploaded, rather than the current set.

I am trying to find a way to refresh the viewport so as to show the current layers rather than the ones from one step behind. Is there a function of some sort I can use to rerender the layers? I have tried using the updateImage() function but it does not seem to do anything to update the layers. Thanks for any help you can offer.

shanebenlolo commented 3 years ago

My issue was that I was adding a new layer on every update, rather than setting a new image within the layer. therefore, updateImage() had no effect.