Pull in master

This commit is contained in:
James A. Petts committed 2020-06-15 10:23:35 +02:00
commit e7501933dd
47 files changed
+879 -3000

No files matched your search

+11 -11
View File
@@ -55,17 +55,17 @@ export default function mode({ modeConfiguration }) {
]);
// 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'],
},
]);
// ToolBarService.setToolBarLayout([
// // Primary
// {
// tools: ['Zoom', 'Levels', 'Pan', 'Capture', 'Layout'],
// moreTools: ['Zoom'],
// },
// // Secondary
// {
// tools: ['Annotate', 'Bidirectional', 'Ellipse', 'Length'],
// },
// ]);
},
layoutTemplate: ({ routeProps }) => {
return {
+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',
'Layout',
'Divider',
['Zoom', 'Wwwc'],
]);
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 {
+132
View File
@@ -0,0 +1,132 @@
// TODO: torn, can either bake this here; or have to create a whole new button type
// Only ways that you can pass in a custom React component for render :l
export default [
// Divider
{
id: 'Divider',
type: 'ohif.divider',
},
// ~~ Primary
{
id: 'Zoom',
type: 'ohif.radioGroup',
config: {
groupName: 'primaryTool',
},
props: {
isActive: false,
icon: 'tool-zoom',
label: 'Zoom',
commandName: 'setToolActive',
commandOptions: { toolName: 'Zoom' },
type: 'primary',
},
},
{
id: 'Wwwc',
type: 'ohif.radioGroup',
config: {
groupName: 'primaryTool',
},
props: {
isActive: true,
icon: 'tool-window-level',
label: 'Levels',
commandName: 'setToolActive',
commandOptions: { toolName: 'Wwwc' },
type: 'primary',
},
},
{
id: 'Pan',
type: 'ohif.radioGroup',
config: {
groupName: 'primaryTool',
},
props: {
isActive: false,
icon: 'tool-move',
label: 'Pan',
commandName: 'setToolActive',
commandOptions: { toolName: 'Pan' },
type: 'primary',
},
},
{
id: 'Capture',
type: 'ohif.action',
props: {
icon: 'tool-capture',
label: 'Capture',
commandName: 'showDownloadViewportModal',
type: 'primary',
},
},
{
id: 'Layout',
type: 'ohif.layoutSelector',
},
// ~~ Primary: NESTED
// ~~ Secondary
{
id: 'Annotate',
type: 'ohif.radioGroup',
config: {
groupName: 'primaryTool',
},
props: {
isActive: false,
icon: 'tool-annotate',
label: 'Annotate',
commandName: 'setToolActive',
commandOptions: { toolName: 'ArrowAnnotate' },
type: 'secondary',
},
},
{
id: 'Bidirectional',
type: 'ohif.radioGroup',
config: {
groupName: 'primaryTool',
},
props: {
isActive: false,
icon: 'tool-bidirectional',
label: 'Bidirectional',
commandName: 'setToolActive',
commandOptions: { toolName: 'Bidirectional' },
type: 'secondary',
},
},
{
id: 'Ellipse',
type: 'ohif.radioGroup',
config: {
groupName: 'primaryTool',
},
props: {
isActive: false,
icon: 'tool-elipse',
label: 'Ellipse',
commandName: 'setToolActive',
commandOptions: { toolName: 'EllipticalRoi' },
type: 'secondary',
},
},
{
id: 'Length',
type: 'ohif.radioGroup',
config: {
groupName: 'primaryTool',
},
props: {
isActive: false,
icon: 'tool-length',
label: 'Length',
commandName: 'setToolActive',
commandOptions: { toolName: 'Length' },
type: 'secondary',
},
},
];