From d1f7431af61366a4217bd01691873db55dd1b59e Mon Sep 17 00:00:00 2001 From: dannyrb Date: Mon, 17 Jun 2019 15:42:11 -0400 Subject: [PATCH] Re-add dicom microspy extension --- .../ohif-dicom-microscopy-extension/src/index.js | 13 +++++-------- extensions/ohif-vtk-extension/src/toolbarModule.js | 3 --- src/App.js | 7 ++----- src/connectedComponents/ConnectedPluginSwitch.js | 6 +++--- 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/extensions/ohif-dicom-microscopy-extension/src/index.js b/extensions/ohif-dicom-microscopy-extension/src/index.js index 4bcc9add5..0dd9d3597 100644 --- a/extensions/ohif-dicom-microscopy-extension/src/index.js +++ b/extensions/ohif-dicom-microscopy-extension/src/index.js @@ -1,19 +1,16 @@ import DicomMicroscopySopClassHandler from './DicomMicroscopySopClassHandler.js'; import DicomMicroscopyViewport from './DicomMicroscopyViewport.js'; -export default class OHIFDicomMicroscopyExtension { +export default { /** - * Extension ID is a unique id, might be used for namespacing extension specific redux actions/reducers (?) + * Only required property. Should be a unique value across all extensions. */ - getExtensionId() { - return 'microscopy'; - } + id: 'microscopy', getViewportModule() { return DicomMicroscopyViewport; - } - + }, getSopClassHandlerModule() { return DicomMicroscopySopClassHandler; } -} +}; diff --git a/extensions/ohif-vtk-extension/src/toolbarModule.js b/extensions/ohif-vtk-extension/src/toolbarModule.js index 3cfa22fbb..5f70d4bd8 100644 --- a/extensions/ohif-vtk-extension/src/toolbarModule.js +++ b/extensions/ohif-vtk-extension/src/toolbarModule.js @@ -12,7 +12,6 @@ const definitions = [ type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE, commandName: 'enableCrosshairsTool', commandOptions: {} - // window.commandsManager.runCommand('enableCrosshairsTool', {}, 'vtk'); }, { id: 'WWWC', @@ -22,7 +21,6 @@ const definitions = [ type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE, commandName: 'enableLevelTool', commandOptions: {} - // window.commandsManager.runCommand('enableLevelTool', {}, 'vtk'); }, { id: 'Rotate', @@ -32,7 +30,6 @@ const definitions = [ type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE, commandName: 'enableRotateTool', commandOptions: {} - // window.commandsManager.runCommand('enableRotateTool', {}, 'vtk'); } ]; diff --git a/src/App.js b/src/App.js index 7905a5adc..1dbbfbc4f 100644 --- a/src/App.js +++ b/src/App.js @@ -16,7 +16,7 @@ import { I18nextProvider } from 'react-i18next'; // import ConnectedToolContextMenu from './connectedComponents/ConnectedToolContextMenu'; import OHIFCornerstoneExtension from '@ohif/extension-cornerstone'; // import OHIFDicomHtmlExtension from 'ohif-dicom-html-extension'; -// import OHIFDicomMicroscopyExtension from '@ohif/extension-dicom-microscopy'; +import OHIFDicomMicroscopyExtension from '@ohif/extension-dicom-microscopy'; import OHIFDicomPDFExtension from '@ohif/extension-dicom-pdf'; import OHIFStandaloneViewer from './OHIFStandaloneViewer'; import OHIFVTKExtension from '@ohif/extension-vtk'; @@ -41,9 +41,6 @@ const commandsManager = new CommandsManager(commandsManagerConfig); const hotkeysManager = new HotkeysManager(commandsManager); const extensionManager = new ExtensionManager({ commandsManager }); -// TODO: @dannyrb will fix this -window.commandsManager = commandsManager; - // TODO: Should be done in extensions w/ commandsModule // ~~ ADD COMMANDS appCommands.init(commandsManager); @@ -65,7 +62,7 @@ extensionManager.registerExtensions([ OHIFVTKExtension, OHIFDicomPDFExtension, // new OHIFDicomHtmlExtension(), - // new OHIFDicomMicroscopyExtension(), + OHIFDicomMicroscopyExtension, ]); // TODO[react] Use a provider when the whole tree is React diff --git a/src/connectedComponents/ConnectedPluginSwitch.js b/src/connectedComponents/ConnectedPluginSwitch.js index f1ca255a7..965c05350 100644 --- a/src/connectedComponents/ConnectedPluginSwitch.js +++ b/src/connectedComponents/ConnectedPluginSwitch.js @@ -61,7 +61,7 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => { icon: 'cube', active: false, onClick: () => { - window.commandsManager.runCommand('axial', {}, 'vtk'); + commandsManager.runCommand('axial'); }, }, { @@ -69,7 +69,7 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => { icon: 'cube', active: false, onClick: () => { - window.commandsManager.runCommand('sagittal', {}, 'vtk'); + commandsManager.runCommand('sagittal'); }, }, { @@ -77,7 +77,7 @@ const mergeProps = (propsFromState, propsFromDispatch, ownProps) => { icon: 'cube', active: false, onClick: () => { - window.commandsManager.runCommand('coronal', {}, 'vtk'); + commandsManager.runCommand('coronal'); }, },*/ {