How do I execute some code whenever a specific Event is triggerred?

How do I execute some code whenever a specific Event is triggered in OHIF viewer?
Is there a way to subscribe to the OHIF events? if yes, how can I achieve this functionality?

  • OHIF version v3.8

Yes

see here for service events

Some other events are published on eventTarget of cornerstone3D and some other rendering events on the element