How to use the cornerstone-core.getElementData function in cornerstone-core

To help you get started, we’ve selected a few cornerstone-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Kitware / paraview-glance / Sources / externals / MedicalCornerstone / CornerstoneRenderer.js View on Github external
function resetRenderer() {
    if (!model.container) {
      return;
    }

    if (model.representation) {
      // store current representation on cornerstone element
      cornerstone.getElementData(
        model.container,
        GLANCE_DATA
      ).currentRepresentation =
        model.representation;

      // do a first render with a viewport reset
      publicAPI.render(true);

      if (model.toolManager) {
        model.toolManager.setupElement(model.container);
      }
    } else {
      publicAPI.renderBlankImage();
      if (model.toolManager) {
        model.toolManager.teardownElement(model.container);
      }