diff --git a/extensions/cornerstone-dicom-seg/src/commandsModule.ts b/extensions/cornerstone-dicom-seg/src/commandsModule.ts index dc85281455..4f7d3870ce 100644 --- a/extensions/cornerstone-dicom-seg/src/commandsModule.ts +++ b/extensions/cornerstone-dicom-seg/src/commandsModule.ts @@ -56,26 +56,25 @@ const commandsModule = ({ * */ createEmptySegmentationForViewport: async ({ viewportId }) => { + const viewport = getTargetViewport({ viewportId, viewportGridService }); + // Todo: add support for multiple display sets + const displaySetInstanceUID = viewport.displaySetInstanceUIDs[0]; + + const displaySet = displaySetService.getDisplaySetByUID(displaySetInstanceUID); + + if (!displaySet.isReconstructable) { + uiNotificationService.show({ + title: 'Segmentation', + message: 'Segmentation is not supported for non-reconstructible displaysets yet', + type: 'error', + }); + return; + } + updateViewportsForSegmentationRendering({ viewportId, servicesManager, loadFn: async () => { - const viewport = getTargetViewport({ viewportId, viewportGridService }); - - // Todo: add support for multiple display sets - const displaySetInstanceUID = viewport.displaySetInstanceUIDs[0]; - - const displaySet = displaySetService.getDisplaySetByUID(displaySetInstanceUID); - - if (!displaySet.isReconstructable) { - uiNotificationService.show({ - title: 'Segmentation', - message: 'Segmentation is not supported for non-reconstructible displaysets yet', - type: 'error', - }); - return; - } - const currentSegmentations = segmentationService.getSegmentations(); const segmentationId = await segmentationService.createSegmentationForDisplaySet( displaySetInstanceUID, diff --git a/extensions/cornerstone-dicom-seg/src/panels/SegmentationToolbox.tsx b/extensions/cornerstone-dicom-seg/src/panels/SegmentationToolbox.tsx index f5f2a67707..fddb49359f 100644 --- a/extensions/cornerstone-dicom-seg/src/panels/SegmentationToolbox.tsx +++ b/extensions/cornerstone-dicom-seg/src/panels/SegmentationToolbox.tsx @@ -354,6 +354,7 @@ function SegmentationToolbox({ servicesManager, extensionManager }) { }, { type: 'custom', + id: 'threshold-range', children: () => { return (
diff --git a/modes/segmentation/src/toolbarButtons.ts b/modes/segmentation/src/toolbarButtons.ts index e578268cca..b17a33deae 100644 --- a/modes/segmentation/src/toolbarButtons.ts +++ b/modes/segmentation/src/toolbarButtons.ts @@ -62,7 +62,7 @@ const toolGroupIds = ['default', 'mpr', 'SRToolGroup']; * @returns {Array} an array of 'setToolActive' commands */ function _createSetToolActiveCommands(toolName) { - const temp = toolGroupIds.map((toolGroupId) => ({ + const temp = toolGroupIds.map(toolGroupId => ({ commandName: 'setToolActive', commandOptions: { toolGroupId, @@ -335,36 +335,6 @@ const toolbarButtons = [ ], 'Magnify' ), - _createToolButton( - 'Rectangle', - 'tool-rectangle', - 'Rectangle', - [ - { - commandName: 'setToolActive', - commandOptions: { - toolName: 'RectangleROI', - }, - context: 'CORNERSTONE', - }, - ], - 'Rectangle' - ), - _createToolButton( - 'CalibrationLine', - 'tool-calibration', - 'Calibration', - [ - { - commandName: 'setToolActive', - commandOptions: { - toolName: 'CalibrationLine', - }, - context: 'CORNERSTONE', - }, - ], - 'Calibration Line' - ), _createActionButton( 'TagBrowser', 'list-bullets', diff --git a/platform/ui/src/components/AdvancedToolbox/ToolSettings.tsx b/platform/ui/src/components/AdvancedToolbox/ToolSettings.tsx index 416e6dd122..3184e5bb06 100644 --- a/platform/ui/src/components/AdvancedToolbox/ToolSettings.tsx +++ b/platform/ui/src/components/AdvancedToolbox/ToolSettings.tsx @@ -19,7 +19,7 @@ function ToolSettings({ options }) { buttons.push({ children: label, onClick: () => option.onChange(optionValue), - key: `button-${option.name}-${index}`, // A unique key + key: `button-${option.id}-${index}`, // A unique key }); }); diff --git a/platform/ui/src/components/InputDoubleRange/InputDoubleRange.tsx b/platform/ui/src/components/InputDoubleRange/InputDoubleRange.tsx index 16ab16d6ae..0503f762dd 100644 --- a/platform/ui/src/components/InputDoubleRange/InputDoubleRange.tsx +++ b/platform/ui/src/components/InputDoubleRange/InputDoubleRange.tsx @@ -175,7 +175,7 @@ const InputDoubleRange: React.FC = ({ const rangeValuePercentageEnd = ((rangeValue[1] - minValue) / (maxValue - minValue)) * 100; return ( -
+
{showLabel && LabelOrEditableNumber(rangeValue[0], 0)}