fix: remaining bugs for MPR and toolbar icon colors (#3026)
* feat: warn for overlapping segments * fix: typo * refactor mpr toggle and stack sync * fix: wip for more general mpr * fix: tool groups for mpr * fix: changing of viewport id * fix: viewport Id for the seg viewports * fix * update cornerstone version
This commit is contained in:
1 parent
6db4d7a917
commit
87eab39768
27 files changed
+726
-384
No files matched your search
@@ -91,8 +91,6 @@ function modeFactory({ modeConfiguration }) {
|
||||
});
|
||||
};
|
||||
|
||||
// Since we only have one viewport for the basic cs3d mode and it has
|
||||
// only one hanging protocol, we can just use the first viewport
|
||||
const { unsubscribe } = ToolGroupService.subscribe(
|
||||
ToolGroupService.EVENTS.VIEWPORT_ADDED,
|
||||
() => {
|
||||
|
||||
@@ -4,9 +4,10 @@ export const toolGroupIds = {
|
||||
Fusion: 'fusionToolGroup',
|
||||
MIP: 'mipToolGroup',
|
||||
default: 'default',
|
||||
// MPR: 'mpr',
|
||||
};
|
||||
|
||||
function initToolGroups(toolNames, Enums, ToolGroupService, commandsManager) {
|
||||
function _initToolGroups(toolNames, Enums, ToolGroupService, commandsManager) {
|
||||
const tools = {
|
||||
active: [
|
||||
{
|
||||
@@ -43,7 +44,7 @@ function initToolGroups(toolNames, Enums, ToolGroupService, commandsManager) {
|
||||
[toolNames.Crosshairs]: {
|
||||
viewportIndicators: false,
|
||||
autoPan: {
|
||||
enabled: true,
|
||||
enabled: false,
|
||||
panSize: 10,
|
||||
},
|
||||
},
|
||||
@@ -122,4 +123,70 @@ function initToolGroups(toolNames, Enums, ToolGroupService, commandsManager) {
|
||||
);
|
||||
}
|
||||
|
||||
function initMPRToolGroup(toolNames, Enums, ToolGroupService, commandsManager) {
|
||||
const tools = {
|
||||
active: [
|
||||
{
|
||||
toolName: toolNames.WindowLevel,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Primary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Pan,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Zoom,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Secondary }],
|
||||
},
|
||||
{ toolName: toolNames.StackScrollMouseWheel, bindings: [] },
|
||||
],
|
||||
passive: [
|
||||
{ toolName: toolNames.Length },
|
||||
{ toolName: toolNames.ArrowAnnotate },
|
||||
{ toolName: toolNames.Bidirectional },
|
||||
{ toolName: toolNames.DragProbe },
|
||||
{ toolName: toolNames.EllipticalROI },
|
||||
{ toolName: toolNames.RectangleROI },
|
||||
{ toolName: toolNames.StackScroll },
|
||||
{ toolName: toolNames.Angle },
|
||||
{ toolName: toolNames.SegmentationDisplay },
|
||||
],
|
||||
disabled: [{ toolName: toolNames.Crosshairs }],
|
||||
|
||||
// enabled
|
||||
// disabled
|
||||
};
|
||||
|
||||
const toolsConfig = {
|
||||
[toolNames.Crosshairs]: {
|
||||
viewportIndicators: false,
|
||||
autoPan: {
|
||||
enabled: false,
|
||||
panSize: 10,
|
||||
},
|
||||
},
|
||||
[toolNames.ArrowAnnotate]: {
|
||||
getTextCallback: (callback, eventDetails) =>
|
||||
commandsManager.runCommand('arrowTextCallback', {
|
||||
callback,
|
||||
eventDetails,
|
||||
}),
|
||||
|
||||
changeTextCallback: (data, eventDetails, callback) =>
|
||||
commandsManager.runCommand('arrowTextCallback', {
|
||||
callback,
|
||||
data,
|
||||
eventDetails,
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
ToolGroupService.createToolGroupAndAddTools('mpr', tools, toolsConfig);
|
||||
}
|
||||
|
||||
function initToolGroups(toolNames, Enums, ToolGroupService, commandsManager) {
|
||||
_initToolGroups(toolNames, Enums, ToolGroupService, commandsManager);
|
||||
// initMPRToolGroup(toolNames, Enums, ToolGroupService, commandsManager);
|
||||
}
|
||||
|
||||
export default initToolGroups;
|
||||
@@ -105,6 +105,7 @@ const toolbarButtons = [
|
||||
toolGroupIds.CT,
|
||||
toolGroupIds.PT,
|
||||
toolGroupIds.Fusion,
|
||||
// toolGroupIds.MPR,
|
||||
]),
|
||||
],
|
||||
'Length'
|
||||
@@ -125,6 +126,7 @@ const toolbarButtons = [
|
||||
toolGroupIds.CT,
|
||||
toolGroupIds.PT,
|
||||
toolGroupIds.Fusion,
|
||||
// toolGroupIds.MPR,
|
||||
]),
|
||||
],
|
||||
'Length Tool'
|
||||
@@ -138,6 +140,7 @@ const toolbarButtons = [
|
||||
toolGroupIds.CT,
|
||||
toolGroupIds.PT,
|
||||
toolGroupIds.Fusion,
|
||||
// toolGroupIds.MPR,
|
||||
]),
|
||||
],
|
||||
'Bidirectional Tool'
|
||||
@@ -151,6 +154,7 @@ const toolbarButtons = [
|
||||
toolGroupIds.CT,
|
||||
toolGroupIds.PT,
|
||||
toolGroupIds.Fusion,
|
||||
// toolGroupIds.MPR,
|
||||
]),
|
||||
],
|
||||
'Arrow Annotate'
|
||||
@@ -164,6 +168,7 @@ const toolbarButtons = [
|
||||
toolGroupIds.CT,
|
||||
toolGroupIds.PT,
|
||||
toolGroupIds.Fusion,
|
||||
// toolGroupIds.MPR,
|
||||
]),
|
||||
],
|
||||
'Ellipse Tool'
|
||||
@@ -184,10 +189,27 @@ const toolbarButtons = [
|
||||
toolGroupIds.CT,
|
||||
toolGroupIds.PT,
|
||||
toolGroupIds.Fusion,
|
||||
// toolGroupIds.MPR,
|
||||
]),
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'MPR',
|
||||
type: 'ohif.action',
|
||||
props: {
|
||||
type: 'toggle',
|
||||
icon: 'icon-mpr',
|
||||
label: 'MPR',
|
||||
commands: [
|
||||
{
|
||||
commandName: 'toggleMPR',
|
||||
commandOptions: {},
|
||||
context: 'CORNERSTONE',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
// Window Level + Presets...
|
||||
{
|
||||
id: 'WindowLevel',
|
||||
@@ -203,6 +225,7 @@ const toolbarButtons = [
|
||||
toolGroupIds.CT,
|
||||
toolGroupIds.PT,
|
||||
toolGroupIds.Fusion,
|
||||
// toolGroupIds.MPR,
|
||||
]),
|
||||
],
|
||||
'Window Level'
|
||||
@@ -236,6 +259,7 @@ const toolbarButtons = [
|
||||
toolGroupIds.CT,
|
||||
toolGroupIds.PT,
|
||||
toolGroupIds.Fusion,
|
||||
// toolGroupIds.MPR,
|
||||
]),
|
||||
],
|
||||
},
|
||||
@@ -253,6 +277,7 @@ const toolbarButtons = [
|
||||
toolGroupIds.CT,
|
||||
toolGroupIds.PT,
|
||||
toolGroupIds.Fusion,
|
||||
// toolGroupIds.MPR,
|
||||
]),
|
||||
],
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user