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

97 lines
3.0 KiB
JavaScript
Raw Normal View History

2020-05-07 18:16:44 +02:00
export default function mode({ modeConfiguration }) {
return {
id: 'example-mode',
displayName: 'Basic Viewer',
2020-05-07 18:16:44 +02:00
validationTags: {
study: [],
series: [],
},
isValidMode: (studyTags, seriesTags) => {
// All series are welcome in this mode!
return true;
},
routes: [
{
path: 'viewer',
2020-05-19 11:01:44 +02:00
init: ({ servicesManager, extensionManager }) => {
const { ToolBarService } = servicesManager.services;
ToolBarService.init(extensionManager);
ToolBarService.addButtons([
{
id: 'Zoom',
namespace: 'org.ohif.cornerstone.toolbarModule.Zoom',
},
2020-05-13 14:22:08 +02:00
{
id: 'Levels',
namespace: 'org.ohif.cornerstone.toolbarModule.Wwwc',
},
{
id: 'Pan',
namespace: 'org.ohif.cornerstone.toolbarModule.Pan',
},
{
id: 'Capture',
namespace: 'org.ohif.cornerstone.toolbarModule.Capture',
},
{
id: 'Layout',
namespace: 'org.ohif.default.toolbarModule.Layout',
},
{
id: 'Annotate',
namespace: 'org.ohif.cornerstone.toolbarModule.Annotate',
},
{
id: 'Bidirectional',
namespace: 'org.ohif.cornerstone.toolbarModule.Bidirectional',
},
{
id: 'Ellipse',
namespace: 'org.ohif.cornerstone.toolbarModule.Ellipse',
},
{
id: 'Length',
namespace: 'org.ohif.cornerstone.toolbarModule.Length',
},
]);
// Could import layout selector here from org.ohif.default (when it exists!)
// ToolBarService.setToolBarLayout([
// // Primary
// {
// tools: ['Zoom', 'Levels', 'Pan', 'Capture', 'Layout'],
// moreTools: ['Zoom'],
// },
// // Secondary
// {
// tools: ['Annotate', 'Bidirectional', 'Ellipse', 'Length'],
// },
// ]);
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: [
{
2020-05-15 19:07:21 +02:00
namespace: 'org.ohif.cornerstone.viewportModule.cornerstone',
2020-05-12 21:41:11 +02:00
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({});