fix(viewport): Reset viewport state and fix CINE looping, thumbnail resolution, and dynamic tool settings (#4037)

This commit is contained in:
Alireza authored and GitHub committed 2024-04-16 11:04:48 -04:00
1 parent a6c6fff43a
commit f99a0bfb31
80 files changed
+1129 -801

No files matched your search

+14 -8
View File
@@ -24,7 +24,7 @@ const toolbarButtons: Button[] = [
label: 'Brush',
evaluate: {
name: 'evaluate.cornerstone.segmentation',
options: { toolNames: ['CircularBrush', 'SphereBrush'] },
toolNames: ['CircularBrush', 'SphereBrush'],
disabledText: 'Create new segmentation to enable this tool.',
},
commands: _createSetToolActiveCommands('CircularBrush'),
@@ -61,9 +61,7 @@ const toolbarButtons: Button[] = [
label: 'Eraser',
evaluate: {
name: 'evaluate.cornerstone.segmentation',
options: {
toolNames: ['CircularEraser', 'SphereEraser'],
},
toolNames: ['CircularEraser', 'SphereEraser'],
},
commands: _createSetToolActiveCommands('CircularEraser'),
options: [
@@ -99,7 +97,7 @@ const toolbarButtons: Button[] = [
label: 'Threshold Tool',
evaluate: {
name: 'evaluate.cornerstone.segmentation',
options: { toolNames: ['ThresholdCircularBrush', 'ThresholdSphereBrush'] },
toolNames: ['ThresholdCircularBrush', 'ThresholdSphereBrush'],
},
commands: _createSetToolActiveCommands('ThresholdCircularBrush'),
options: [
@@ -138,8 +136,16 @@ const toolbarButtons: Button[] = [
{ value: 'ThresholdDynamic', label: 'Dynamic' },
{ value: 'ThresholdRange', label: 'Range' },
],
commands: {
commandName: 'toggleThresholdRangeAndDynamic',
commands: ({ value, commandsManager }) => {
if (value === 'ThresholdDynamic') {
commandsManager.run('setToolActive', {
toolName: 'ThresholdCircularBrushDynamic',
});
} else {
commandsManager.run('setToolActive', {
toolName: 'ThresholdCircularBrush',
});
}
},
},
{
@@ -171,7 +177,7 @@ const toolbarButtons: Button[] = [
label: 'Shapes',
evaluate: {
name: 'evaluate.cornerstone.segmentation',
options: { toolNames: ['CircleScissor', 'SphereScissor', 'RectangleScissor'] },
toolNames: ['CircleScissor', 'SphereScissor', 'RectangleScissor'],
},
icon: 'icon-tool-shape',
commands: _createSetToolActiveCommands('CircleScissor'),