Update toolbar service to use button types, update longitudinal flow to use new service api

This commit is contained in:
dannyrb committed 2020-06-14 21:20:32 -04:00
1 parent f70392a52a
commit 83e191b850
3 files changed
+247 -87

No files matched your search

+17 -48
View File
@@ -1,3 +1,5 @@
import toolbarButtons from './toolbarButtons.js';
const ohif = {
layout: 'org.ohif.default.layoutTemplateModule.viewerLayout',
sopClassHandler: 'org.ohif.default.sopClassHandlerModule.stack',
@@ -27,57 +29,24 @@ export default function mode({ modeConfiguration }) {
init: ({ servicesManager, extensionManager }) => {
const { ToolBarService } = servicesManager.services;
ToolBarService.init(extensionManager);
ToolBarService.addButtons([
{
id: 'Zoom',
namespace: 'org.ohif.cornerstone.toolbarModule.Zoom',
},
{
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',
},
ToolBarService.addButtons(toolbarButtons);
ToolBarService.createButtonSection('primary', [
'Zoom',
'Wwwc',
'Pan',
'Capture', // toggle --> command to open capture modal? needs to know when it should be off? (promise?)
'Layout', // toggle --> command to open layout dialog? needs to know when it should be off? (promise?)
'Divider',
'Zoom', // ? array of arrays?
]);
ToolBarService.createButtonSection('secondary', [
'Annotate',
'Bidirectional',
'Ellipse',
'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'],
},
]);
},
layoutTemplate: ({ routeProps }) => {
return {