Fixing issues with viewports linking
This commit is contained in:
1 parent
66c8db697f
commit
335c3526cc
4 files changed
+56
-21
No files matched your search
@@ -3,8 +3,14 @@ import { _ } from 'meteor/underscore';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
Meteor.startup(() => {
|
||||
const { toolManager } = OHIF.viewerbase;
|
||||
const contextName = 'viewer';
|
||||
|
||||
// Enable the custom tools
|
||||
const customTools = [{
|
||||
id: 'bidirectional',
|
||||
name: 'Target'
|
||||
}, {
|
||||
id: 'nonTarget',
|
||||
name: 'Non-Target'
|
||||
}, {
|
||||
@@ -14,12 +20,25 @@ Meteor.startup(() => {
|
||||
id: 'targetUN',
|
||||
name: 'UN Target'
|
||||
}];
|
||||
|
||||
customTools.forEach(tool => {
|
||||
_.defaults(OHIF.hotkeys.defaults.viewer, { [tool.id]: '' });
|
||||
OHIF.commands.register('viewer', tool.id, {
|
||||
OHIF.commands.register(contextName, tool.id, {
|
||||
name: tool.name,
|
||||
action: () => OHIF.viewerbase.toolManager.setActiveTool(tool.id)
|
||||
action: tool.action || (() => toolManager.setActiveTool(tool.id))
|
||||
});
|
||||
});
|
||||
|
||||
// Enable the custom commands
|
||||
const customCommands = [{
|
||||
id: 'linkStackScroll',
|
||||
name: 'Link',
|
||||
action: OHIF.viewerbase.viewportUtils.linkStackScroll
|
||||
}];
|
||||
customCommands.forEach(command => {
|
||||
_.defaults(OHIF.hotkeys.defaults.viewer, { [command.id]: '' });
|
||||
OHIF.commands.register(contextName, command.id, {
|
||||
name: command.name,
|
||||
action: command.action || (() => toolManager.setActiveTool(command.id))
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user