Expose ViewportGridService API methods to extensions
This commit is contained in:
1 parent
1a065855f2
commit
6e873cc92a
7 files changed
+199
-60
No files matched your search
@@ -30,8 +30,9 @@ import {
|
||||
//
|
||||
DicomMetadataStore,
|
||||
DisplaySetService,
|
||||
ToolBarSerivce,
|
||||
ToolBarSerivce, // TODO: Typo
|
||||
MeasurementService,
|
||||
ViewportGridService,
|
||||
} from './services';
|
||||
|
||||
import IWebApiDataSource from './DataSources/IWebApiDataSource';
|
||||
@@ -70,7 +71,8 @@ const OHIF = {
|
||||
UIViewportDialogService,
|
||||
DisplaySetService,
|
||||
MeasurementService,
|
||||
ToolBarSerivce,
|
||||
ToolBarSerivce, // TODO: TYPO
|
||||
ViewportGridService,
|
||||
IWebApiDataSource,
|
||||
DicomMetadataStore,
|
||||
//
|
||||
@@ -112,6 +114,7 @@ export {
|
||||
DisplaySetService,
|
||||
MeasurementService,
|
||||
ToolBarSerivce,
|
||||
ViewportGridService,
|
||||
IWebApiDataSource,
|
||||
DicomMetadataStore,
|
||||
ViewModelProvider,
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
const name = 'ViewportGridService';
|
||||
|
||||
const publicAPI = {
|
||||
name,
|
||||
hide: _hide,
|
||||
show: _show,
|
||||
setServiceImplementation,
|
||||
};
|
||||
|
||||
const serviceImplementation = {
|
||||
_hide: () => console.warn('hide() NOT IMPLEMENTED'),
|
||||
_show: () => console.warn('show() NOT IMPLEMENTED'),
|
||||
};
|
||||
|
||||
function _show({ viewportIndex, type, message, actions, onSubmit }) {
|
||||
return serviceImplementation._show({
|
||||
viewportIndex,
|
||||
type,
|
||||
message,
|
||||
actions,
|
||||
onSubmit,
|
||||
});
|
||||
}
|
||||
|
||||
function _hide() {
|
||||
return serviceImplementation._hide();
|
||||
}
|
||||
|
||||
function setServiceImplementation({
|
||||
hide: hideImplementation,
|
||||
show: showImplementation,
|
||||
}) {
|
||||
if (hideImplementation) {
|
||||
serviceImplementation._hide = hideImplementation;
|
||||
}
|
||||
if (showImplementation) {
|
||||
serviceImplementation._show = showImplementation;
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
name,
|
||||
create: ({ configuration = {} }) => {
|
||||
return publicAPI;
|
||||
},
|
||||
};
|
||||
|
||||
// initialState={{
|
||||
// numRows: 1,
|
||||
// numCols: 1,
|
||||
// viewports: [],
|
||||
// activeViewportIndex: 0,
|
||||
// }}
|
||||
// reducer={viewportGridReducer}
|
||||
@@ -0,0 +1,3 @@
|
||||
import ViewportGridService from './ViewportGridService';
|
||||
|
||||
export default ViewportGridService;
|
||||
@@ -7,6 +7,7 @@ import UIViewportDialogService from './UIViewportDialogService';
|
||||
import DicomMetadataStore from './DicomMetadataStore';
|
||||
import DisplaySetService from './DisplaySetService';
|
||||
import ToolBarSerivce from './ToolBarService';
|
||||
import ViewportGridService from './ViewportGridService';
|
||||
|
||||
export {
|
||||
MeasurementService,
|
||||
@@ -18,4 +19,5 @@ export {
|
||||
DicomMetadataStore,
|
||||
DisplaySetService,
|
||||
ToolBarSerivce,
|
||||
ViewportGridService,
|
||||
};
|
||||
Reference in new issue
Block a user