feat(segmentation mode): Add create, and export SEG with Brushes (#3632)

This commit is contained in:
Alireza authored and GitHub committed 2023-09-22 10:23:44 -04:00
1 parent 896866e9d0
commit 48bbd6281a
186 files changed
+6801 -2883

No files matched your search

+8 -2
View File
@@ -74,7 +74,7 @@ function modeFactory({ modeConfiguration }) {
toolbarService,
toolGroupService,
panelService,
segmentationService,
customizationService,
} = servicesManager.services;
measurementService.clearMeasurements();
@@ -87,7 +87,6 @@ function modeFactory({ modeConfiguration }) {
const activateTool = () => {
toolbarService.recordInteraction({
groupId: 'WindowLevel',
itemId: 'WindowLevel',
interactionType: 'tool',
commands: [
{
@@ -126,6 +125,13 @@ function modeFactory({ modeConfiguration }) {
'MoreTools',
]);
customizationService.addModeCustomizations([
{
id: 'segmentation.disableEditing',
value: true,
},
]);
// // ActivatePanel event trigger for when a segmentation or measurement is added.
// // Do not force activation so as to respect the state the user may have left the UI in.
// _activatePanelTriggersSubscriptions = [
+54 -64
View File
@@ -23,7 +23,23 @@ function initDefaultToolGroup(extensionManager, toolGroupService, commandsManage
],
passive: [
{ toolName: toolNames.Length },
{ toolName: toolNames.ArrowAnnotate },
{
toolName: toolNames.ArrowAnnotate,
configuration: {
getTextCallback: (callback, eventDetails) =>
commandsManager.runCommand('arrowTextCallback', {
callback,
eventDetails,
}),
changeTextCallback: (data, eventDetails, callback) =>
commandsManager.runCommand('arrowTextCallback', {
callback,
data,
eventDetails,
}),
},
},
{ toolName: toolNames.Bidirectional },
{ toolName: toolNames.DragProbe },
{ toolName: toolNames.EllipticalROI },
@@ -43,24 +59,7 @@ function initDefaultToolGroup(extensionManager, toolGroupService, commandsManage
disabled: [{ toolName: toolNames.ReferenceLines }],
};
const toolsConfig = {
[toolNames.ArrowAnnotate]: {
getTextCallback: (callback, eventDetails) =>
commandsManager.runCommand('arrowTextCallback', {
callback,
eventDetails,
}),
changeTextCallback: (data, eventDetails, callback) =>
commandsManager.runCommand('arrowTextCallback', {
callback,
data,
eventDetails,
}),
},
};
toolGroupService.createToolGroupAndAddTools(toolGroupId, tools, toolsConfig);
toolGroupService.createToolGroupAndAddTools(toolGroupId, tools);
}
function initSRToolGroup(extensionManager, toolGroupService, commandsManager) {
@@ -68,6 +67,10 @@ function initSRToolGroup(extensionManager, toolGroupService, commandsManager) {
'@ohif/extension-cornerstone-dicom-sr.utilityModule.tools'
);
if (!SRUtilityModule) {
return;
}
const CS3DUtilityModule = extensionManager.getModuleEntry(
'@ohif/extension-cornerstone.utilityModule.tools'
);
@@ -121,25 +124,8 @@ function initSRToolGroup(extensionManager, toolGroupService, commandsManager) {
// disabled
};
const toolsConfig = {
[toolNames.ArrowAnnotate]: {
getTextCallback: (callback, eventDetails) =>
commandsManager.runCommand('arrowTextCallback', {
callback,
eventDetails,
}),
changeTextCallback: (data, eventDetails, callback) =>
commandsManager.runCommand('arrowTextCallback', {
callback,
data,
eventDetails,
}),
},
};
const toolGroupId = 'SRToolGroup';
toolGroupService.createToolGroupAndAddTools(toolGroupId, tools, toolsConfig);
toolGroupService.createToolGroupAndAddTools(toolGroupId, tools);
}
function initMPRToolGroup(extensionManager, toolGroupService, commandsManager) {
@@ -167,7 +153,23 @@ function initMPRToolGroup(extensionManager, toolGroupService, commandsManager) {
],
passive: [
{ toolName: toolNames.Length },
{ toolName: toolNames.ArrowAnnotate },
{
toolName: toolNames.ArrowAnnotate,
configuration: {
getTextCallback: (callback, eventDetails) =>
commandsManager.runCommand('arrowTextCallback', {
callback,
eventDetails,
}),
changeTextCallback: (data, eventDetails, callback) =>
commandsManager.runCommand('arrowTextCallback', {
callback,
data,
eventDetails,
}),
},
},
{ toolName: toolNames.Bidirectional },
{ toolName: toolNames.DragProbe },
{ toolName: toolNames.EllipticalROI },
@@ -179,37 +181,25 @@ function initMPRToolGroup(extensionManager, toolGroupService, commandsManager) {
{ toolName: toolNames.PlanarFreehandROI },
{ toolName: toolNames.SegmentationDisplay },
],
disabled: [{ toolName: toolNames.Crosshairs }, { toolName: toolNames.ReferenceLines }],
disabled: [
{
toolName: toolNames.Crosshairs,
configuration: {
viewportIndicators: false,
autoPan: {
enabled: false,
panSize: 10,
},
},
},
{ toolName: toolNames.ReferenceLines },
],
// 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);
toolGroupService.createToolGroupAndAddTools('mpr', tools);
}
function initVolume3DToolGroup(extensionManager, toolGroupService) {
const utilityModule = extensionManager.getModuleEntry(