Access Viewer API from outsite the iframe (e.g. measurement service)

Describe Your Question

  • I have an application that integrates OHIF through iframes (in a classic Rails view and a React front-end)
  • Can I access the viewer API (I am especially interested in the Measurement API) from my React App outside the iframe to
    • jump to a specific measurement
    • get a list of measurements made for a series or a study as JSON

I know where I find the docs.

But what is the officially proposed way to interact with the viewer from outside the iframe?

Thanks! :pray:

You can’t easily achieve this with OHIF, as it’s a front-end application that doesn’t expose such functionalities. Consider exploring other solutions that have attempted similar tasks. Essentially, you need to work with events - firing an event from outside while listening for it inside the application.

Thanks for your reply. That sounds unfortunate.

Could I write an extension that would provide such interface for me easily. I mean, could I write an extension that would have access to this functionality from within the viewer react application?

I know my way around the web stack. But before diving in to deep it might be good to have an educated guess.

I see that some service components inside the viewer provides event subscriptions. Maybe I could hook into those, proxy them and provide some outside-in way to call internal service functions?