Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
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'),
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';
constructor() {
this.active = false;
this.syncedViewports = [];
this.synchronizer = new cornerstoneTools.Synchronizer(
'cornerstonenewimage',
cornerstoneTools.stackImagePositionOffsetSynchronizer
);
}