ohif-viewer/modes/example/src/index.js

62 lines
1.9 KiB
JavaScript
Raw Normal View History

2020-05-07 18:16:44 +02:00
export default function mode({ modeConfiguration }) {
return {
id: 'example-mode',
validationTags: {
study: [],
series: [],
},
isValidMode: (studyTags, seriesTags) => {
// All series are welcome in this mode!
return true;
},
routes: [
{
path: 'viewer',
init: ({ toolbarManager }) => {
toolbarManager.addButtons([
{
id: 'StackScroll', // If id not given will use default in button definition.
namespace: 'org.ohif.cornerstone.toolbarModule.StackScroll',
},
{
id: 'Zoom',
namespace: 'org.ohif.cornerstone.toolbarModule.Zoom',
},
]);
// Could import layout selector here from org.ohif.default (when it exists!)
toolbarManager.setToolBarLayout([
// Primary
['StackScroll', { label: 'More', subMenu: ['Zoom'] }],
// Secondary
['StackScroll'],
]);
2020-05-07 18:16:44 +02:00
},
layoutTemplate: ({ routeProps }) => {
return {
id: 'org.ohif.default.layoutTemplateModule.viewerLayout',
2020-05-07 18:16:44 +02:00
props: {
// named slots
leftPanels: ['org.ohif.default.panelModule.seriesList'],
rightPanels: ['org.ohif.default.panelModule.measure'],
2020-05-12 21:41:11 +02:00
viewports: [
{
namespace:
'org.ohif.cornerstone.viewportModule.OHIFCornerstoneViewport',
displaySetsToDisplay: [
'org.ohif.default.sopClassHandlerModule.stack',
],
},
],
2020-05-07 18:16:44 +02:00
},
};
},
},
],
extensions: ['org.ohif.default', 'org.ohif.cornerstone'],
sopClassHandlers: ['org.ohif.default.sopClassHandlerModule.stack'],
2020-05-07 18:16:44 +02:00
};
}
window.exampleMode = mode({});