2019-06-16 19:56:24 +02:00
|
|
|
// TODO: A way to add Icons that don't already exist?
|
|
|
|
|
// - Register them and add
|
|
|
|
|
// - Include SVG Source/Inline?
|
|
|
|
|
// - By URL, or own component?
|
2019-05-30 05:46:42 +02:00
|
|
|
|
2019-06-16 19:56:24 +02:00
|
|
|
// TODO: `ohif-core` toolbar builder?
|
2019-04-16 18:00:06 +02:00
|
|
|
|
2019-06-16 19:56:24 +02:00
|
|
|
// What KINDS of toolbar buttons do we have...
|
|
|
|
|
// - One's that dispatch commands
|
|
|
|
|
// - One's that set tool's active
|
|
|
|
|
// - More custom, like CINE
|
|
|
|
|
// - Built in for one's like this, or custom components?
|
2019-04-16 18:00:06 +02:00
|
|
|
|
2019-06-16 19:56:24 +02:00
|
|
|
// Visible?
|
|
|
|
|
// Disabled?
|
|
|
|
|
// Based on contexts or misc. criteria?
|
|
|
|
|
// -- ACTIVE_ROUTE::VIEWER
|
|
|
|
|
// -- ACTIVE_VIEWPORT::CORNERSTONE
|
|
|
|
|
// setToolActive commands should receive the button event that triggered
|
2019-06-25 00:04:26 +02:00
|
|
|
// so we can do the "bind to this button" magic
|
2019-04-16 18:00:06 +02:00
|
|
|
|
2019-06-16 19:56:24 +02:00
|
|
|
const TOOLBAR_BUTTON_TYPES = {
|
|
|
|
|
COMMAND: 'command',
|
2019-06-21 02:30:12 +02:00
|
|
|
SET_TOOL_ACTIVE: 'setToolActive',
|
2019-06-25 00:04:26 +02:00
|
|
|
BUILT_IN: 'builtIn'
|
2019-06-16 19:56:24 +02:00
|
|
|
};
|
2019-04-16 18:00:06 +02:00
|
|
|
|
2019-06-16 19:56:24 +02:00
|
|
|
const definitions = [
|
|
|
|
|
{
|
|
|
|
|
id: 'StackScroll',
|
|
|
|
|
label: 'Stack Scroll',
|
|
|
|
|
icon: 'bars',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
|
|
|
|
commandName: 'setToolActive',
|
2019-06-21 04:57:14 +02:00
|
|
|
commandOptions: { toolName: 'StackScroll' },
|
2019-06-16 19:56:24 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'Zoom',
|
|
|
|
|
label: 'Zoom',
|
|
|
|
|
icon: 'search-plus',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
|
|
|
|
commandName: 'setToolActive',
|
2019-06-21 04:57:14 +02:00
|
|
|
commandOptions: { toolName: 'Zoom' },
|
2019-06-16 19:56:24 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'Wwwc',
|
|
|
|
|
label: 'Levels',
|
|
|
|
|
icon: 'level',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
|
|
|
|
commandName: 'setToolActive',
|
2019-06-21 04:57:14 +02:00
|
|
|
commandOptions: { toolName: 'Wwwc' },
|
2019-06-16 19:56:24 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'Pan',
|
|
|
|
|
label: 'Pan',
|
|
|
|
|
icon: 'arrows',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
|
|
|
|
commandName: 'setToolActive',
|
2019-06-21 04:57:14 +02:00
|
|
|
commandOptions: { toolName: 'Pan' },
|
2019-06-16 19:56:24 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'Length',
|
|
|
|
|
label: 'Length',
|
|
|
|
|
icon: 'measure-temp',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
|
|
|
|
commandName: 'setToolActive',
|
2019-06-21 04:57:14 +02:00
|
|
|
commandOptions: { toolName: 'Length' },
|
2019-06-16 19:56:24 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'Angle',
|
|
|
|
|
label: 'Angle',
|
|
|
|
|
icon: 'angle-left',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
|
|
|
|
commandName: 'setToolActive',
|
2019-06-21 04:57:14 +02:00
|
|
|
commandOptions: { toolName: 'Angle' },
|
2019-06-16 19:56:24 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'Reset',
|
|
|
|
|
label: 'Reset',
|
|
|
|
|
icon: 'reset',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
2019-06-21 04:57:14 +02:00
|
|
|
commandName: 'resetViewport',
|
2019-06-21 02:30:12 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'Cine',
|
|
|
|
|
label: 'CINE',
|
|
|
|
|
icon: 'youtube',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.BUILT_IN,
|
|
|
|
|
options: {
|
2019-06-21 04:57:14 +02:00
|
|
|
behavior: 'CINE',
|
|
|
|
|
},
|
|
|
|
|
},
|
2019-06-25 00:04:26 +02:00
|
|
|
{
|
|
|
|
|
id: 'More',
|
|
|
|
|
label: 'More',
|
|
|
|
|
icon: 'ellipse-circle',
|
|
|
|
|
buttons: [
|
|
|
|
|
{
|
|
|
|
|
id: 'Magnify',
|
|
|
|
|
label: 'Magnify',
|
|
|
|
|
icon: 'circle',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
|
|
|
|
commandName: 'setToolActive',
|
|
|
|
|
commandOptions: { toolName: 'Magnify' },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'WwwcRegion',
|
|
|
|
|
label: 'ROI Window',
|
|
|
|
|
icon: 'stop',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
|
|
|
|
commandName: 'setToolActive',
|
|
|
|
|
commandOptions: { toolName: 'WwwcRegion' },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'DragProbe',
|
|
|
|
|
label: 'Probe',
|
|
|
|
|
icon: 'dot-circle',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
|
|
|
|
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',
|
|
|
|
|
icon: 'square-o',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.SET_TOOL_ACTIVE,
|
|
|
|
|
commandName: 'setToolActive',
|
|
|
|
|
commandOptions: { toolName: 'RectangleRoi' },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'Invert',
|
|
|
|
|
label: 'Invert',
|
|
|
|
|
icon: 'adjust',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
|
|
|
|
commandName: 'invertViewport',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'RotateRight',
|
|
|
|
|
label: 'Rotate Right',
|
|
|
|
|
icon: 'rotate-right',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
|
|
|
|
commandName: 'rotateViewportCW',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'FlipH',
|
|
|
|
|
label: 'Flip H',
|
|
|
|
|
icon: 'ellipse-h',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
|
|
|
|
commandName: 'flipViewportHorizontal',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'FlipV',
|
|
|
|
|
label: 'Flip V',
|
|
|
|
|
icon: 'ellipse-v',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
|
|
|
|
commandName: 'flipViewportVertical',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 'Clear',
|
|
|
|
|
label: 'Clear',
|
|
|
|
|
icon: 'trash',
|
|
|
|
|
//
|
|
|
|
|
type: TOOLBAR_BUTTON_TYPES.COMMAND,
|
|
|
|
|
commandName: 'clearAnnotations',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2019-06-16 19:56:24 +02:00
|
|
|
];
|
2019-04-16 18:00:06 +02:00
|
|
|
|
2019-06-16 19:56:24 +02:00
|
|
|
export default {
|
2019-06-17 20:03:04 +02:00
|
|
|
definitions,
|
2019-06-21 04:57:14 +02:00
|
|
|
defaultContext: 'ACTIVE_VIEWPORT::CORNERSTONE',
|
2019-06-16 19:56:24 +02:00
|
|
|
};
|