fix: Create typed services and allow lower case access to agree with naming conventions (#3141)
* fix: Add typed services * fix: Typed services - PR changes * remaining of the cineService and toolbarService renaming --------- Co-authored-by: Alireza <ar.sedghi@gmail.com>
This commit is contained in:
parent
0e1a58da79
commit
7f799b8e3d
@ -118,7 +118,7 @@ const OHIFCornerstoneViewport = React.memo(props => {
|
|||||||
const {
|
const {
|
||||||
MeasurementService,
|
MeasurementService,
|
||||||
DisplaySetService,
|
DisplaySetService,
|
||||||
ToolBarService,
|
toolbarService,
|
||||||
ToolGroupService,
|
ToolGroupService,
|
||||||
SyncGroupService,
|
SyncGroupService,
|
||||||
CornerstoneViewportService,
|
CornerstoneViewportService,
|
||||||
@ -355,7 +355,7 @@ const OHIFCornerstoneViewport = React.memo(props => {
|
|||||||
></div>
|
></div>
|
||||||
<CornerstoneOverlays
|
<CornerstoneOverlays
|
||||||
viewportIndex={viewportIndex}
|
viewportIndex={viewportIndex}
|
||||||
ToolBarService={ToolBarService}
|
toolbarService={toolbarService}
|
||||||
element={elementRef.current}
|
element={elementRef.current}
|
||||||
scrollbarHeight={scrollbarHeight}
|
scrollbarHeight={scrollbarHeight}
|
||||||
servicesManager={servicesManager}
|
servicesManager={servicesManager}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|||||||
import { Enums, Types, utilities } from '@cornerstonejs/core';
|
import { Enums, Types, utilities } from '@cornerstonejs/core';
|
||||||
import { utilities as csToolsUtils } from '@cornerstonejs/tools';
|
import { utilities as csToolsUtils } from '@cornerstonejs/tools';
|
||||||
import { ImageScrollbar } from '@ohif/ui';
|
import { ImageScrollbar } from '@ohif/ui';
|
||||||
|
import { ServicesManger } from '@ohif/core';
|
||||||
|
|
||||||
function CornerstoneImageScrollbar({
|
function CornerstoneImageScrollbar({
|
||||||
viewportData,
|
viewportData,
|
||||||
@ -13,7 +14,10 @@ function CornerstoneImageScrollbar({
|
|||||||
scrollbarHeight,
|
scrollbarHeight,
|
||||||
servicesManager,
|
servicesManager,
|
||||||
}) {
|
}) {
|
||||||
const { CineService, CornerstoneViewportService } = servicesManager.services;
|
const {
|
||||||
|
cineService,
|
||||||
|
CornerstoneViewportService,
|
||||||
|
} = (servicesManager as ServicesManger).services;
|
||||||
|
|
||||||
const onImageScrollbarChange = (imageIndex, viewportIndex) => {
|
const onImageScrollbarChange = (imageIndex, viewportIndex) => {
|
||||||
const viewportInfo = CornerstoneViewportService.getViewportInfoByIndex(
|
const viewportInfo = CornerstoneViewportService.getViewportInfoByIndex(
|
||||||
@ -25,12 +29,12 @@ function CornerstoneImageScrollbar({
|
|||||||
viewportId
|
viewportId
|
||||||
);
|
);
|
||||||
|
|
||||||
const { isCineEnabled } = CineService.getState();
|
const { isCineEnabled } = cineService.getState();
|
||||||
|
|
||||||
if (isCineEnabled) {
|
if (isCineEnabled) {
|
||||||
// on image scrollbar change, stop the CINE if it is playing
|
// on image scrollbar change, stop the CINE if it is playing
|
||||||
CineService.stopClip(element);
|
cineService.stopClip(element);
|
||||||
CineService.setCine({ id: viewportIndex, isPlaying: false });
|
cineService.setCine({ id: viewportIndex, isPlaying: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
csToolsUtils.jumpToSlice(viewport.element, {
|
csToolsUtils.jumpToSlice(viewport.element, {
|
||||||
@ -144,6 +148,7 @@ CornerstoneImageScrollbar.propTypes = {
|
|||||||
scrollbarHeight: PropTypes.string,
|
scrollbarHeight: PropTypes.string,
|
||||||
imageSliceData: PropTypes.object.isRequired,
|
imageSliceData: PropTypes.object.isRequired,
|
||||||
setImageSliceData: PropTypes.func.isRequired,
|
setImageSliceData: PropTypes.func.isRequired,
|
||||||
|
servicesManager: PropTypes.object.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CornerstoneImageScrollbar;
|
export default CornerstoneImageScrollbar;
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import { vec3 } from 'gl-matrix';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { metaData, Enums, utilities } from '@cornerstonejs/core';
|
import { metaData, Enums, utilities } from '@cornerstonejs/core';
|
||||||
import { ViewportOverlay } from '@ohif/ui';
|
import { ViewportOverlay } from '@ohif/ui';
|
||||||
|
import { ServicesManager } from '@ohif/core';
|
||||||
|
|
||||||
const EPSILON = 1e-4;
|
const EPSILON = 1e-4;
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ function CornerstoneViewportOverlay({
|
|||||||
}) {
|
}) {
|
||||||
const {
|
const {
|
||||||
CornerstoneViewportService,
|
CornerstoneViewportService,
|
||||||
ToolBarService,
|
toolbarService,
|
||||||
} = servicesManager.services;
|
} = servicesManager.services;
|
||||||
const [voi, setVOI] = useState({ windowCenter: null, windowWidth: null });
|
const [voi, setVOI] = useState({ windowCenter: null, windowWidth: null });
|
||||||
const [scale, setScale] = useState(1);
|
const [scale, setScale] = useState(1);
|
||||||
@ -25,19 +26,19 @@ function CornerstoneViewportOverlay({
|
|||||||
* Initial toolbar state
|
* Initial toolbar state
|
||||||
*/
|
*/
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setActiveTools(ToolBarService.getActiveTools());
|
setActiveTools(toolbarService.getActiveTools());
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let isMounted = true;
|
let isMounted = true;
|
||||||
const { unsubscribe } = ToolBarService.subscribe(
|
const { unsubscribe } = toolbarService.subscribe(
|
||||||
ToolBarService.EVENTS.TOOL_BAR_STATE_MODIFIED,
|
toolbarService.EVENTS.TOOL_BAR_STATE_MODIFIED,
|
||||||
() => {
|
() => {
|
||||||
if (!isMounted) {
|
if (!isMounted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setActiveTools(ToolBarService.getActiveTools());
|
setActiveTools(toolbarService.getActiveTools());
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -287,6 +288,7 @@ CornerstoneViewportOverlay.propTypes = {
|
|||||||
viewportData: PropTypes.object,
|
viewportData: PropTypes.object,
|
||||||
imageIndex: PropTypes.number,
|
imageIndex: PropTypes.number,
|
||||||
viewportIndex: PropTypes.number,
|
viewportIndex: PropTypes.number,
|
||||||
|
servicesManager: ServicesManager,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CornerstoneViewportOverlay;
|
export default CornerstoneViewportOverlay;
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import {
|
|||||||
utilities as cstUtils,
|
utilities as cstUtils,
|
||||||
ReferenceLinesTool,
|
ReferenceLinesTool,
|
||||||
} from '@cornerstonejs/tools';
|
} from '@cornerstonejs/tools';
|
||||||
|
import { ServicesManager } from '@ohif/core';
|
||||||
|
|
||||||
import { getEnabledElement as OHIFgetEnabledElement } from './state';
|
import { getEnabledElement as OHIFgetEnabledElement } from './state';
|
||||||
import CornerstoneViewportDownloadForm from './utils/CornerstoneViewportDownloadForm';
|
import CornerstoneViewportDownloadForm from './utils/CornerstoneViewportDownloadForm';
|
||||||
@ -22,13 +23,13 @@ const commandsModule = ({ servicesManager }) => {
|
|||||||
const {
|
const {
|
||||||
ViewportGridService,
|
ViewportGridService,
|
||||||
ToolGroupService,
|
ToolGroupService,
|
||||||
CineService,
|
cineService,
|
||||||
ToolBarService,
|
toolbarService,
|
||||||
UIDialogService,
|
UIDialogService,
|
||||||
CornerstoneViewportService,
|
CornerstoneViewportService,
|
||||||
HangingProtocolService,
|
HangingProtocolService,
|
||||||
UINotificationService,
|
UINotificationService,
|
||||||
} = servicesManager.services;
|
} = (servicesManager as ServicesManager).services;
|
||||||
|
|
||||||
function _getActiveViewportEnabledElement() {
|
function _getActiveViewportEnabledElement() {
|
||||||
const { activeViewportIndex } = ViewportGridService.getState();
|
const { activeViewportIndex } = ViewportGridService.getState();
|
||||||
@ -92,11 +93,11 @@ const commandsModule = ({ servicesManager }) => {
|
|||||||
},
|
},
|
||||||
toggleCine: () => {
|
toggleCine: () => {
|
||||||
const { viewports } = ViewportGridService.getState();
|
const { viewports } = ViewportGridService.getState();
|
||||||
const { isCineEnabled } = CineService.getState();
|
const { isCineEnabled } = cineService.getState();
|
||||||
CineService.setIsCineEnabled(!isCineEnabled);
|
cineService.setIsCineEnabled(!isCineEnabled);
|
||||||
ToolBarService.setButton('Cine', { props: { isActive: !isCineEnabled } });
|
toolbarService.setButton('Cine', { props: { isActive: !isCineEnabled } });
|
||||||
viewports.forEach((_, index) =>
|
viewports.forEach((_, index) =>
|
||||||
CineService.setCine({ id: index, isPlaying: false })
|
cineService.setCine({ id: index, isPlaying: false })
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
setWindowLevel({ window, level, toolGroupId }) {
|
setWindowLevel({ window, level, toolGroupId }) {
|
||||||
|
|||||||
@ -87,12 +87,12 @@ const cornerstoneExtension = {
|
|||||||
// const onNewImageHandler = jumpData => {
|
// const onNewImageHandler = jumpData => {
|
||||||
// commandsManager.runCommand('jumpToImage', jumpData);
|
// commandsManager.runCommand('jumpToImage', jumpData);
|
||||||
// };
|
// };
|
||||||
const { ToolBarService } = servicesManager.services;
|
const { ToolbarService } = servicesManager.services;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<OHIFCornerstoneViewport
|
<OHIFCornerstoneViewport
|
||||||
{...props}
|
{...props}
|
||||||
ToolBarService={ToolBarService}
|
ToolbarService={ToolbarService}
|
||||||
servicesManager={servicesManager}
|
servicesManager={servicesManager}
|
||||||
commandsManager={commandsManager}
|
commandsManager={commandsManager}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -68,7 +68,7 @@ export default async function init({
|
|||||||
UIDialogService,
|
UIDialogService,
|
||||||
UIModalService,
|
UIModalService,
|
||||||
UINotificationService,
|
UINotificationService,
|
||||||
CineService,
|
cineService,
|
||||||
CornerstoneViewportService,
|
CornerstoneViewportService,
|
||||||
HangingProtocolService,
|
HangingProtocolService,
|
||||||
ToolGroupService,
|
ToolGroupService,
|
||||||
@ -137,7 +137,7 @@ export default async function init({
|
|||||||
CornerstoneViewportService
|
CornerstoneViewportService
|
||||||
);
|
);
|
||||||
|
|
||||||
initCineService(CineService);
|
initCineService(cineService);
|
||||||
|
|
||||||
const _getDefaultPosition = event => ({
|
const _getDefaultPosition = event => ({
|
||||||
x: (event && event.currentPoints.client[0]) || 0,
|
x: (event && event.currentPoints.client[0]) || 0,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { utilities } from '@cornerstonejs/tools';
|
import { utilities } from '@cornerstonejs/tools';
|
||||||
|
|
||||||
function initCineService(CineService) {
|
function initCineService(cineService) {
|
||||||
const playClip = (element, playClipOptions) => {
|
const playClip = (element, playClipOptions) => {
|
||||||
return utilities.cine.playClip(element, playClipOptions);
|
return utilities.cine.playClip(element, playClipOptions);
|
||||||
};
|
};
|
||||||
@ -9,7 +9,7 @@ function initCineService(CineService) {
|
|||||||
return utilities.cine.stopClip(element);
|
return utilities.cine.stopClip(element);
|
||||||
};
|
};
|
||||||
|
|
||||||
CineService.setServiceImplementation({ playClip, stopClip });
|
cineService.setServiceImplementation({ playClip, stopClip });
|
||||||
}
|
}
|
||||||
|
|
||||||
export default initCineService;
|
export default initCineService;
|
||||||
|
|||||||
@ -760,7 +760,8 @@ class CornerstoneViewportService implements IViewportService {
|
|||||||
|
|
||||||
export default function ExtendedCornerstoneViewportService(serviceManager) {
|
export default function ExtendedCornerstoneViewportService(serviceManager) {
|
||||||
return {
|
return {
|
||||||
name: 'CornerstoneViewportService',
|
name: 'cornerstoneViewportService',
|
||||||
|
altName: 'CornerstoneViewportService',
|
||||||
create: ({ configuration = {} }) => {
|
create: ({ configuration = {} }) => {
|
||||||
return new CornerstoneViewportService(serviceManager);
|
return new CornerstoneViewportService(serviceManager);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -42,7 +42,7 @@ export default function toggleMPRHangingProtocol({
|
|||||||
UINotificationService,
|
UINotificationService,
|
||||||
HangingProtocolService,
|
HangingProtocolService,
|
||||||
ViewportGridService,
|
ViewportGridService,
|
||||||
ToolBarService,
|
toolbarService,
|
||||||
} = servicesManager.services;
|
} = servicesManager.services;
|
||||||
|
|
||||||
// TODO Introduce a service to persist the state of the current hanging protocol/app.
|
// TODO Introduce a service to persist the state of the current hanging protocol/app.
|
||||||
@ -185,7 +185,7 @@ export default function toggleMPRHangingProtocol({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ToolBarService.recordInteraction({
|
toolbarService.recordInteraction({
|
||||||
groupId: 'WindowLevel',
|
groupId: 'WindowLevel',
|
||||||
itemId: 'WindowLevel',
|
itemId: 'WindowLevel',
|
||||||
interactionType: 'tool',
|
interactionType: 'tool',
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
|
|||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
|
||||||
export default function Toolbar({ servicesManager }) {
|
export default function Toolbar({ servicesManager }) {
|
||||||
const { ToolBarService } = servicesManager.services;
|
const { toolbarService } = servicesManager.services;
|
||||||
const [toolbarButtons, setToolbarButtons] = useState([]);
|
const [toolbarButtons, setToolbarButtons] = useState([]);
|
||||||
const [buttonState, setButtonState] = useState({
|
const [buttonState, setButtonState] = useState({
|
||||||
primaryToolId: '',
|
primaryToolId: '',
|
||||||
@ -12,20 +12,20 @@ export default function Toolbar({ servicesManager }) {
|
|||||||
|
|
||||||
// Could track buttons and state separately...?
|
// Could track buttons and state separately...?
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const { unsubscribe: unsub1 } = ToolBarService.subscribe(
|
const { unsubscribe: unsub1 } = toolbarService.subscribe(
|
||||||
ToolBarService.EVENTS.TOOL_BAR_MODIFIED,
|
toolbarService.EVENTS.TOOL_BAR_MODIFIED,
|
||||||
() => setToolbarButtons(ToolBarService.getButtonSection('primary'))
|
() => setToolbarButtons(toolbarService.getButtonSection('primary'))
|
||||||
);
|
);
|
||||||
const { unsubscribe: unsub2 } = ToolBarService.subscribe(
|
const { unsubscribe: unsub2 } = toolbarService.subscribe(
|
||||||
ToolBarService.EVENTS.TOOL_BAR_STATE_MODIFIED,
|
toolbarService.EVENTS.TOOL_BAR_STATE_MODIFIED,
|
||||||
() => setButtonState({ ...ToolBarService.state })
|
() => setButtonState({ ...toolbarService.state })
|
||||||
);
|
);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
unsub1();
|
unsub1();
|
||||||
unsub2();
|
unsub2();
|
||||||
};
|
};
|
||||||
}, [ToolBarService]);
|
}, [toolbarService]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -55,7 +55,7 @@ export default function Toolbar({ servicesManager }) {
|
|||||||
{...componentProps}
|
{...componentProps}
|
||||||
bState={buttonState}
|
bState={buttonState}
|
||||||
isActive={isActive}
|
isActive={isActive}
|
||||||
onInteraction={args => ToolBarService.recordInteraction(args)}
|
onInteraction={args => toolbarService.recordInteraction(args)}
|
||||||
servicesManager={servicesManager}
|
servicesManager={servicesManager}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -6,6 +6,8 @@ import {
|
|||||||
useViewportGrid,
|
useViewportGrid,
|
||||||
} from '@ohif/ui';
|
} from '@ohif/ui';
|
||||||
|
|
||||||
|
import { ServicesManager } from '@ohif/core';
|
||||||
|
|
||||||
function LayoutSelector({
|
function LayoutSelector({
|
||||||
rows,
|
rows,
|
||||||
columns,
|
columns,
|
||||||
@ -17,7 +19,10 @@ function LayoutSelector({
|
|||||||
const [disableSelector, setDisableSelector] = useState(false);
|
const [disableSelector, setDisableSelector] = useState(false);
|
||||||
const [viewportGridState, viewportGridService] = useViewportGrid();
|
const [viewportGridState, viewportGridService] = useViewportGrid();
|
||||||
|
|
||||||
const { HangingProtocolService, ToolBarService } = servicesManager.services;
|
const {
|
||||||
|
HangingProtocolService,
|
||||||
|
toolbarService,
|
||||||
|
} = (servicesManager as ServicesManager).services;
|
||||||
|
|
||||||
const closeOnOutsideClick = () => {
|
const closeOnOutsideClick = () => {
|
||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
@ -61,7 +66,7 @@ function LayoutSelector({
|
|||||||
// TODO Here the layout change will amount to a change of hanging protocol as specified by the extension for this layout selector tool
|
// TODO Here the layout change will amount to a change of hanging protocol as specified by the extension for this layout selector tool
|
||||||
// followed by the change of the grid itself.
|
// followed by the change of the grid itself.
|
||||||
if (HangingProtocolService.getActiveProtocol().protocol.id === 'mpr') {
|
if (HangingProtocolService.getActiveProtocol().protocol.id === 'mpr') {
|
||||||
ToolBarService.recordInteraction({
|
toolbarService.recordInteraction({
|
||||||
groupId: 'MPR',
|
groupId: 'MPR',
|
||||||
itemId: 'MPR',
|
itemId: 'MPR',
|
||||||
interactionType: 'toggle',
|
interactionType: 'toggle',
|
||||||
@ -104,6 +109,7 @@ LayoutSelector.propTypes = {
|
|||||||
rows: PropTypes.number,
|
rows: PropTypes.number,
|
||||||
columns: PropTypes.number,
|
columns: PropTypes.number,
|
||||||
onLayoutChange: PropTypes.func,
|
onLayoutChange: PropTypes.func,
|
||||||
|
servicesManager: PropTypes.instanceOf(ServicesManager),
|
||||||
};
|
};
|
||||||
|
|
||||||
LayoutSelector.defaultProps = {
|
LayoutSelector.defaultProps = {
|
||||||
|
|||||||
@ -4,8 +4,6 @@ import ToolbarLayoutSelector from './Toolbar/ToolbarLayoutSelector.tsx';
|
|||||||
import ToolbarSplitButton from './Toolbar/ToolbarSplitButton.tsx';
|
import ToolbarSplitButton from './Toolbar/ToolbarSplitButton.tsx';
|
||||||
|
|
||||||
export default function getToolbarModule({ commandsManager, servicesManager }) {
|
export default function getToolbarModule({ commandsManager, servicesManager }) {
|
||||||
const toolbarService = servicesManager.services.ToolBarService;
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
name: 'ohif.divider',
|
name: 'ohif.divider',
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState, useCallback } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Input, Button } from '@ohif/ui';
|
import { Input, Button } from '@ohif/ui';
|
||||||
import { DicomMetadataStore } from '@ohif/core';
|
import { DicomMetadataStore, ServicesManager } from '@ohif/core';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const DEFAULT_MEATADATA = {
|
const DEFAULT_MEATADATA = {
|
||||||
@ -27,9 +27,9 @@ export default function PanelPetSUV({ servicesManager, commandsManager }) {
|
|||||||
const {
|
const {
|
||||||
DisplaySetService,
|
DisplaySetService,
|
||||||
ToolGroupService,
|
ToolGroupService,
|
||||||
ToolBarService,
|
toolbarService,
|
||||||
HangingProtocolService,
|
HangingProtocolService,
|
||||||
} = servicesManager.services;
|
} = (servicesManager as ServicesManager).services;
|
||||||
const [metadata, setMetadata] = useState(DEFAULT_MEATADATA);
|
const [metadata, setMetadata] = useState(DEFAULT_MEATADATA);
|
||||||
const [ptDisplaySet, setPtDisplaySet] = useState(null);
|
const [ptDisplaySet, setPtDisplaySet] = useState(null);
|
||||||
|
|
||||||
@ -126,9 +126,9 @@ export default function PanelPetSUV({ servicesManager, commandsManager }) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
ToolBarService.state.toggles['Crosshairs'] = false;
|
toolbarService.state.toggles['Crosshairs'] = false;
|
||||||
ToolBarService._broadcastEvent(
|
toolbarService._broadcastEvent(
|
||||||
ToolBarService.EVENTS.TOOL_BAR_STATE_MODIFIED
|
toolbarService.EVENTS.TOOL_BAR_STATE_MODIFIED
|
||||||
);
|
);
|
||||||
|
|
||||||
// metadata should be dcmjs naturalized
|
// metadata should be dcmjs naturalized
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import toolbarButtons from './toolbarButtons.js';
|
import toolbarButtons from './toolbarButtons.js';
|
||||||
import { hotkeys } from '@ohif/core';
|
import { hotkeys, ServicesManager } from '@ohif/core';
|
||||||
import { id } from './id';
|
import { id } from './id';
|
||||||
|
|
||||||
const configs = {
|
const configs = {
|
||||||
@ -53,7 +53,7 @@ function modeFactory({ modeConfiguration }) {
|
|||||||
* Lifecycle hooks
|
* Lifecycle hooks
|
||||||
*/
|
*/
|
||||||
onModeEnter: ({ servicesManager, extensionManager }) => {
|
onModeEnter: ({ servicesManager, extensionManager }) => {
|
||||||
const { ToolBarService, ToolGroupService } = servicesManager.services;
|
const { toolbarService, ToolGroupService } = servicesManager.services;
|
||||||
const utilityModule = extensionManager.getModuleEntry(
|
const utilityModule = extensionManager.getModuleEntry(
|
||||||
'@ohif/extension-cornerstone.utilityModule.tools'
|
'@ohif/extension-cornerstone.utilityModule.tools'
|
||||||
);
|
);
|
||||||
@ -94,7 +94,7 @@ function modeFactory({ modeConfiguration }) {
|
|||||||
let unsubscribe;
|
let unsubscribe;
|
||||||
|
|
||||||
const activateTool = () => {
|
const activateTool = () => {
|
||||||
ToolBarService.recordInteraction({
|
toolbarService.recordInteraction({
|
||||||
groupId: 'WindowLevel',
|
groupId: 'WindowLevel',
|
||||||
itemId: 'WindowLevel',
|
itemId: 'WindowLevel',
|
||||||
interactionType: 'tool',
|
interactionType: 'tool',
|
||||||
@ -121,9 +121,9 @@ function modeFactory({ modeConfiguration }) {
|
|||||||
activateTool
|
activateTool
|
||||||
));
|
));
|
||||||
|
|
||||||
ToolBarService.init(extensionManager);
|
toolbarService.init(extensionManager);
|
||||||
ToolBarService.addButtons(toolbarButtons);
|
toolbarService.addButtons(toolbarButtons);
|
||||||
ToolBarService.createButtonSection('primary', [
|
toolbarService.createButtonSection('primary', [
|
||||||
'MeasurementTools',
|
'MeasurementTools',
|
||||||
'Zoom',
|
'Zoom',
|
||||||
'WindowLevel',
|
'WindowLevel',
|
||||||
@ -136,10 +136,10 @@ function modeFactory({ modeConfiguration }) {
|
|||||||
const {
|
const {
|
||||||
ToolGroupService,
|
ToolGroupService,
|
||||||
MeasurementService,
|
MeasurementService,
|
||||||
ToolBarService,
|
toolbarService,
|
||||||
} = servicesManager.services;
|
} = servicesManager.services;
|
||||||
|
|
||||||
ToolBarService.reset();
|
toolbarService.reset();
|
||||||
ToolGroupService.destroy();
|
ToolGroupService.destroy();
|
||||||
},
|
},
|
||||||
validationTags: {
|
validationTags: {
|
||||||
|
|||||||
@ -69,7 +69,7 @@ function modeFactory() {
|
|||||||
onModeEnter: ({ servicesManager, extensionManager, commandsManager }) => {
|
onModeEnter: ({ servicesManager, extensionManager, commandsManager }) => {
|
||||||
const {
|
const {
|
||||||
MeasurementService,
|
MeasurementService,
|
||||||
ToolBarService,
|
toolbarService,
|
||||||
ToolGroupService,
|
ToolGroupService,
|
||||||
} = servicesManager.services;
|
} = servicesManager.services;
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ function modeFactory() {
|
|||||||
let unsubscribe;
|
let unsubscribe;
|
||||||
|
|
||||||
const activateTool = () => {
|
const activateTool = () => {
|
||||||
ToolBarService.recordInteraction({
|
toolbarService.recordInteraction({
|
||||||
groupId: 'WindowLevel',
|
groupId: 'WindowLevel',
|
||||||
itemId: 'WindowLevel',
|
itemId: 'WindowLevel',
|
||||||
interactionType: 'tool',
|
interactionType: 'tool',
|
||||||
@ -108,9 +108,9 @@ function modeFactory() {
|
|||||||
activateTool
|
activateTool
|
||||||
));
|
));
|
||||||
|
|
||||||
ToolBarService.init(extensionManager);
|
toolbarService.init(extensionManager);
|
||||||
ToolBarService.addButtons(toolbarButtons);
|
toolbarService.addButtons(toolbarButtons);
|
||||||
ToolBarService.createButtonSection('primary', [
|
toolbarService.createButtonSection('primary', [
|
||||||
'MeasurementTools',
|
'MeasurementTools',
|
||||||
'Zoom',
|
'Zoom',
|
||||||
'WindowLevel',
|
'WindowLevel',
|
||||||
@ -126,12 +126,12 @@ function modeFactory() {
|
|||||||
const {
|
const {
|
||||||
ToolGroupService,
|
ToolGroupService,
|
||||||
SyncGroupService,
|
SyncGroupService,
|
||||||
ToolBarService,
|
toolbarService,
|
||||||
SegmentationService,
|
SegmentationService,
|
||||||
CornerstoneViewportService,
|
CornerstoneViewportService,
|
||||||
} = servicesManager.services;
|
} = servicesManager.services;
|
||||||
|
|
||||||
ToolBarService.reset();
|
toolbarService.reset();
|
||||||
ToolGroupService.destroy();
|
ToolGroupService.destroy();
|
||||||
SyncGroupService.destroy();
|
SyncGroupService.destroy();
|
||||||
SegmentationService.destroy();
|
SegmentationService.destroy();
|
||||||
|
|||||||
@ -69,7 +69,7 @@ function modeFactory() {
|
|||||||
onModeEnter: ({ servicesManager, extensionManager, commandsManager }) => {
|
onModeEnter: ({ servicesManager, extensionManager, commandsManager }) => {
|
||||||
const {
|
const {
|
||||||
MeasurementService,
|
MeasurementService,
|
||||||
ToolBarService,
|
toolbarService,
|
||||||
ToolGroupService,
|
ToolGroupService,
|
||||||
} = servicesManager.services;
|
} = servicesManager.services;
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ function modeFactory() {
|
|||||||
let unsubscribe;
|
let unsubscribe;
|
||||||
|
|
||||||
const activateTool = () => {
|
const activateTool = () => {
|
||||||
ToolBarService.recordInteraction({
|
toolbarService.recordInteraction({
|
||||||
groupId: 'WindowLevel',
|
groupId: 'WindowLevel',
|
||||||
itemId: 'WindowLevel',
|
itemId: 'WindowLevel',
|
||||||
interactionType: 'tool',
|
interactionType: 'tool',
|
||||||
@ -108,9 +108,9 @@ function modeFactory() {
|
|||||||
activateTool
|
activateTool
|
||||||
));
|
));
|
||||||
|
|
||||||
ToolBarService.init(extensionManager);
|
toolbarService.init(extensionManager);
|
||||||
ToolBarService.addButtons(toolbarButtons);
|
toolbarService.addButtons(toolbarButtons);
|
||||||
ToolBarService.createButtonSection('primary', [
|
toolbarService.createButtonSection('primary', [
|
||||||
'MeasurementTools',
|
'MeasurementTools',
|
||||||
'Zoom',
|
'Zoom',
|
||||||
'WindowLevel',
|
'WindowLevel',
|
||||||
@ -126,12 +126,12 @@ function modeFactory() {
|
|||||||
const {
|
const {
|
||||||
ToolGroupService,
|
ToolGroupService,
|
||||||
SyncGroupService,
|
SyncGroupService,
|
||||||
ToolBarService,
|
toolbarService,
|
||||||
SegmentationService,
|
SegmentationService,
|
||||||
CornerstoneViewportService,
|
CornerstoneViewportService,
|
||||||
} = servicesManager.services;
|
} = servicesManager.services;
|
||||||
|
|
||||||
ToolBarService.reset();
|
toolbarService.reset();
|
||||||
ToolGroupService.destroy();
|
ToolGroupService.destroy();
|
||||||
SyncGroupService.destroy();
|
SyncGroupService.destroy();
|
||||||
SegmentationService.destroy();
|
SegmentationService.destroy();
|
||||||
|
|||||||
@ -42,7 +42,7 @@ function modeFactory({ modeConfiguration }) {
|
|||||||
*/
|
*/
|
||||||
onModeEnter: ({ servicesManager, extensionManager, commandsManager }) => {
|
onModeEnter: ({ servicesManager, extensionManager, commandsManager }) => {
|
||||||
const {
|
const {
|
||||||
ToolBarService,
|
toolbarService,
|
||||||
ToolGroupService,
|
ToolGroupService,
|
||||||
HangingProtocolService,
|
HangingProtocolService,
|
||||||
DisplaySetService,
|
DisplaySetService,
|
||||||
@ -58,7 +58,7 @@ function modeFactory({ modeConfiguration }) {
|
|||||||
initToolGroups(toolNames, Enums, ToolGroupService, commandsManager);
|
initToolGroups(toolNames, Enums, ToolGroupService, commandsManager);
|
||||||
|
|
||||||
const setWindowLevelActive = () => {
|
const setWindowLevelActive = () => {
|
||||||
ToolBarService.recordInteraction({
|
toolbarService.recordInteraction({
|
||||||
groupId: 'WindowLevel',
|
groupId: 'WindowLevel',
|
||||||
itemId: 'WindowLevel',
|
itemId: 'WindowLevel',
|
||||||
interactionType: 'tool',
|
interactionType: 'tool',
|
||||||
@ -120,9 +120,9 @@ function modeFactory({ modeConfiguration }) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
unsubscriptions.push(unsubscribe);
|
unsubscriptions.push(unsubscribe);
|
||||||
ToolBarService.init(extensionManager);
|
toolbarService.init(extensionManager);
|
||||||
ToolBarService.addButtons(toolbarButtons);
|
toolbarService.addButtons(toolbarButtons);
|
||||||
ToolBarService.createButtonSection('primary', [
|
toolbarService.createButtonSection('primary', [
|
||||||
'MeasurementTools',
|
'MeasurementTools',
|
||||||
'Zoom',
|
'Zoom',
|
||||||
'WindowLevel',
|
'WindowLevel',
|
||||||
@ -136,13 +136,13 @@ function modeFactory({ modeConfiguration }) {
|
|||||||
const {
|
const {
|
||||||
ToolGroupService,
|
ToolGroupService,
|
||||||
SyncGroupService,
|
SyncGroupService,
|
||||||
ToolBarService,
|
toolbarService,
|
||||||
SegmentationService,
|
SegmentationService,
|
||||||
CornerstoneViewportService,
|
CornerstoneViewportService,
|
||||||
} = servicesManager.services;
|
} = servicesManager.services;
|
||||||
|
|
||||||
unsubscriptions.forEach(unsubscribe => unsubscribe());
|
unsubscriptions.forEach(unsubscribe => unsubscribe());
|
||||||
ToolBarService.reset();
|
toolbarService.reset();
|
||||||
ToolGroupService.destroy();
|
ToolGroupService.destroy();
|
||||||
SyncGroupService.destroy();
|
SyncGroupService.destroy();
|
||||||
SegmentationService.destroy();
|
SegmentationService.destroy();
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import CommandsManager from './CommandsManager.js';
|
import CommandsManager from './CommandsManager';
|
||||||
import log from './../log.js';
|
import log from './../log.js';
|
||||||
|
|
||||||
jest.mock('./../log.js');
|
jest.mock('./../log.js');
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
import CommandsManager from './CommandsManager.js';
|
import CommandsManager from './CommandsManager';
|
||||||
import HotkeysManager from './HotkeysManager.js';
|
import HotkeysManager from './HotkeysManager';
|
||||||
import hotkeys from './../utils/hotkeys';
|
import hotkeys from './../utils/hotkeys';
|
||||||
import log from './../log.js';
|
import log from './../log';
|
||||||
import objectHash from 'object-hash';
|
import objectHash from 'object-hash';
|
||||||
|
|
||||||
jest.mock('./CommandsManager.js');
|
jest.mock('./CommandsManager');
|
||||||
jest.mock('./../utils/hotkeys');
|
jest.mock('./../utils/hotkeys');
|
||||||
jest.mock('./../log.js');
|
jest.mock('./../log');
|
||||||
|
|
||||||
describe('HotkeysManager', () => {
|
describe('HotkeysManager', () => {
|
||||||
let hotkeysManager, commandsManager;
|
let hotkeysManager, commandsManager;
|
||||||
|
|||||||
@ -1,14 +1,9 @@
|
|||||||
import CommandsManager from './CommandsManager.js';
|
import CommandsManager from './CommandsManager';
|
||||||
import HotkeysManager from './HotkeysManager.js';
|
import HotkeysManager from './HotkeysManager';
|
||||||
import ImageSet from './ImageSet';
|
import ImageSet from './ImageSet';
|
||||||
import MetadataProvider from './MetadataProvider';
|
import MetadataProvider from './MetadataProvider';
|
||||||
|
|
||||||
export {
|
export { MetadataProvider, CommandsManager, HotkeysManager, ImageSet };
|
||||||
MetadataProvider,
|
|
||||||
CommandsManager,
|
|
||||||
HotkeysManager,
|
|
||||||
ImageSet,
|
|
||||||
};
|
|
||||||
|
|
||||||
const classes = {
|
const classes = {
|
||||||
MetadataProvider,
|
MetadataProvider,
|
||||||
|
|||||||
@ -24,14 +24,14 @@ describe('Top level exports', () => {
|
|||||||
'OHIF',
|
'OHIF',
|
||||||
//
|
//
|
||||||
'CineService',
|
'CineService',
|
||||||
'CustomizationServiceRegistration',
|
'CustomizationService',
|
||||||
'UIDialogService',
|
'UIDialogService',
|
||||||
'UIModalService',
|
'UIModalService',
|
||||||
'UINotificationService',
|
'UINotificationService',
|
||||||
'UIViewportDialogService',
|
'UIViewportDialogService',
|
||||||
'DisplaySetService',
|
'DisplaySetService',
|
||||||
'MeasurementService',
|
'MeasurementService',
|
||||||
'ToolBarService',
|
'ToolbarService',
|
||||||
'Types',
|
'Types',
|
||||||
'ViewportGridService',
|
'ViewportGridService',
|
||||||
'HangingProtocolService',
|
'HangingProtocolService',
|
||||||
@ -39,6 +39,7 @@ describe('Top level exports', () => {
|
|||||||
'IWebApiDataSource',
|
'IWebApiDataSource',
|
||||||
'DicomMetadataStore',
|
'DicomMetadataStore',
|
||||||
'pubSubServiceInterface',
|
'pubSubServiceInterface',
|
||||||
|
'PubSubService',
|
||||||
].sort();
|
].sort();
|
||||||
|
|
||||||
const exports = Object.keys(OHIF).sort();
|
const exports = Object.keys(OHIF).sort();
|
||||||
|
|||||||
@ -21,13 +21,14 @@ import {
|
|||||||
//
|
//
|
||||||
DicomMetadataStore,
|
DicomMetadataStore,
|
||||||
DisplaySetService,
|
DisplaySetService,
|
||||||
ToolBarService,
|
ToolbarService,
|
||||||
MeasurementService,
|
MeasurementService,
|
||||||
ViewportGridService,
|
ViewportGridService,
|
||||||
HangingProtocolService,
|
HangingProtocolService,
|
||||||
pubSubServiceInterface,
|
pubSubServiceInterface,
|
||||||
|
PubSubService,
|
||||||
UserAuthenticationService,
|
UserAuthenticationService,
|
||||||
CustomizationServiceRegistration,
|
CustomizationService,
|
||||||
} from './services';
|
} from './services';
|
||||||
|
|
||||||
import IWebApiDataSource from './DataSources/IWebApiDataSource';
|
import IWebApiDataSource from './DataSources/IWebApiDataSource';
|
||||||
@ -58,20 +59,21 @@ const OHIF = {
|
|||||||
viewer: {},
|
viewer: {},
|
||||||
//
|
//
|
||||||
CineService,
|
CineService,
|
||||||
CustomizationServiceRegistration,
|
CustomizationService,
|
||||||
UIDialogService,
|
UIDialogService,
|
||||||
UIModalService,
|
UIModalService,
|
||||||
UINotificationService,
|
UINotificationService,
|
||||||
UIViewportDialogService,
|
UIViewportDialogService,
|
||||||
DisplaySetService,
|
DisplaySetService,
|
||||||
MeasurementService,
|
MeasurementService,
|
||||||
ToolBarService, // TODO: TYPO
|
ToolbarService,
|
||||||
ViewportGridService,
|
ViewportGridService,
|
||||||
HangingProtocolService,
|
HangingProtocolService,
|
||||||
UserAuthenticationService,
|
UserAuthenticationService,
|
||||||
IWebApiDataSource,
|
IWebApiDataSource,
|
||||||
DicomMetadataStore,
|
DicomMetadataStore,
|
||||||
pubSubServiceInterface,
|
pubSubServiceInterface,
|
||||||
|
PubSubService,
|
||||||
};
|
};
|
||||||
|
|
||||||
export {
|
export {
|
||||||
@ -94,20 +96,21 @@ export {
|
|||||||
DICOMWeb,
|
DICOMWeb,
|
||||||
//
|
//
|
||||||
CineService,
|
CineService,
|
||||||
CustomizationServiceRegistration,
|
CustomizationService,
|
||||||
UIDialogService,
|
UIDialogService,
|
||||||
UIModalService,
|
UIModalService,
|
||||||
UINotificationService,
|
UINotificationService,
|
||||||
UIViewportDialogService,
|
UIViewportDialogService,
|
||||||
DisplaySetService,
|
DisplaySetService,
|
||||||
MeasurementService,
|
MeasurementService,
|
||||||
ToolBarService,
|
ToolbarService,
|
||||||
ViewportGridService,
|
ViewportGridService,
|
||||||
HangingProtocolService,
|
HangingProtocolService,
|
||||||
UserAuthenticationService,
|
UserAuthenticationService,
|
||||||
IWebApiDataSource,
|
IWebApiDataSource,
|
||||||
DicomMetadataStore,
|
DicomMetadataStore,
|
||||||
pubSubServiceInterface,
|
pubSubServiceInterface,
|
||||||
|
PubSubService,
|
||||||
Types,
|
Types,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -64,9 +64,14 @@ function setServiceImplementation({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
const CineService = {
|
||||||
name,
|
REGISTRATION: {
|
||||||
|
altName: name,
|
||||||
|
name: 'cineService',
|
||||||
create: ({ configuration = {} }) => {
|
create: ({ configuration = {} }) => {
|
||||||
return publicAPI;
|
return publicAPI;
|
||||||
},
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default CineService;
|
||||||
@ -1,6 +1,7 @@
|
|||||||
import merge from 'lodash.merge';
|
import merge from 'lodash.merge';
|
||||||
import { PubSubService } from '../_shared/pubSubServiceInterface';
|
import { PubSubService } from '../_shared/pubSubServiceInterface';
|
||||||
import { Customization, NestedStrings, Obj } from './types';
|
import { Customization, NestedStrings, Obj } from './types';
|
||||||
|
import { CommandsManager } from '../../classes';
|
||||||
|
|
||||||
const EVENTS = {
|
const EVENTS = {
|
||||||
MODE_CUSTOMIZATION_MODIFIED: 'event::CustomizationService:modeModified',
|
MODE_CUSTOMIZATION_MODIFIED: 'event::CustomizationService:modeModified',
|
||||||
@ -50,7 +51,14 @@ const flattenNestedStrings = (
|
|||||||
* every module for the given id and to load it/add it to the extensions.
|
* every module for the given id and to load it/add it to the extensions.
|
||||||
*/
|
*/
|
||||||
export default class CustomizationService extends PubSubService {
|
export default class CustomizationService extends PubSubService {
|
||||||
commandsManager: Record<string, unknown>;
|
public static REGISTRATION = {
|
||||||
|
name: 'customizationService',
|
||||||
|
create: ({ configuration = {}, commandsManager }) => {
|
||||||
|
return new CustomizationService({ configuration, commandsManager });
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
commandsManager: CommandsManager;
|
||||||
extensionManager: Record<string, unknown>;
|
extensionManager: Record<string, unknown>;
|
||||||
|
|
||||||
modeCustomizations: Record<string, Customization> = {};
|
modeCustomizations: Record<string, Customization> = {};
|
||||||
|
|||||||
@ -1,11 +1,3 @@
|
|||||||
import CustomizationService from './CustomizationService';
|
import CustomizationService from './CustomizationService';
|
||||||
|
|
||||||
const CustomizationServiceRegistration = {
|
export default CustomizationService;
|
||||||
name: 'customizationService',
|
|
||||||
create: ({ configuration = {}, commandsManager }) => {
|
|
||||||
return new CustomizationService({ configuration, commandsManager });
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CustomizationServiceRegistration;
|
|
||||||
export { CustomizationService, CustomizationServiceRegistration };
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import pubSubServiceInterface from '../_shared/pubSubServiceInterface';
|
import { PubSubService } from '../_shared/pubSubServiceInterface';
|
||||||
import EVENTS from './EVENTS';
|
import EVENTS from './EVENTS';
|
||||||
|
|
||||||
const displaySetCache = [];
|
const displaySetCache = [];
|
||||||
@ -28,16 +28,21 @@ const findInstance = (instance, displaySets) => {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class DisplaySetService {
|
export default class DisplaySetService extends PubSubService {
|
||||||
constructor() {
|
public static REGISTRATION = {
|
||||||
this.activeDisplaySets = [];
|
altName: 'DisplaySetService',
|
||||||
this.listeners = {};
|
name: 'displaySetService',
|
||||||
this.EVENTS = EVENTS;
|
create: ({ configuration = {} }) => {
|
||||||
|
return new DisplaySetService();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
Object.assign(this, pubSubServiceInterface);
|
public activeDisplaySets = [];
|
||||||
|
constructor() {
|
||||||
|
super(EVENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
init(extensionManager, SOPClassHandlerIds) {
|
public init(extensionManager, SOPClassHandlerIds): void {
|
||||||
this.extensionManager = extensionManager;
|
this.extensionManager = extensionManager;
|
||||||
this.SOPClassHandlerIds = SOPClassHandlerIds;
|
this.SOPClassHandlerIds = SOPClassHandlerIds;
|
||||||
this.activeDisplaySets = [];
|
this.activeDisplaySets = [];
|
||||||
@ -1,8 +0,0 @@
|
|||||||
import DisplaySetService from './DisplaySetService';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'DisplaySetService',
|
|
||||||
create: ({ configuration = {} }) => {
|
|
||||||
return new DisplaySetService();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
3
platform/core/src/services/DisplaySetService/index.ts
Normal file
3
platform/core/src/services/DisplaySetService/index.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import DisplaySetService from './DisplaySetService';
|
||||||
|
|
||||||
|
export default DisplaySetService;
|
||||||
@ -19,6 +19,14 @@ const EVENTS = {
|
|||||||
type Protocol = HangingProtocol.Protocol | HangingProtocol.ProtocolGenerator;
|
type Protocol = HangingProtocol.Protocol | HangingProtocol.ProtocolGenerator;
|
||||||
|
|
||||||
class HangingProtocolService {
|
class HangingProtocolService {
|
||||||
|
public static REGISTRATION = {
|
||||||
|
name: 'hangingProtocolService',
|
||||||
|
altName: 'HangingProtocolService',
|
||||||
|
create: ({ configuration = {}, commandsManager, servicesManager }) => {
|
||||||
|
return new HangingProtocolService(commandsManager, servicesManager);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
studies: StudyMetadata[];
|
studies: StudyMetadata[];
|
||||||
// stores all the protocols (object or function that returns an object) in a map
|
// stores all the protocols (object or function that returns an object) in a map
|
||||||
protocols: Map<string, Protocol>;
|
protocols: Map<string, Protocol>;
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
import HangingProtocolService from './HangingProtocolService';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'HangingProtocolService',
|
|
||||||
create: ({ configuration = {}, commandsManager, servicesManager }) => {
|
|
||||||
return new HangingProtocolService(commandsManager, servicesManager);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
import HangingProtocolService from './HangingProtocolService';
|
||||||
|
|
||||||
|
export default HangingProtocolService;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import MeasurementService from './MeasurementService.js';
|
import MeasurementService from './MeasurementService';
|
||||||
import log from '../../log';
|
import log from '../../log';
|
||||||
|
|
||||||
jest.mock('../../log.js', () => ({
|
jest.mock('../../log', () => ({
|
||||||
info: jest.fn(),
|
info: jest.fn(),
|
||||||
warn: jest.fn(),
|
warn: jest.fn(),
|
||||||
error: jest.fn(),
|
error: jest.fn(),
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import log from '../../log';
|
import log from '../../log';
|
||||||
import guid from '../../utils/guid';
|
import guid from '../../utils/guid';
|
||||||
import pubSubServiceInterface from '../_shared/pubSubServiceInterface';
|
import { PubSubService } from '../_shared/pubSubServiceInterface';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Measurement source schema
|
* Measurement source schema
|
||||||
@ -94,27 +94,27 @@ const VALUE_TYPES = {
|
|||||||
* Note and Todo: We should be able to support measurements that are composed of multiple
|
* Note and Todo: We should be able to support measurements that are composed of multiple
|
||||||
* annotations, but that is not the case at the moment.
|
* annotations, but that is not the case at the moment.
|
||||||
*/
|
*/
|
||||||
class MeasurementService {
|
class MeasurementService extends PubSubService {
|
||||||
|
public static REGISTRATION = {
|
||||||
|
name: 'measurementService',
|
||||||
|
altName: 'MeasurementService',
|
||||||
|
create: ({ configuration = {} }) => {
|
||||||
|
return new MeasurementService();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
super(EVENTS);
|
||||||
this.sources = {};
|
this.sources = {};
|
||||||
this.mappings = {};
|
this.mappings = {};
|
||||||
this.measurements = {};
|
this.measurements = {};
|
||||||
this.listeners = {};
|
|
||||||
this._jumpToMeasurementCache = {};
|
this._jumpToMeasurementCache = {};
|
||||||
Object.defineProperty(this, 'EVENTS', {
|
|
||||||
value: EVENTS,
|
|
||||||
writable: false,
|
|
||||||
enumerable: true,
|
|
||||||
configurable: false,
|
|
||||||
});
|
|
||||||
Object.defineProperty(this, 'VALUE_TYPES', {
|
Object.defineProperty(this, 'VALUE_TYPES', {
|
||||||
value: VALUE_TYPES,
|
value: VALUE_TYPES,
|
||||||
writable: false,
|
writable: false,
|
||||||
enumerable: true,
|
enumerable: true,
|
||||||
configurable: false,
|
configurable: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.assign(this, pubSubServiceInterface);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1,8 +0,0 @@
|
|||||||
import MeasurementService from './MeasurementService';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'MeasurementService',
|
|
||||||
create: ({ configuration = {} }) => {
|
|
||||||
return new MeasurementService();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
3
platform/core/src/services/MeasurementService/index.ts
Normal file
3
platform/core/src/services/MeasurementService/index.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import MeasurementService from './MeasurementService';
|
||||||
|
|
||||||
|
export default MeasurementService;
|
||||||
@ -1,9 +1,9 @@
|
|||||||
import ServicesManager from './ServicesManager.js';
|
import ServicesManager from './ServicesManager';
|
||||||
import log from '../log.js';
|
import log from '../log';
|
||||||
|
|
||||||
jest.mock('./../log.js');
|
jest.mock('./../log');
|
||||||
|
|
||||||
describe('ServicesManager.js', () => {
|
describe('ServicesManager', () => {
|
||||||
let servicesManager, commandsManager;
|
let servicesManager, commandsManager;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
import log from './../log.js';
|
import log from './../log.js';
|
||||||
|
import Services from '../types/Services';
|
||||||
|
|
||||||
export default class ServicesManager {
|
export default class ServicesManager {
|
||||||
|
public services: Services = {};
|
||||||
|
|
||||||
constructor(commandsManager) {
|
constructor(commandsManager) {
|
||||||
this._commandsManager = commandsManager;
|
this._commandsManager = commandsManager;
|
||||||
this.services = {};
|
this.services = {};
|
||||||
@ -39,6 +42,10 @@ export default class ServicesManager {
|
|||||||
commandsManager: this._commandsManager,
|
commandsManager: this._commandsManager,
|
||||||
servicesManager: this,
|
servicesManager: this,
|
||||||
});
|
});
|
||||||
|
if (service.altName) {
|
||||||
|
console.log('Registering old name', service.altName);
|
||||||
|
this.services[service.altName] = this.services[service.name];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log.warn(`Service create factory function not defined. Exiting early.`);
|
log.warn(`Service create factory function not defined. Exiting early.`);
|
||||||
return;
|
return;
|
||||||
@ -1,17 +1,25 @@
|
|||||||
import merge from 'lodash.merge';
|
import merge from 'lodash.merge';
|
||||||
import pubSubServiceInterface from '../_shared/pubSubServiceInterface';
|
import { PubSubService } from '../_shared/pubSubServiceInterface';
|
||||||
|
|
||||||
const EVENTS = {
|
const EVENTS = {
|
||||||
TOOL_BAR_MODIFIED: 'event::toolBarService:toolBarModified',
|
TOOL_BAR_MODIFIED: 'event::toolBarService:toolBarModified',
|
||||||
TOOL_BAR_STATE_MODIFIED: 'event::toolBarService:toolBarStateModified',
|
TOOL_BAR_STATE_MODIFIED: 'event::toolBarService:toolBarStateModified',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class ToolBarService {
|
export default class ToolbarService extends PubSubService {
|
||||||
|
public static REGISTRATION = {
|
||||||
|
name: 'toolbarService',
|
||||||
|
// Note the old name is ToolBarService, with an upper B
|
||||||
|
altName: 'ToolBarService',
|
||||||
|
create: ({ commandsManager }) => {
|
||||||
|
return new ToolbarService(commandsManager);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
constructor(commandsManager) {
|
constructor(commandsManager) {
|
||||||
|
super(EVENTS);
|
||||||
this._commandsManager = commandsManager;
|
this._commandsManager = commandsManager;
|
||||||
//
|
//
|
||||||
this.EVENTS = EVENTS;
|
|
||||||
this.listeners = {};
|
|
||||||
this.buttons = {};
|
this.buttons = {};
|
||||||
this.unsubscriptions = []; // if tools need to unsubscribe from events
|
this.unsubscriptions = []; // if tools need to unsubscribe from events
|
||||||
this.buttonSections = {
|
this.buttonSections = {
|
||||||
@ -32,8 +40,6 @@ export default class ToolBarService {
|
|||||||
/* track most recent click per group...? */
|
/* track most recent click per group...? */
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.assign(this, pubSubServiceInterface);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
init(extensionManager) {
|
init(extensionManager) {
|
||||||
@ -1,8 +1,3 @@
|
|||||||
import ToolBarService from './ToolBarService';
|
import ToolbarService from './ToolbarService';
|
||||||
|
|
||||||
export default {
|
export default ToolbarService;
|
||||||
name: 'ToolBarService',
|
|
||||||
create: ({ configuration = {}, commandsManager }) => {
|
|
||||||
return new ToolBarService(commandsManager);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
* @property {Function} onDrag Called while dragging.
|
* @property {Function} onDrag Called while dragging.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const name = 'UIDialogService';
|
const name = 'uiDialogService';
|
||||||
|
|
||||||
const publicAPI = {
|
const publicAPI = {
|
||||||
name,
|
name,
|
||||||
@ -119,9 +119,13 @@ function setServiceImplementation({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO - export type here
|
||||||
export default {
|
export default {
|
||||||
|
REGISTRATION: {
|
||||||
name,
|
name,
|
||||||
|
altName: 'UIDialogService',
|
||||||
create: ({ configuration = {} }) => {
|
create: ({ configuration = {} }) => {
|
||||||
return publicAPI;
|
return publicAPI;
|
||||||
},
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
* @property {string} [customClassName=null] The custom class to style the modal.
|
* @property {string} [customClassName=null] The custom class to style the modal.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const name = 'UIModalService';
|
const name = 'uiModalService';
|
||||||
|
|
||||||
const publicAPI = {
|
const publicAPI = {
|
||||||
name,
|
name,
|
||||||
@ -79,9 +79,13 @@ function setServiceImplementation({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO - export TS Type
|
||||||
export default {
|
export default {
|
||||||
|
REGISTRATION: {
|
||||||
name,
|
name,
|
||||||
|
altName: 'UIModalService',
|
||||||
create: ({ configuration = {} }) => {
|
create: ({ configuration = {} }) => {
|
||||||
return publicAPI;
|
return publicAPI;
|
||||||
},
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
* @property {boolean} [autoClose=true]
|
* @property {boolean} [autoClose=true]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const name = 'UINotificationService';
|
const name = 'uiNotificationService';
|
||||||
|
|
||||||
const serviceShowRequestQueue = [];
|
const serviceShowRequestQueue = [];
|
||||||
|
|
||||||
@ -91,8 +91,11 @@ function setServiceImplementation({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
REGISTRATION: {
|
||||||
name,
|
name,
|
||||||
|
altName: 'UINotificationService',
|
||||||
create: ({ configuration = {} }) => {
|
create: ({ configuration = {} }) => {
|
||||||
return publicAPI;
|
return publicAPI;
|
||||||
},
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -75,8 +75,10 @@ function setServiceImplementation({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
REGISTRATION: {
|
||||||
name,
|
name,
|
||||||
create: ({ configuration = {} }) => {
|
create: ({ configuration = {} }) => {
|
||||||
return publicAPI;
|
return publicAPI;
|
||||||
},
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
const name = 'UserAuthenticationService';
|
const name = 'userAuthenticationService';
|
||||||
|
|
||||||
const publicAPI = {
|
const publicAPI = {
|
||||||
name,
|
name,
|
||||||
@ -85,8 +85,11 @@ function setServiceImplementation({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
REGISTRATION: {
|
||||||
name,
|
name,
|
||||||
|
altName: 'UserAuthenticationService',
|
||||||
create: ({ configuration = {} }) => {
|
create: ({ configuration = {} }) => {
|
||||||
return publicAPI;
|
return publicAPI;
|
||||||
},
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,21 +1,26 @@
|
|||||||
import pubSubServiceInterface from './../_shared/pubSubServiceInterface';
|
import { PubSubService } from '../_shared/pubSubServiceInterface';
|
||||||
|
|
||||||
const EVENTS = {
|
const EVENTS = {
|
||||||
ACTIVE_VIEWPORT_INDEX_CHANGED: 'event::activeviewportindexchanged',
|
ACTIVE_VIEWPORT_INDEX_CHANGED: 'event::activeviewportindexchanged',
|
||||||
};
|
};
|
||||||
|
|
||||||
class ViewportGridService {
|
class ViewportGridService extends PubSubService {
|
||||||
|
public static REGISTRATION = {
|
||||||
|
name: 'viewportGridService',
|
||||||
|
altName: 'ViewportGridService',
|
||||||
|
create: ({ configuration = {} }) => {
|
||||||
|
return new ViewportGridService();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
serviceImplementation = {};
|
serviceImplementation = {};
|
||||||
EVENTS: { [key: string]: string };
|
|
||||||
listeners = {};
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
Object.assign(this, pubSubServiceInterface);
|
super(EVENTS);
|
||||||
this.serviceImplementation = {};
|
this.serviceImplementation = {};
|
||||||
this.EVENTS = EVENTS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setServiceImplementation({
|
public setServiceImplementation({
|
||||||
getState: getStateImplementation,
|
getState: getStateImplementation,
|
||||||
setActiveViewportIndex: setActiveViewportIndexImplementation,
|
setActiveViewportIndex: setActiveViewportIndexImplementation,
|
||||||
setDisplaySetsForViewport: setDisplaySetsForViewportImplementation,
|
setDisplaySetsForViewport: setDisplaySetsForViewportImplementation,
|
||||||
@ -26,7 +31,7 @@ class ViewportGridService {
|
|||||||
reset: resetImplementation,
|
reset: resetImplementation,
|
||||||
onModeExit: onModeExitImplementation,
|
onModeExit: onModeExitImplementation,
|
||||||
set: setImplementation,
|
set: setImplementation,
|
||||||
}) {
|
}): void {
|
||||||
if (getStateImplementation) {
|
if (getStateImplementation) {
|
||||||
this.serviceImplementation._getState = getStateImplementation;
|
this.serviceImplementation._getState = getStateImplementation;
|
||||||
}
|
}
|
||||||
@ -119,9 +124,4 @@ class ViewportGridService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default ViewportGridService;
|
||||||
name: 'ViewportGridService',
|
|
||||||
create: ({ configuration = {} }) => {
|
|
||||||
return new ViewportGridService();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
import MeasurementService from './MeasurementService';
|
import MeasurementService from './MeasurementService';
|
||||||
import ServicesManager from './ServicesManager.js';
|
import ServicesManager from './ServicesManager';
|
||||||
import UIDialogService from './UIDialogService';
|
import UIDialogService from './UIDialogService';
|
||||||
import UIModalService from './UIModalService';
|
import UIModalService from './UIModalService';
|
||||||
import UINotificationService from './UINotificationService';
|
import UINotificationService from './UINotificationService';
|
||||||
import UIViewportDialogService from './UIViewportDialogService';
|
import UIViewportDialogService from './UIViewportDialogService';
|
||||||
import DicomMetadataStore from './DicomMetadataStore';
|
import DicomMetadataStore from './DicomMetadataStore';
|
||||||
import DisplaySetService from './DisplaySetService';
|
import DisplaySetService from './DisplaySetService';
|
||||||
import ToolBarService from './ToolBarService';
|
import ToolbarService from './ToolBarService';
|
||||||
import ViewportGridService from './ViewportGridService';
|
import ViewportGridService from './ViewportGridService';
|
||||||
import CineService from './CineService';
|
import CineService from './CineService';
|
||||||
import HangingProtocolService from './HangingProtocolService';
|
import HangingProtocolService from './HangingProtocolService';
|
||||||
@ -14,23 +14,22 @@ import pubSubServiceInterface, {
|
|||||||
PubSubService,
|
PubSubService,
|
||||||
} from './_shared/pubSubServiceInterface';
|
} from './_shared/pubSubServiceInterface';
|
||||||
import UserAuthenticationService from './UserAuthenticationService';
|
import UserAuthenticationService from './UserAuthenticationService';
|
||||||
import {
|
import CustomizationService from './CustomizationService';
|
||||||
CustomizationService,
|
|
||||||
CustomizationServiceRegistration,
|
import Services from '../types/Services';
|
||||||
} from './CustomizationService';
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
Services,
|
||||||
MeasurementService,
|
MeasurementService,
|
||||||
ServicesManager,
|
ServicesManager,
|
||||||
CustomizationService,
|
CustomizationService,
|
||||||
CustomizationServiceRegistration,
|
|
||||||
UIDialogService,
|
UIDialogService,
|
||||||
UIModalService,
|
UIModalService,
|
||||||
UINotificationService,
|
UINotificationService,
|
||||||
UIViewportDialogService,
|
UIViewportDialogService,
|
||||||
DicomMetadataStore,
|
DicomMetadataStore,
|
||||||
DisplaySetService,
|
DisplaySetService,
|
||||||
ToolBarService,
|
ToolbarService,
|
||||||
ViewportGridService,
|
ViewportGridService,
|
||||||
HangingProtocolService,
|
HangingProtocolService,
|
||||||
CineService,
|
CineService,
|
||||||
27
platform/core/src/types/Services.ts
Normal file
27
platform/core/src/types/Services.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import {
|
||||||
|
HangingProtocolService,
|
||||||
|
CustomizationService,
|
||||||
|
MeasurementService,
|
||||||
|
ViewportGridService,
|
||||||
|
ToolbarService,
|
||||||
|
DisplaySetService,
|
||||||
|
} from '../services';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The interface for the services object
|
||||||
|
*/
|
||||||
|
export default interface Services {
|
||||||
|
hangingProtocolService?: HangingProtocolService;
|
||||||
|
customizationService?: CustomizationService;
|
||||||
|
measurementService?: MeasurementService;
|
||||||
|
displaySetService?: DisplaySetService;
|
||||||
|
cineService?: Record<string, unknown>;
|
||||||
|
toolbarService?: ToolbarService;
|
||||||
|
cornerstoneViewportService?: Record<string, unknown>;
|
||||||
|
uiDialogService?: Record<string, unknown>;
|
||||||
|
toolGroupService?: Record<string, unknown>;
|
||||||
|
uiNotificationService?: Record<string, unknown>;
|
||||||
|
viewportGridService?: ViewportGridService;
|
||||||
|
syncGroupService?: Record<string, unknown>;
|
||||||
|
cornerstoneCacheService?: Record<string, unknown>;
|
||||||
|
}
|
||||||
@ -9,6 +9,8 @@ import { ExtensionManager } from '../extensions';
|
|||||||
import { CustomizationService, PubSubService } from '../services';
|
import { CustomizationService, PubSubService } from '../services';
|
||||||
import * as HangingProtocol from './HangingProtocol';
|
import * as HangingProtocol from './HangingProtocol';
|
||||||
import Command from './Command';
|
import Command from './Command';
|
||||||
|
import Services from './Services';
|
||||||
|
import { CommandsManager } from '../classes';
|
||||||
|
|
||||||
export * from '../services/CustomizationService/types';
|
export * from '../services/CustomizationService/types';
|
||||||
|
|
||||||
@ -22,4 +24,6 @@ export type {
|
|||||||
PubSubService,
|
PubSubService,
|
||||||
CustomizationService,
|
CustomizationService,
|
||||||
Command,
|
Command,
|
||||||
|
Services,
|
||||||
|
CommandsManager,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -92,7 +92,7 @@ const SplitButton = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation('Buttons');
|
const { t } = useTranslation('Buttons');
|
||||||
|
|
||||||
const { ToolBarService } = servicesManager.services;
|
const { toolbarService } = servicesManager.services;
|
||||||
|
|
||||||
const { primaryToolId, toggles } = bState;
|
const { primaryToolId, toggles } = bState;
|
||||||
/* Bubbles up individual item clicks */
|
/* Bubbles up individual item clicks */
|
||||||
@ -146,7 +146,7 @@ const SplitButton = ({
|
|||||||
(isPrimaryToggle && toggles[state.primary.id] === true);
|
(isPrimaryToggle && toggles[state.primary.id] === true);
|
||||||
|
|
||||||
const PrimaryButtonComponent =
|
const PrimaryButtonComponent =
|
||||||
ToolBarService.getButtonComponentForUIType(state.primary.uiType) ??
|
toolbarService.getButtonComponentForUIType(state.primary.uiType) ??
|
||||||
ToolbarButton;
|
ToolbarButton;
|
||||||
|
|
||||||
const primaryButtonClassName = classes.Primary({
|
const primaryButtonClassName = classes.Primary({
|
||||||
@ -197,7 +197,7 @@ const SplitButton = ({
|
|||||||
{...state.primary}
|
{...state.primary}
|
||||||
bState={bState}
|
bState={bState}
|
||||||
isActive={isPrimaryActive}
|
isActive={isPrimaryActive}
|
||||||
onInteraction={args => ToolBarService.recordInteraction(args)}
|
onInteraction={args => toolbarService.recordInteraction(args)}
|
||||||
servicesManager={servicesManager}
|
servicesManager={servicesManager}
|
||||||
// All rounding is taken care of by className
|
// All rounding is taken care of by className
|
||||||
rounded="none"
|
rounded="none"
|
||||||
@ -295,7 +295,7 @@ SplitButton.propTypes = {
|
|||||||
isActive: PropTypes.bool,
|
isActive: PropTypes.bool,
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
/** Callback function to inform ToolBarService of important events */
|
/** Callback function to inform toolbarService of important events */
|
||||||
onInteraction: PropTypes.func.isRequired,
|
onInteraction: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -9,13 +9,13 @@ import {
|
|||||||
UIViewportDialogService,
|
UIViewportDialogService,
|
||||||
MeasurementService,
|
MeasurementService,
|
||||||
DisplaySetService,
|
DisplaySetService,
|
||||||
ToolBarService,
|
ToolbarService,
|
||||||
ViewportGridService,
|
ViewportGridService,
|
||||||
HangingProtocolService,
|
HangingProtocolService,
|
||||||
CineService,
|
CineService,
|
||||||
UserAuthenticationService,
|
UserAuthenticationService,
|
||||||
errorHandler,
|
errorHandler,
|
||||||
CustomizationServiceRegistration,
|
CustomizationService,
|
||||||
// utils,
|
// utils,
|
||||||
} from '@ohif/core';
|
} from '@ohif/core';
|
||||||
|
|
||||||
@ -45,18 +45,18 @@ async function appInit(appConfigOrFunc, defaultExtensions, defaultModes) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
servicesManager.registerServices([
|
servicesManager.registerServices([
|
||||||
UINotificationService,
|
UINotificationService.REGISTRATION,
|
||||||
UIModalService,
|
UIModalService.REGISTRATION,
|
||||||
UIDialogService,
|
UIDialogService.REGISTRATION,
|
||||||
UIViewportDialogService,
|
UIViewportDialogService.REGISTRATION,
|
||||||
MeasurementService,
|
MeasurementService.REGISTRATION,
|
||||||
DisplaySetService,
|
DisplaySetService.REGISTRATION,
|
||||||
[CustomizationServiceRegistration, appConfig.customizationService],
|
[CustomizationService.REGISTRATION, appConfig.customizationService],
|
||||||
ToolBarService,
|
ToolbarService.REGISTRATION,
|
||||||
ViewportGridService,
|
ViewportGridService.REGISTRATION,
|
||||||
HangingProtocolService,
|
HangingProtocolService.REGISTRATION,
|
||||||
CineService,
|
CineService.REGISTRATION,
|
||||||
UserAuthenticationService,
|
UserAuthenticationService.REGISTRATION,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
errorHandler.getHTTPErrorHandler = () => {
|
errorHandler.getHTTPErrorHandler = () => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user