Added other required definitions.
This commit is contained in:
parent
41c508b2da
commit
07ca72d0df
@ -35,15 +35,7 @@ const enums = {
|
||||
};
|
||||
|
||||
const definitions = [
|
||||
{
|
||||
id: 'StackScroll',
|
||||
label: 'Stack Scroll',
|
||||
icon: 'bars',
|
||||
//
|
||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'StackScroll' },
|
||||
},
|
||||
// UPDATED
|
||||
{
|
||||
id: 'Zoom',
|
||||
label: 'Zoom',
|
||||
@ -56,7 +48,7 @@ const definitions = [
|
||||
{
|
||||
id: 'Wwwc',
|
||||
label: 'Levels',
|
||||
icon: 'level',
|
||||
icon: 'tool-window-level',
|
||||
//
|
||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||
commandName: 'setToolActive',
|
||||
@ -65,30 +57,70 @@ const definitions = [
|
||||
{
|
||||
id: 'Pan',
|
||||
label: 'Pan',
|
||||
icon: 'arrows',
|
||||
icon: 'tool-move',
|
||||
//
|
||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Pan' },
|
||||
},
|
||||
{
|
||||
id: 'Length',
|
||||
label: 'Length',
|
||||
icon: 'measure-temp',
|
||||
id: 'Capture',
|
||||
label: 'Capture',
|
||||
icon: 'tool-capture',
|
||||
//
|
||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Length' },
|
||||
type: TOOLBAR_BUTTON_TYPES.BUILT_IN,
|
||||
options: {
|
||||
behavior: TOOLBAR_BUTTON_BEHAVIORS.DOWNLOAD_SCREEN_SHOT,
|
||||
togglable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'ArrowAnnotate',
|
||||
id: 'Annotate',
|
||||
label: 'Annotate',
|
||||
icon: 'measure-non-target',
|
||||
icon: 'tool-annotate',
|
||||
//
|
||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'ArrowAnnotate' },
|
||||
},
|
||||
{
|
||||
id: 'Bidirectional',
|
||||
label: 'Bidirectional',
|
||||
icon: 'tool-bidirectional',
|
||||
//
|
||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Bidirectional' },
|
||||
},
|
||||
{
|
||||
id: 'Ellipse',
|
||||
label: 'Ellipse',
|
||||
icon: 'tool-elipse',
|
||||
//
|
||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'EllipticalRoi' },
|
||||
},
|
||||
{
|
||||
id: 'Length',
|
||||
label: 'Length',
|
||||
icon: 'tool-length',
|
||||
//
|
||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Length' },
|
||||
},
|
||||
// OLD
|
||||
{
|
||||
id: 'StackScroll',
|
||||
label: 'Stack Scroll',
|
||||
icon: 'bars',
|
||||
//
|
||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'StackScroll' },
|
||||
},
|
||||
|
||||
{
|
||||
id: 'Angle',
|
||||
label: 'Angle',
|
||||
@ -148,15 +180,6 @@ const definitions = [
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'DragProbe' },
|
||||
},
|
||||
{
|
||||
id: 'EllipticalRoi',
|
||||
label: 'Ellipse',
|
||||
icon: 'circle-o',
|
||||
//
|
||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'EllipticalRoi' },
|
||||
},
|
||||
{
|
||||
id: 'RectangleRoi',
|
||||
label: 'Rectangle',
|
||||
@ -207,24 +230,13 @@ const definitions = [
|
||||
commandName: 'clearAnnotations',
|
||||
},
|
||||
{
|
||||
id: 'Bidirectional',
|
||||
label: 'Bidirectional',
|
||||
icon: 'measure-target',
|
||||
id: 'Eraser',
|
||||
label: 'Eraser',
|
||||
icon: 'eraser',
|
||||
//
|
||||
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Bidirectional' },
|
||||
},
|
||||
{
|
||||
id: 'Download',
|
||||
label: 'Download',
|
||||
icon: 'create-screen-capture',
|
||||
//
|
||||
type: TOOLBAR_BUTTON_TYPES.BUILT_IN,
|
||||
options: {
|
||||
behavior: TOOLBAR_BUTTON_BEHAVIORS.DOWNLOAD_SCREEN_SHOT,
|
||||
togglable: true,
|
||||
},
|
||||
commandOptions: { toolName: 'Eraser' },
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@ -30,6 +30,7 @@ const Header = ({ tools, moreTools }) => {
|
||||
{ name: 'Bone', value: '2500 / 480' },
|
||||
{ name: 'Brain', value: '80 / 40' },
|
||||
];
|
||||
|
||||
/*
|
||||
const tools = [
|
||||
{
|
||||
|
||||
19
extensions/default/src/getToolbarModule.js
Normal file
19
extensions/default/src/getToolbarModule.js
Normal file
@ -0,0 +1,19 @@
|
||||
const TOOLBAR_BUTTON_TYPES = {
|
||||
COMMAND: 'command',
|
||||
SET_TOOL_ACTIVE: 'setToolActive',
|
||||
BUILT_IN: 'builtIn',
|
||||
};
|
||||
|
||||
const definitions = [
|
||||
{
|
||||
id: 'Layout',
|
||||
label: 'Layout',
|
||||
icon: 'tool-layout',
|
||||
commandName: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
||||
commandOptions: { toolName: 'Layout' }, // TODO
|
||||
},
|
||||
];
|
||||
|
||||
export default function getToolbarModule() {
|
||||
return { definitions, defaultContext: 'ACTIVE_VIEWPORT::CORNERSTONE' };
|
||||
}
|
||||
@ -3,6 +3,7 @@ import getDataSourcesModule from './getDataSourcesModule.js';
|
||||
import getLayoutTemplateModule from './getLayoutTemplateModule.js';
|
||||
import getPanelModule from './getPanelModule.js';
|
||||
import getSopClassHandlerModule from './getSopClassHandlerModule.js';
|
||||
import getToolbarModule from './getToolbarModule.js';
|
||||
import id from './id';
|
||||
|
||||
export default {
|
||||
@ -15,4 +16,5 @@ export default {
|
||||
getLayoutTemplateModule,
|
||||
getPanelModule,
|
||||
getSopClassHandlerModule,
|
||||
getToolbarModule,
|
||||
};
|
||||
|
||||
@ -14,14 +14,42 @@ export default function mode({ modeConfiguration }) {
|
||||
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',
|
||||
},
|
||||
{
|
||||
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',
|
||||
},
|
||||
]);
|
||||
|
||||
debugger;
|
||||
@ -30,12 +58,12 @@ export default function mode({ modeConfiguration }) {
|
||||
toolBarManager.setToolBarLayout([
|
||||
// Primary
|
||||
{
|
||||
tools: ['Zoom'],
|
||||
moreTools: ['Zoom'],
|
||||
tools: ['Zoom', 'Levels', 'Pan', 'Capture', 'Layout'],
|
||||
moreTools: ['Zoom', 'Levels', 'Pan', 'Capture', 'Layout'],
|
||||
},
|
||||
// Secondary
|
||||
{
|
||||
tools: ['Zoom'],
|
||||
tools: ['Annotate', 'Bidirectional', 'Ellipse', 'Length'],
|
||||
},
|
||||
]);
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user