How to use the cornerstone-tools.Synchronizer function in cornerstone-tools

To help you get started, weโ€™ve selected a few cornerstone-tools 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 / CornerstoneToolManager.js View on Github external
}

    if (config.props) {
      // set properties
      Object.keys(config.props).forEach((prop) => {
        tool[prop] = config.props[prop];
      });
    }

    if (config.configuration && tool.setConfiguration) {
      tool.setConfiguration(config.configuration);
    }

    if (config.syncViews && config.syncOptions) {
      const { event, synchronizer } = config.syncOptions;
      const synch = new cornerstoneTools.Synchronizer(event, synchronizer);

      model.synchronizers.push({
        toolName: name,
        synchronizer: synch,
      });
    }

    return {
      name,
      config,
      get state() {
        return state;
      },
      enable: partial(invoke, 'enable'),
      disable: partial(invoke, 'disable'),
      activate: partial(invoke, 'activate'),
github OHIF / Viewers / OHIFViewer-react / src / connectedComponents / OHIFCornerstoneViewportPlugin / OHIFCornerstoneViewportPlugin.js View on Github external
import React, { Component } from "react";
import PropTypes from "prop-types";
import OHIF from 'ohif-core';
import ConnectedCornerstoneViewport from './ConnectedCornerstoneViewport';
import OHIFComponentPlugin from '../OHIFComponentPlugin.js';
import cornerstoneTools from "cornerstone-tools";
import cornerstone from "cornerstone-core";
import './config';

const { StackManager } = OHIF.utils;

// Create the synchronizer used to update reference lines
OHIF.viewer.updateImageSynchronizer = new cornerstoneTools.Synchronizer('cornerstonenewimage', cornerstoneTools.updateImageSynchronizer);

// Metadata configuration
const metadataProvider = new OHIF.cornerstone.MetadataProvider();

cornerstone.metaData.addProvider(metadataProvider.provider.bind(metadataProvider));

StackManager.setMetadataProvider(metadataProvider);

class OHIFCornerstoneViewportPlugin extends Component {
  static propTypes = {
    studies: PropTypes.object,
    displaySet: PropTypes.object,
    viewportIndex: PropTypes.number,
  };

  static id = 'CornerstoneViewportPlugin';
github OHIF / ohif-core / src / classes / StackImagePositionOffsetSynchronizer.js View on Github external
constructor() {
    this.active = false;
    this.syncedViewports = [];
    this.synchronizer = new cornerstoneTools.Synchronizer(
      'cornerstonenewimage',
      cornerstoneTools.stackImagePositionOffsetSynchronizer
    );
  }