Shift to new syntax; try to get only cornerstone extension working with new syntax
This commit is contained in:
parent
0318203770
commit
31c987d700
@ -1,5 +1,5 @@
|
||||
import React, { Component } from 'react';
|
||||
import OHIFCornerstoneViewport from './OHIFCornerstoneViewport.js';
|
||||
import React from 'react';
|
||||
import ToolbarModule from './ToolbarModule.js';
|
||||
|
||||
/**
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import OHIF from 'ohif-core';
|
||||
import ConnectedCornerstoneViewport from './ConnectedCornerstoneViewport';
|
||||
import cornerstone from 'cornerstone-core';
|
||||
import './config';
|
||||
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import ConnectedCornerstoneViewport from './ConnectedCornerstoneViewport';
|
||||
import OHIF from 'ohif-core';
|
||||
import PropTypes from 'prop-types';
|
||||
import cornerstone from 'cornerstone-core';
|
||||
import handleSegmentationStorage from './handleSegmentationStorage.js';
|
||||
|
||||
const { StackManager } = OHIF.utils;
|
||||
|
||||
@ -1,3 +1,23 @@
|
||||
import OHIFCornerstoneExtension from './OHIFCornerstoneExtension.js';
|
||||
import OHIFCornerstoneViewport from './OHIFCornerstoneViewport.js';
|
||||
import ToolbarModule from './ToolbarModule.js';
|
||||
import commandsModule from './commandsModule.js';
|
||||
|
||||
export default OHIFCornerstoneExtension;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export default {
|
||||
/**
|
||||
* Only required property. Should be a unique value across all extensions.
|
||||
*/
|
||||
id: 'cornerstone',
|
||||
|
||||
getViewportModule() {
|
||||
return OHIFCornerstoneViewport;
|
||||
},
|
||||
getToolbarModule() {
|
||||
return ToolbarModule;
|
||||
},
|
||||
getCommandsModule() {
|
||||
return commandsModule;
|
||||
}
|
||||
};
|
||||
|
||||
29
src/App.js
29
src/App.js
@ -14,13 +14,13 @@ import {
|
||||
initWebWorkers,
|
||||
} from './utils/index.js';
|
||||
|
||||
import ConnectedToolContextMenu from './connectedComponents/ConnectedToolContextMenu';
|
||||
// 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 OHIFDicomPDFExtension from 'ohif-dicom-pdf-extension';
|
||||
// import OHIFDicomHtmlExtension from 'ohif-dicom-html-extension';
|
||||
// import OHIFDicomMicroscopyExtension from '@ohif/extension-dicom-microscopy';
|
||||
// import OHIFDicomPDFExtension from 'ohif-dicom-pdf-extension';
|
||||
import OHIFStandaloneViewer from './OHIFStandaloneViewer';
|
||||
import OHIFVTKExtension from '@ohif/extension-vtk';
|
||||
// import OHIFVTKExtension from '@ohif/extension-vtk';
|
||||
import { OidcProvider } from 'redux-oidc';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Provider } from 'react-redux';
|
||||
@ -36,9 +36,9 @@ const commandsManagerConfig = {
|
||||
getActiveContexts: () => store.getState().ui.activeContexts,
|
||||
};
|
||||
|
||||
const extensionManager = new ExtensionManager();
|
||||
const commandsManager = new CommandsManager(commandsManagerConfig);
|
||||
const hotkeysManager = new HotkeysManager(commandsManager);
|
||||
const extensionManager = new ExtensionManager({ commandsManager });
|
||||
|
||||
// TODO: Should be done in extensions w/ commandsModule
|
||||
// ~~ ADD COMMANDS
|
||||
@ -61,17 +61,18 @@ store.dispatch({
|
||||
|
||||
setupTools(store);
|
||||
|
||||
const children = {
|
||||
viewport: [<ConnectedToolContextMenu key="tool-context" />],
|
||||
};
|
||||
// const children = {
|
||||
// viewport: [<ConnectedToolContextMenu key="tool-context" />],
|
||||
// };
|
||||
|
||||
/** TODO: extensions should be passed in as prop as soon as we have the extensions as separate packages and then registered by ExtensionsManager */
|
||||
extensionManager.registerExtensions([
|
||||
new OHIFCornerstoneExtension({ children }),
|
||||
new OHIFVTKExtension(),
|
||||
new OHIFDicomPDFExtension(),
|
||||
new OHIFDicomHtmlExtension(),
|
||||
new OHIFDicomMicroscopyExtension(),
|
||||
OHIFCornerstoneExtension,
|
||||
// new OHIFCornerstoneExtension({ children }),
|
||||
// new OHIFVTKExtension(),
|
||||
// new OHIFDicomPDFExtension(),
|
||||
// new OHIFDicomHtmlExtension(),
|
||||
// new OHIFDicomMicroscopyExtension(),
|
||||
]);
|
||||
|
||||
// TODO[react] Use a provider when the whole tree is React
|
||||
|
||||
Loading…
Reference in New Issue
Block a user