@cornerstonejs/tools 0.27.2 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/eventListeners/segmentation/segmentationDataModifiedEventListener.js +2 -2
- package/dist/cjs/eventListeners/segmentation/segmentationDataModifiedEventListener.js.map +1 -1
- package/dist/cjs/eventListeners/segmentation/segmentationModifiedEventListener.js +1 -1
- package/dist/cjs/eventListeners/segmentation/segmentationModifiedEventListener.js.map +1 -1
- package/dist/cjs/eventListeners/segmentation/segmentationRepresentationModifiedEventListener.js +1 -1
- package/dist/cjs/eventListeners/segmentation/segmentationRepresentationModifiedEventListener.js.map +1 -1
- package/dist/cjs/eventListeners/segmentation/segmentationRepresentationRemovedEventListener.js +1 -1
- package/dist/cjs/eventListeners/segmentation/segmentationRepresentationRemovedEventListener.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/stateManagement/annotation/config/ToolStyle.js +0 -9
- package/dist/cjs/stateManagement/annotation/config/ToolStyle.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/SegmentationStateManager.d.ts +6 -1
- package/dist/cjs/stateManagement/segmentation/SegmentationStateManager.js +42 -4
- package/dist/cjs/stateManagement/segmentation/SegmentationStateManager.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/config/index.d.ts +2 -2
- package/dist/cjs/stateManagement/segmentation/config/index.js +5 -1
- package/dist/cjs/stateManagement/segmentation/config/index.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/config/segmentationColor.d.ts +2 -1
- package/dist/cjs/stateManagement/segmentation/config/segmentationColor.js +9 -1
- package/dist/cjs/stateManagement/segmentation/config/segmentationColor.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/config/segmentationConfig.d.ts +6 -2
- package/dist/cjs/stateManagement/segmentation/config/segmentationConfig.js +18 -2
- package/dist/cjs/stateManagement/segmentation/config/segmentationConfig.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/config/segmentationVisibility.d.ts +2 -1
- package/dist/cjs/stateManagement/segmentation/config/segmentationVisibility.js +39 -1
- package/dist/cjs/stateManagement/segmentation/config/segmentationVisibility.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/removeSegmentationsFromToolGroup.d.ts +1 -1
- package/dist/cjs/stateManagement/segmentation/removeSegmentationsFromToolGroup.js +6 -7
- package/dist/cjs/stateManagement/segmentation/removeSegmentationsFromToolGroup.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/segmentationState.d.ts +8 -3
- package/dist/cjs/stateManagement/segmentation/segmentationState.js +44 -16
- package/dist/cjs/stateManagement/segmentation/segmentationState.js.map +1 -1
- package/dist/cjs/store/SynchronizerManager/Synchronizer.js +29 -18
- package/dist/cjs/store/SynchronizerManager/Synchronizer.js.map +1 -1
- package/dist/cjs/store/ToolGroupManager/ToolGroup.d.ts +2 -0
- package/dist/cjs/store/ToolGroupManager/ToolGroup.js +30 -5
- package/dist/cjs/store/ToolGroupManager/ToolGroup.js.map +1 -1
- package/dist/cjs/store/ToolGroupManager/destroyToolGroup.js +2 -0
- package/dist/cjs/store/ToolGroupManager/destroyToolGroup.js.map +1 -1
- package/dist/cjs/synchronizers/callbacks/stackImageSyncCallback.d.ts +3 -0
- package/dist/cjs/synchronizers/callbacks/stackImageSyncCallback.js +72 -0
- package/dist/cjs/synchronizers/callbacks/stackImageSyncCallback.js.map +1 -0
- package/dist/cjs/synchronizers/index.d.ts +2 -1
- package/dist/cjs/synchronizers/index.js +3 -1
- package/dist/cjs/synchronizers/index.js.map +1 -1
- package/dist/cjs/synchronizers/synchronizers/createStackImageSynchronizer.d.ts +2 -0
- package/dist/cjs/synchronizers/synchronizers/createStackImageSynchronizer.js +15 -0
- package/dist/cjs/synchronizers/synchronizers/createStackImageSynchronizer.js.map +1 -0
- package/dist/cjs/synchronizers/synchronizers/index.d.ts +2 -1
- package/dist/cjs/synchronizers/synchronizers/index.js +3 -1
- package/dist/cjs/synchronizers/synchronizers/index.js.map +1 -1
- package/dist/cjs/tools/CrosshairsTool.d.ts +6 -1
- package/dist/cjs/tools/CrosshairsTool.js +47 -15
- package/dist/cjs/tools/CrosshairsTool.js.map +1 -1
- package/dist/cjs/tools/displayTools/Labelmap/addLabelmapToElement.js +1 -0
- package/dist/cjs/tools/displayTools/Labelmap/addLabelmapToElement.js.map +1 -1
- package/dist/cjs/tools/displayTools/Labelmap/labelmapConfig.js +7 -3
- package/dist/cjs/tools/displayTools/Labelmap/labelmapConfig.js.map +1 -1
- package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.d.ts +2 -2
- package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js +128 -86
- package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
- package/dist/cjs/tools/displayTools/SegmentationDisplayTool.js +14 -9
- package/dist/cjs/tools/displayTools/SegmentationDisplayTool.js.map +1 -1
- package/dist/cjs/types/LabelmapTypes.d.ts +2 -0
- package/dist/cjs/types/SegmentationStateTypes.d.ts +5 -0
- package/dist/cjs/utilities/index.d.ts +2 -1
- package/dist/cjs/utilities/index.js +3 -1
- package/dist/cjs/utilities/index.js.map +1 -1
- package/dist/cjs/utilities/segmentation/index.d.ts +2 -1
- package/dist/cjs/utilities/segmentation/index.js +3 -1
- package/dist/cjs/utilities/segmentation/index.js.map +1 -1
- package/dist/cjs/utilities/{triggerSegmentationRender.d.ts → segmentation/triggerSegmentationRender.d.ts} +1 -0
- package/dist/cjs/utilities/{triggerSegmentationRender.js → segmentation/triggerSegmentationRender.js} +9 -3
- package/dist/cjs/utilities/segmentation/triggerSegmentationRender.js.map +1 -0
- package/dist/cjs/utilities/viewport/index.d.ts +4 -0
- package/dist/cjs/utilities/viewport/index.js +13 -0
- package/dist/cjs/utilities/viewport/index.js.map +1 -0
- package/dist/esm/eventListeners/segmentation/segmentationDataModifiedEventListener.js +2 -2
- package/dist/esm/eventListeners/segmentation/segmentationDataModifiedEventListener.js.map +1 -1
- package/dist/esm/eventListeners/segmentation/segmentationModifiedEventListener.js +2 -2
- package/dist/esm/eventListeners/segmentation/segmentationModifiedEventListener.js.map +1 -1
- package/dist/esm/eventListeners/segmentation/segmentationRepresentationModifiedEventListener.js +1 -1
- package/dist/esm/eventListeners/segmentation/segmentationRepresentationModifiedEventListener.js.map +1 -1
- package/dist/esm/eventListeners/segmentation/segmentationRepresentationRemovedEventListener.js +1 -1
- package/dist/esm/eventListeners/segmentation/segmentationRepresentationRemovedEventListener.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/stateManagement/annotation/config/ToolStyle.js +0 -9
- package/dist/esm/stateManagement/annotation/config/ToolStyle.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/SegmentationStateManager.d.ts +6 -1
- package/dist/esm/stateManagement/segmentation/SegmentationStateManager.js +42 -4
- package/dist/esm/stateManagement/segmentation/SegmentationStateManager.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/config/index.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/config/index.js +2 -2
- package/dist/esm/stateManagement/segmentation/config/index.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/config/segmentationColor.d.ts +2 -1
- package/dist/esm/stateManagement/segmentation/config/segmentationColor.js +8 -1
- package/dist/esm/stateManagement/segmentation/config/segmentationColor.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/config/segmentationConfig.d.ts +6 -2
- package/dist/esm/stateManagement/segmentation/config/segmentationConfig.js +17 -2
- package/dist/esm/stateManagement/segmentation/config/segmentationConfig.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.d.ts +2 -1
- package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js +15 -1
- package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/removeSegmentationsFromToolGroup.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/removeSegmentationsFromToolGroup.js +6 -7
- package/dist/esm/stateManagement/segmentation/removeSegmentationsFromToolGroup.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/segmentationState.d.ts +8 -3
- package/dist/esm/stateManagement/segmentation/segmentationState.js +38 -15
- package/dist/esm/stateManagement/segmentation/segmentationState.js.map +1 -1
- package/dist/esm/store/SynchronizerManager/Synchronizer.js +2 -2
- package/dist/esm/store/SynchronizerManager/Synchronizer.js.map +1 -1
- package/dist/esm/store/ToolGroupManager/ToolGroup.d.ts +2 -0
- package/dist/esm/store/ToolGroupManager/ToolGroup.js +30 -5
- package/dist/esm/store/ToolGroupManager/ToolGroup.js.map +1 -1
- package/dist/esm/store/ToolGroupManager/destroyToolGroup.js +2 -0
- package/dist/esm/store/ToolGroupManager/destroyToolGroup.js.map +1 -1
- package/dist/esm/synchronizers/callbacks/stackImageSyncCallback.d.ts +3 -0
- package/dist/esm/synchronizers/callbacks/stackImageSyncCallback.js +58 -0
- package/dist/esm/synchronizers/callbacks/stackImageSyncCallback.js.map +1 -0
- package/dist/esm/synchronizers/index.d.ts +2 -1
- package/dist/esm/synchronizers/index.js +2 -1
- package/dist/esm/synchronizers/index.js.map +1 -1
- package/dist/esm/synchronizers/synchronizers/createStackImageSynchronizer.d.ts +2 -0
- package/dist/esm/synchronizers/synchronizers/createStackImageSynchronizer.js +9 -0
- package/dist/esm/synchronizers/synchronizers/createStackImageSynchronizer.js.map +1 -0
- package/dist/esm/synchronizers/synchronizers/index.d.ts +2 -1
- package/dist/esm/synchronizers/synchronizers/index.js +2 -1
- package/dist/esm/synchronizers/synchronizers/index.js.map +1 -1
- package/dist/esm/tools/CrosshairsTool.d.ts +6 -1
- package/dist/esm/tools/CrosshairsTool.js +47 -15
- package/dist/esm/tools/CrosshairsTool.js.map +1 -1
- package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.js +2 -1
- package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.js.map +1 -1
- package/dist/esm/tools/displayTools/Labelmap/labelmapConfig.js +7 -3
- package/dist/esm/tools/displayTools/Labelmap/labelmapConfig.js.map +1 -1
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.d.ts +2 -2
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js +119 -76
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
- package/dist/esm/tools/displayTools/SegmentationDisplayTool.js +14 -9
- package/dist/esm/tools/displayTools/SegmentationDisplayTool.js.map +1 -1
- package/dist/esm/types/LabelmapTypes.d.ts +2 -0
- package/dist/esm/types/SegmentationStateTypes.d.ts +5 -0
- package/dist/esm/utilities/index.d.ts +2 -1
- package/dist/esm/utilities/index.js +2 -1
- package/dist/esm/utilities/index.js.map +1 -1
- package/dist/esm/utilities/segmentation/index.d.ts +2 -1
- package/dist/esm/utilities/segmentation/index.js +2 -1
- package/dist/esm/utilities/segmentation/index.js.map +1 -1
- package/dist/esm/utilities/{triggerSegmentationRender.d.ts → segmentation/triggerSegmentationRender.d.ts} +1 -0
- package/dist/esm/utilities/{triggerSegmentationRender.js → segmentation/triggerSegmentationRender.js} +9 -3
- package/dist/esm/utilities/segmentation/triggerSegmentationRender.js.map +1 -0
- package/dist/esm/utilities/viewport/index.d.ts +4 -0
- package/dist/esm/utilities/viewport/index.js +5 -0
- package/dist/esm/utilities/viewport/index.js.map +1 -0
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/cjs/utilities/triggerSegmentationRender.js.map +0 -1
- package/dist/esm/utilities/triggerSegmentationRender.js.map +0 -1
package/dist/esm/eventListeners/segmentation/segmentationRepresentationModifiedEventListener.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import triggerSegmentationRender from '../../utilities/triggerSegmentationRender';
|
|
1
|
+
import triggerSegmentationRender from '../../utilities/segmentation/triggerSegmentationRender';
|
|
2
2
|
const segmentationRepresentationModifiedListener = function (evt) {
|
|
3
3
|
const { toolGroupId } = evt.detail;
|
|
4
4
|
triggerSegmentationRender(toolGroupId);
|
package/dist/esm/eventListeners/segmentation/segmentationRepresentationModifiedEventListener.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmentationRepresentationModifiedEventListener.js","sourceRoot":"","sources":["../../../../src/eventListeners/segmentation/segmentationRepresentationModifiedEventListener.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,MAAM,
|
|
1
|
+
{"version":3,"file":"segmentationRepresentationModifiedEventListener.js","sourceRoot":"","sources":["../../../../src/eventListeners/segmentation/segmentationRepresentationModifiedEventListener.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,MAAM,wDAAwD,CAAC;AAO/F,MAAM,0CAA0C,GAAG,UACjD,GAAgD;IAEhD,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC;IACnC,yBAAyB,CAAC,WAAW,CAAC,CAAC;AACzC,CAAC,CAAC;AAEF,eAAe,0CAA0C,CAAC"}
|
package/dist/esm/eventListeners/segmentation/segmentationRepresentationRemovedEventListener.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import triggerSegmentationRender from '../../utilities/triggerSegmentationRender';
|
|
1
|
+
import triggerSegmentationRender from '../../utilities/segmentation/triggerSegmentationRender';
|
|
2
2
|
const segmentationRepresentationRemovedEventListener = function (evt) {
|
|
3
3
|
const { toolGroupId, segmentationRepresentationUID } = evt.detail;
|
|
4
4
|
triggerSegmentationRender(toolGroupId);
|
package/dist/esm/eventListeners/segmentation/segmentationRepresentationRemovedEventListener.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmentationRepresentationRemovedEventListener.js","sourceRoot":"","sources":["../../../../src/eventListeners/segmentation/segmentationRepresentationRemovedEventListener.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,MAAM,
|
|
1
|
+
{"version":3,"file":"segmentationRepresentationRemovedEventListener.js","sourceRoot":"","sources":["../../../../src/eventListeners/segmentation/segmentationRepresentationRemovedEventListener.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,MAAM,wDAAwD,CAAC;AAO/F,MAAM,8CAA8C,GAAG,UACrD,GAA+C;IAE/C,MAAM,EAAE,WAAW,EAAE,6BAA6B,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC;IAElE,yBAAyB,CAAC,WAAW,CAAC,CAAC;AACzC,CAAC,CAAC;AAEF,eAAe,8CAA8C,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { init, destroy } from './init';
|
|
2
|
-
import { addTool, removeTool, ToolGroupManager, SynchronizerManager, Synchronizer, cancelActiveManipulations } from './store';
|
|
2
|
+
import { addTool, removeTool, state, ToolGroupManager, SynchronizerManager, Synchronizer, cancelActiveManipulations } from './store';
|
|
3
3
|
import * as CONSTANTS from './constants';
|
|
4
4
|
import * as synchronizers from './synchronizers';
|
|
5
5
|
import * as drawing from './drawingSvg';
|
|
@@ -10,4 +10,4 @@ import * as annotation from './stateManagement/annotation';
|
|
|
10
10
|
import * as segmentation from './stateManagement/segmentation';
|
|
11
11
|
import { BaseTool, AnnotationTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, ZoomTool, StackScrollTool, StackScrollMouseWheelTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, LengthTool, ProbeTool, RectangleROITool, EllipticalROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, CrosshairsTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, SegmentationDisplayTool, BrushTool, AngleTool, MagnifyTool } from './tools';
|
|
12
12
|
import * as Enums from './enums';
|
|
13
|
-
export { init, destroy, addTool, removeTool, cancelActiveManipulations, BaseTool, AnnotationTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, ZoomTool, StackScrollTool, StackScrollMouseWheelTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, LengthTool, CrosshairsTool, ProbeTool, RectangleROITool, EllipticalROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, AngleTool, MagnifyTool, SegmentationDisplayTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, BrushTool, synchronizers, Synchronizer, SynchronizerManager, Types, ToolGroupManager, Enums, CONSTANTS, drawing, annotation, segmentation, utilities, cursors, };
|
|
13
|
+
export { init, destroy, addTool, removeTool, cancelActiveManipulations, BaseTool, AnnotationTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, ZoomTool, StackScrollTool, StackScrollMouseWheelTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, LengthTool, CrosshairsTool, ProbeTool, RectangleROITool, EllipticalROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, AngleTool, MagnifyTool, SegmentationDisplayTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, BrushTool, synchronizers, Synchronizer, SynchronizerManager, Types, state, ToolGroupManager, Enums, CONSTANTS, drawing, annotation, segmentation, utilities, cursors, };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { init, destroy } from './init';
|
|
2
|
-
import { addTool, removeTool, ToolGroupManager, SynchronizerManager, Synchronizer, cancelActiveManipulations, } from './store';
|
|
2
|
+
import { addTool, removeTool, state, ToolGroupManager, SynchronizerManager, Synchronizer, cancelActiveManipulations, } from './store';
|
|
3
3
|
import * as CONSTANTS from './constants';
|
|
4
4
|
import * as synchronizers from './synchronizers';
|
|
5
5
|
import * as drawing from './drawingSvg';
|
|
@@ -10,5 +10,5 @@ import * as annotation from './stateManagement/annotation';
|
|
|
10
10
|
import * as segmentation from './stateManagement/segmentation';
|
|
11
11
|
import { BaseTool, AnnotationTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, ZoomTool, StackScrollTool, StackScrollMouseWheelTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, LengthTool, ProbeTool, RectangleROITool, EllipticalROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, CrosshairsTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, SegmentationDisplayTool, BrushTool, AngleTool, MagnifyTool, } from './tools';
|
|
12
12
|
import * as Enums from './enums';
|
|
13
|
-
export { init, destroy, addTool, removeTool, cancelActiveManipulations, BaseTool, AnnotationTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, ZoomTool, StackScrollTool, StackScrollMouseWheelTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, LengthTool, CrosshairsTool, ProbeTool, RectangleROITool, EllipticalROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, AngleTool, MagnifyTool, SegmentationDisplayTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, BrushTool, synchronizers, Synchronizer, SynchronizerManager, Types, ToolGroupManager, Enums, CONSTANTS, drawing, annotation, segmentation, utilities, cursors, };
|
|
13
|
+
export { init, destroy, addTool, removeTool, cancelActiveManipulations, BaseTool, AnnotationTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, ZoomTool, StackScrollTool, StackScrollMouseWheelTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, LengthTool, CrosshairsTool, ProbeTool, RectangleROITool, EllipticalROITool, BidirectionalTool, PlanarFreehandROITool, ArrowAnnotateTool, AngleTool, MagnifyTool, SegmentationDisplayTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, BrushTool, synchronizers, Synchronizer, SynchronizerManager, Types, state, ToolGroupManager, Enums, CONSTANTS, drawing, annotation, segmentation, utilities, cursors, };
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EACL,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACZ,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAGzC,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EACL,QAAQ,EACR,cAAc,EACd,OAAO,EACP,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,QAAQ,EACR,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,iCAAiC,EACjC,uBAAuB,EACvB,SAAS,EACT,SAAS,EACT,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,OAAO,EAEL,IAAI,EACJ,OAAO,EACP,OAAO,EACP,UAAU,EACV,yBAAyB,EAEzB,QAAQ,EACR,c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B,0BAA0B,EAC1B,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,iCAAiC,EACjC,uBAAuB,EACvB,SAAS,EACT,SAAS,EACT,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,OAAO,EAEL,IAAI,EACJ,OAAO,EACP,OAAO,EACP,UAAU,EACV,yBAAyB,EAEzB,QAAQ,EACR,cAAc,EAEd,OAAO,EACP,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,QAAQ,EACR,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAElB,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,SAAS,EACT,WAAW,EAEX,uBAAuB,EAEvB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,iCAAiC,EACjC,SAAS,EAET,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,KAAK,EACL,KAAK,EAEL,gBAAgB,EAEhB,KAAK,EAEL,SAAS,EAET,OAAO,EAEP,UAAU,EAEV,YAAY,EAEZ,SAAS,EACT,OAAO,GACR,CAAC"}
|
|
@@ -42,9 +42,6 @@ class ToolStyle {
|
|
|
42
42
|
};
|
|
43
43
|
annotationSpecificStyles = this.config.annotations;
|
|
44
44
|
}
|
|
45
|
-
if (annotationSpecificStyles[annotationUID]) {
|
|
46
|
-
console.warn('overriding annotation styles for annotationUID:', annotationUID);
|
|
47
|
-
}
|
|
48
45
|
annotationSpecificStyles[annotationUID] = styles;
|
|
49
46
|
}
|
|
50
47
|
setViewportToolStyles(viewportId, styles) {
|
|
@@ -56,9 +53,6 @@ class ToolStyle {
|
|
|
56
53
|
};
|
|
57
54
|
viewportSpecificStyles = this.config.viewports;
|
|
58
55
|
}
|
|
59
|
-
if (viewportSpecificStyles[viewportId]) {
|
|
60
|
-
console.warn('overriding viewport styles for viewportId:', viewportId);
|
|
61
|
-
}
|
|
62
56
|
viewportSpecificStyles[viewportId] = styles;
|
|
63
57
|
}
|
|
64
58
|
setToolGroupToolStyles(toolGroupId, styles) {
|
|
@@ -70,9 +64,6 @@ class ToolStyle {
|
|
|
70
64
|
};
|
|
71
65
|
toolGroupSpecificStyles = this.config.toolGroups;
|
|
72
66
|
}
|
|
73
|
-
if (toolGroupSpecificStyles[toolGroupId]) {
|
|
74
|
-
console.warn('overriding toolGroup styles for toolGroupId:', toolGroupId);
|
|
75
|
-
}
|
|
76
67
|
toolGroupSpecificStyles[toolGroupId] = styles;
|
|
77
68
|
}
|
|
78
69
|
setDefaultToolStyles(styles) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolStyle.js","sourceRoot":"","sources":["../../../../../src/stateManagement/annotation/config/ToolStyle.ts"],"names":[],"mappings":"AAyBA,MAAM,SAAS;IAGb;QACE,MAAM,aAAa,GAAG;YACpB,KAAK,EAAE,kBAAkB;YACzB,gBAAgB,EAAE,gBAAgB;YAClC,aAAa,EAAE,gBAAgB;YAC/B,WAAW,EAAE,kBAAkB;YAC/B,SAAS,EAAE,GAAG;YACd,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE,IAAI;YACZ,iBAAiB,EAAE,8CAA8C;YACjE,eAAe,EAAE,MAAM;YACvB,YAAY,EAAE,kBAAkB;YAChC,uBAAuB,EAAE,gBAAgB;YACzC,oBAAoB,EAAE,gBAAgB;YACtC,kBAAkB,EAAE,kBAAkB;YACtC,iBAAiB,EAAE,EAAE;YACrB,oBAAoB,EAAE,GAAG;YACzB,mBAAmB,EAAE,KAAK;YAC1B,aAAa,EAAE,IAAI;SACpB,CAAC;QAEF,IAAI,CAAC,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AAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;SACtC;IACH,CAAC;IAEO,iBAAiB,CAAC,MAAM;QAC9B,MAAM,UAAU,GAAG,EAAE,CAAC;QACtB,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE;YACzB,UAAU,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;SACjC;QAED,IAAI,CAAC,MAAM,GAAG;YACZ,OAAO,EAAE;gBACP,MAAM,EAAE,UAA6B;aACtC;SACF,CAAC;IACJ,CAAC;CACF;AAED,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;AAElC,eAAe,SAAS,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SegmentationState, ColorLUT, Segmentation, ToolGroupSpecificRepresentation, SegmentationRepresentationConfig, ToolGroupSpecificRepresentations } from '../../types/SegmentationStateTypes';
|
|
1
|
+
import type { SegmentationState, ColorLUT, Segmentation, ToolGroupSpecificRepresentation, SegmentationRepresentationConfig, ToolGroupSpecificRepresentations, RepresentationConfig, SegmentSpecificRepresentationConfig } from '../../types/SegmentationStateTypes';
|
|
2
2
|
export default class SegmentationStateManager {
|
|
3
3
|
private state;
|
|
4
4
|
readonly uid: string;
|
|
@@ -18,8 +18,13 @@ export default class SegmentationStateManager {
|
|
|
18
18
|
removeSegmentationRepresentation(toolGroupId: string, segmentationRepresentationUID: string): void;
|
|
19
19
|
setActiveSegmentationRepresentation(toolGroupId: string, segmentationRepresentationUID: string): void;
|
|
20
20
|
getToolGroupSpecificConfig(toolGroupId: string): SegmentationRepresentationConfig | undefined;
|
|
21
|
+
getSegmentationRepresentationSpecificConfig(toolGroupId: string, segmentationRepresentationUID: string): RepresentationConfig;
|
|
22
|
+
setSegmentationRepresentationSpecificConfig(toolGroupId: string, segmentationRepresentationUID: string, config: RepresentationConfig): void;
|
|
23
|
+
getSegmentSpecificConfig(toolGroupId: string, segmentationRepresentationUID: string, segmentIndex: number): RepresentationConfig;
|
|
24
|
+
setSegmentSpecificConfig(toolGroupId: string, segmentationRepresentationUID: string, config: SegmentSpecificRepresentationConfig): void;
|
|
21
25
|
setSegmentationRepresentationConfig(toolGroupId: string, config: SegmentationRepresentationConfig): void;
|
|
22
26
|
addColorLUT(colorLUT: ColorLUT, lutIndex: number): void;
|
|
27
|
+
removeColorLUT(colorLUTIndex: number): void;
|
|
23
28
|
_handleActiveSegmentation(toolGroupId: string, recentlyAddedOrRemovedSegmentationRepresentation: ToolGroupSpecificRepresentation): void;
|
|
24
29
|
_initDefaultColorLUTIfNecessary(): void;
|
|
25
30
|
}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import cloneDeep from 'lodash.clonedeep';
|
|
2
2
|
import { utilities as csUtils } from '@cornerstonejs/core';
|
|
3
3
|
import CORNERSTONE_COLOR_LUT from '../../constants/COLOR_LUT';
|
|
4
|
+
import getDefaultLabelmapConfig from '../../tools/displayTools/Labelmap/labelmapConfig';
|
|
5
|
+
import { SegmentationRepresentations } from '../../enums';
|
|
6
|
+
const defaultLabelmapConfig = getDefaultLabelmapConfig();
|
|
7
|
+
const newGlobalConfig = {
|
|
8
|
+
renderInactiveSegmentations: true,
|
|
9
|
+
representations: {
|
|
10
|
+
[SegmentationRepresentations.Labelmap]: defaultLabelmapConfig,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
4
13
|
const initialDefaultState = {
|
|
5
14
|
colorLUT: [],
|
|
6
15
|
segmentations: [],
|
|
7
|
-
globalConfig:
|
|
8
|
-
renderInactiveSegmentations: true,
|
|
9
|
-
representations: {},
|
|
10
|
-
},
|
|
16
|
+
globalConfig: newGlobalConfig,
|
|
11
17
|
toolGroups: {},
|
|
12
18
|
};
|
|
13
19
|
export default class SegmentationStateManager {
|
|
@@ -107,6 +113,35 @@ export default class SegmentationStateManager {
|
|
|
107
113
|
}
|
|
108
114
|
return toolGroupStateWithConfig.config;
|
|
109
115
|
}
|
|
116
|
+
getSegmentationRepresentationSpecificConfig(toolGroupId, segmentationRepresentationUID) {
|
|
117
|
+
const segmentationRepresentation = this.getSegmentationRepresentationByUID(toolGroupId, segmentationRepresentationUID);
|
|
118
|
+
if (!segmentationRepresentation) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
return segmentationRepresentation.segmentationRepresentationSpecificConfig;
|
|
122
|
+
}
|
|
123
|
+
setSegmentationRepresentationSpecificConfig(toolGroupId, segmentationRepresentationUID, config) {
|
|
124
|
+
const segmentationRepresentation = this.getSegmentationRepresentationByUID(toolGroupId, segmentationRepresentationUID);
|
|
125
|
+
if (!segmentationRepresentation) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
segmentationRepresentation.segmentationRepresentationSpecificConfig =
|
|
129
|
+
config;
|
|
130
|
+
}
|
|
131
|
+
getSegmentSpecificConfig(toolGroupId, segmentationRepresentationUID, segmentIndex) {
|
|
132
|
+
const segmentationRepresentation = this.getSegmentationRepresentationByUID(toolGroupId, segmentationRepresentationUID);
|
|
133
|
+
if (!segmentationRepresentation) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
return segmentationRepresentation.segmentSpecificConfig[segmentIndex];
|
|
137
|
+
}
|
|
138
|
+
setSegmentSpecificConfig(toolGroupId, segmentationRepresentationUID, config) {
|
|
139
|
+
const segmentationRepresentation = this.getSegmentationRepresentationByUID(toolGroupId, segmentationRepresentationUID);
|
|
140
|
+
if (!segmentationRepresentation) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
segmentationRepresentation.segmentSpecificConfig = config;
|
|
144
|
+
}
|
|
110
145
|
setSegmentationRepresentationConfig(toolGroupId, config) {
|
|
111
146
|
let toolGroupStateWithConfig = this.state.toolGroups[toolGroupId];
|
|
112
147
|
if (!toolGroupStateWithConfig) {
|
|
@@ -130,6 +165,9 @@ export default class SegmentationStateManager {
|
|
|
130
165
|
}
|
|
131
166
|
this.state.colorLUT[lutIndex] = colorLUT;
|
|
132
167
|
}
|
|
168
|
+
removeColorLUT(colorLUTIndex) {
|
|
169
|
+
delete this.state.colorLUT[colorLUTIndex];
|
|
170
|
+
}
|
|
133
171
|
_handleActiveSegmentation(toolGroupId, recentlyAddedOrRemovedSegmentationRepresentation) {
|
|
134
172
|
const segmentationRepresentations = this.getSegmentationRepresentations(toolGroupId);
|
|
135
173
|
if (segmentationRepresentations.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentationStateManager.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/SegmentationStateManager.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,qBAAqB,MAAM,2BAA2B,CAAC;AAY9D,MAAM,
|
|
1
|
+
{"version":3,"file":"SegmentationStateManager.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/SegmentationStateManager.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,qBAAqB,MAAM,2BAA2B,CAAC;AAY9D,OAAO,wBAAwB,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAI1D,MAAM,qBAAqB,GAAG,wBAAwB,EAAE,CAAC;AAEzD,MAAM,eAAe,GAAqC;IACxD,2BAA2B,EAAE,IAAI;IACjC,eAAe,EAAE;QACf,CAAC,2BAA2B,CAAC,QAAQ,CAAC,EAAE,qBAAqB;KAC9D;CACF,CAAC;AAGF,MAAM,mBAAmB,GAAsB;IAC7C,QAAQ,EAAE,EAAE;IACZ,aAAa,EAAE,EAAE;IACjB,YAAY,EAAE,eAAe;IAC7B,UAAU,EAAE,EAAE;CACf,CAAC;AAQF,MAAM,CAAC,OAAO,OAAO,wBAAwB;IAI3C,YAAY,GAA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AM,CAC1C,CAAC;QAEJ,IAAI,iCAAiC,CAAC,MAAM,KAAK,CAAC,EAAE;YAClD,2BAA2B,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC;YAC7C,OAAO;SACR;QAID,IAAI,gDAAgD,CAAC,MAAM,EAAE;YAC3D,2BAA2B,CAAC,OAAO,CAAC,CAAC,cAAc,EAAE,EAAE;gBACrD,IACE,cAAc,CAAC,6BAA6B;oBAC5C,gDAAgD,CAAC,6BAA6B,EAC9E;oBACA,cAAc,CAAC,MAAM,GAAG,KAAK,CAAC;iBAC/B;YACH,CAAC,CAAC,CAAC;SACJ;IAGH,CAAC;IAED,+BAA+B;QAE7B,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;YAC/D,IAAI,CAAC,WAAW,CAAC,qBAAiC,EAAE,CAAC,CAAC,CAAC;SACxD;IACH,CAAC;CACF;AAED,MAAM,+BAA+B,GAAG,IAAI,wBAAwB,CAAC,SAAS,CAAC,CAAC;AAChF,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as color from './segmentationColor';
|
|
2
2
|
import * as visibility from './segmentationVisibility';
|
|
3
|
-
import { getGlobalConfig, getGlobalRepresentationConfig, getToolGroupSpecificConfig, setGlobalConfig, setGlobalRepresentationConfig, setToolGroupSpecificConfig } from './segmentationConfig';
|
|
4
|
-
export { color, visibility, getGlobalConfig, getGlobalRepresentationConfig, getToolGroupSpecificConfig, setGlobalConfig, setGlobalRepresentationConfig, setToolGroupSpecificConfig, };
|
|
3
|
+
import { getGlobalConfig, getGlobalRepresentationConfig, getToolGroupSpecificConfig, setGlobalConfig, setGlobalRepresentationConfig, setToolGroupSpecificConfig, setSegmentSpecificConfig, getSegmentSpecificConfig, setSegmentationRepresentationSpecificConfig, getSegmentationRepresentationSpecificConfig } from './segmentationConfig';
|
|
4
|
+
export { color, visibility, getGlobalConfig, getGlobalRepresentationConfig, getToolGroupSpecificConfig, setGlobalConfig, setGlobalRepresentationConfig, setToolGroupSpecificConfig, setSegmentSpecificConfig, getSegmentSpecificConfig, setSegmentationRepresentationSpecificConfig, getSegmentationRepresentationSpecificConfig, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as color from './segmentationColor';
|
|
2
2
|
import * as visibility from './segmentationVisibility';
|
|
3
|
-
import { getGlobalConfig, getGlobalRepresentationConfig, getToolGroupSpecificConfig, setGlobalConfig, setGlobalRepresentationConfig, setToolGroupSpecificConfig, } from './segmentationConfig';
|
|
4
|
-
export { color, visibility, getGlobalConfig, getGlobalRepresentationConfig, getToolGroupSpecificConfig, setGlobalConfig, setGlobalRepresentationConfig, setToolGroupSpecificConfig, };
|
|
3
|
+
import { getGlobalConfig, getGlobalRepresentationConfig, getToolGroupSpecificConfig, setGlobalConfig, setGlobalRepresentationConfig, setToolGroupSpecificConfig, setSegmentSpecificConfig, getSegmentSpecificConfig, setSegmentationRepresentationSpecificConfig, getSegmentationRepresentationSpecificConfig, } from './segmentationConfig';
|
|
4
|
+
export { color, visibility, getGlobalConfig, getGlobalRepresentationConfig, getToolGroupSpecificConfig, setGlobalConfig, setGlobalRepresentationConfig, setToolGroupSpecificConfig, setSegmentSpecificConfig, getSegmentSpecificConfig, setSegmentationRepresentationSpecificConfig, getSegmentationRepresentationSpecificConfig, };
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACL,eAAe,EACf,6BAA6B,EAC7B,0BAA0B,EAC1B,eAAe,EACf,6BAA6B,EAC7B,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACL,eAAe,EACf,6BAA6B,EAC7B,0BAA0B,EAC1B,eAAe,EACf,6BAA6B,EAC7B,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,2CAA2C,EAC3C,2CAA2C,GAC5C,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,KAAK,EACL,UAAU,EACV,eAAe,EACf,6BAA6B,EAC7B,0BAA0B,EAC1B,eAAe,EACf,6BAA6B,EAC7B,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,2CAA2C,EAC3C,2CAA2C,GAC5C,CAAC"}
|
|
@@ -3,4 +3,5 @@ import { ColorLUT } from '../../../types/SegmentationStateTypes';
|
|
|
3
3
|
declare function addColorLUT(colorLUT: ColorLUT, colorLUTIndex: number): void;
|
|
4
4
|
declare function setColorLUT(toolGroupId: string, segmentationRepresentationUID: string, colorLUTIndex: number): void;
|
|
5
5
|
declare function getColorForSegmentIndex(toolGroupId: string, segmentationRepresentationUID: string, segmentIndex: number): Color;
|
|
6
|
-
|
|
6
|
+
declare function setColorForSegmentIndex(toolGroupId: string, segmentationRepresentationUID: string, segmentIndex: number, color: Color): void;
|
|
7
|
+
export { getColorForSegmentIndex, addColorLUT, setColorLUT, setColorForSegmentIndex, };
|
|
@@ -31,5 +31,12 @@ function getColorForSegmentIndex(toolGroupId, segmentationRepresentationUID, seg
|
|
|
31
31
|
const colorLUT = SegmentationState.getColorLUT(colorLUTIndex);
|
|
32
32
|
return colorLUT[segmentIndex];
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
function setColorForSegmentIndex(toolGroupId, segmentationRepresentationUID, segmentIndex, color) {
|
|
35
|
+
const colorReference = getColorForSegmentIndex(toolGroupId, segmentationRepresentationUID, segmentIndex);
|
|
36
|
+
for (let i = 0; i < color.length; i++) {
|
|
37
|
+
colorReference[i] = color[i];
|
|
38
|
+
}
|
|
39
|
+
triggerSegmentationRepresentationModified(toolGroupId, segmentationRepresentationUID);
|
|
40
|
+
}
|
|
41
|
+
export { getColorForSegmentIndex, addColorLUT, setColorLUT, setColorForSegmentIndex, };
|
|
35
42
|
//# sourceMappingURL=segmentationColor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmentationColor.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/config/segmentationColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,iBAAiB,MAAM,yDAAyD,CAAC;AAG7F,OAAO,EAAE,yCAAyC,EAAE,MAAM,8BAA8B,CAAC;AAUzF,SAAS,WAAW,CAAC,QAAkB,EAAE,aAAqB;IAC5D,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;KACtD;IAGD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;QACjD,OAAO,CAAC,IAAI,CACV,qHAAqH,CACtH,CAAC;QACF,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAChC;IAED,iBAAiB,CAAC,WAAW,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AACzD,CAAC;AASD,SAAS,WAAW,CAClB,WAAmB,EACnB,6BAAqC,EACrC,aAAqB;IAErB,MAAM,iBAAiB,GACrB,iBAAiB,CAAC,kCAAkC,CAClD,WAAW,EACX,6BAA6B,CAC9B,CAAC;IAEJ,IAAI,CAAC,iBAAiB,EAAE;QACtB,MAAM,IAAI,KAAK,CACb,oEAAoE,6BAA6B,EAAE,CACpG,CAAC;KACH;IAED,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE;QACjD,MAAM,IAAI,KAAK,CACb,mDAAmD,aAAa,EAAE,CACnE,CAAC;KACH;IAED,iBAAiB,CAAC,aAAa,GAAG,aAAa,CAAC;IAEhD,yCAAyC,CACvC,WAAW,EACX,6BAA6B,CAC9B,CAAC;AACJ,CAAC;AAYD,SAAS,uBAAuB,CAC9B,WAAmB,EACnB,6BAAqC,EACrC,YAAoB;IAEpB,MAAM,0BAA0B,GAC9B,iBAAiB,CAAC,kCAAkC,CAClD,WAAW,EACX,6BAA6B,CAC9B,CAAC;IAEJ,IAAI,CAAC,0BAA0B,EAAE;QAC/B,MAAM,IAAI,KAAK,CACb,wCAAwC,6BAA6B,kCAAkC,WAAW,EAAE,CACrH,CAAC;KACH;IAED,MAAM,EAAE,aAAa,EAAE,GAAG,0BAA0B,CAAC;IAGrD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IAC9D,OAAO,QAAQ,CAAC,YAAY,CAAC,CAAC;AAChC,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"segmentationColor.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/config/segmentationColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,iBAAiB,MAAM,yDAAyD,CAAC;AAG7F,OAAO,EAAE,yCAAyC,EAAE,MAAM,8BAA8B,CAAC;AAUzF,SAAS,WAAW,CAAC,QAAkB,EAAE,aAAqB;IAC5D,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;KACtD;IAGD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,C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AC;AAED,SAAS,uBAAuB,CAC9B,WAAmB,EACnB,6BAAqC,EACrC,YAAoB,EACpB,KAAY;IAGZ,MAAM,cAAc,GAAG,uBAAuB,CAC5C,WAAW,EACX,6BAA6B,EAC7B,YAAY,CACb,CAAC;IAGF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;KAC9B;IAED,yCAAyC,CACvC,WAAW,EACX,6BAA6B,CAC9B,CAAC;AACJ,CAAC;AAED,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,WAAW,EACX,uBAAuB,GACxB,CAAC"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import SegmentationRepresentations from '../../../enums/SegmentationRepresentations';
|
|
2
|
-
import { RepresentationConfig, SegmentationRepresentationConfig } from '../../../types/SegmentationStateTypes';
|
|
2
|
+
import { RepresentationConfig, SegmentationRepresentationConfig, SegmentSpecificRepresentationConfig } from '../../../types/SegmentationStateTypes';
|
|
3
3
|
declare function getGlobalConfig(): SegmentationRepresentationConfig;
|
|
4
4
|
declare function setGlobalConfig(segmentationConfig: SegmentationRepresentationConfig): void;
|
|
5
5
|
declare function getGlobalRepresentationConfig(representationType: SegmentationRepresentations): RepresentationConfig['LABELMAP'];
|
|
6
6
|
declare function setGlobalRepresentationConfig(representationType: SegmentationRepresentations, config: RepresentationConfig['LABELMAP']): void;
|
|
7
7
|
declare function getToolGroupSpecificConfig(toolGroupId: string): SegmentationRepresentationConfig;
|
|
8
8
|
declare function setToolGroupSpecificConfig(toolGroupId: string, segmentationRepresentationConfig: SegmentationRepresentationConfig): void;
|
|
9
|
-
|
|
9
|
+
declare function getSegmentationRepresentationSpecificConfig(toolGroupId: string, segmentationRepresentationUID: string): RepresentationConfig;
|
|
10
|
+
declare function setSegmentationRepresentationSpecificConfig(toolGroupId: string, segmentationRepresentationUID: string, config: RepresentationConfig): void;
|
|
11
|
+
declare function getSegmentSpecificConfig(toolGroupId: string, segmentationRepresentationUID: string, segmentIndex: number): RepresentationConfig;
|
|
12
|
+
declare function setSegmentSpecificConfig(toolGroupId: string, segmentationRepresentationUID: string, config: SegmentSpecificRepresentationConfig): void;
|
|
13
|
+
export { getGlobalConfig, setGlobalConfig, getGlobalRepresentationConfig, setGlobalRepresentationConfig, getToolGroupSpecificConfig, setToolGroupSpecificConfig, getSegmentationRepresentationSpecificConfig, setSegmentationRepresentationSpecificConfig, getSegmentSpecificConfig, setSegmentSpecificConfig, };
|
|
@@ -15,7 +15,10 @@ function setGlobalRepresentationConfig(representationType, config) {
|
|
|
15
15
|
...globalConfig,
|
|
16
16
|
representations: {
|
|
17
17
|
...globalConfig.representations,
|
|
18
|
-
[representationType]:
|
|
18
|
+
[representationType]: {
|
|
19
|
+
...globalConfig.representations[representationType],
|
|
20
|
+
...config,
|
|
21
|
+
},
|
|
19
22
|
},
|
|
20
23
|
});
|
|
21
24
|
}
|
|
@@ -25,5 +28,17 @@ function getToolGroupSpecificConfig(toolGroupId) {
|
|
|
25
28
|
function setToolGroupSpecificConfig(toolGroupId, segmentationRepresentationConfig) {
|
|
26
29
|
SegmentationState.setToolGroupSpecificConfig(toolGroupId, segmentationRepresentationConfig);
|
|
27
30
|
}
|
|
28
|
-
|
|
31
|
+
function getSegmentationRepresentationSpecificConfig(toolGroupId, segmentationRepresentationUID) {
|
|
32
|
+
return SegmentationState.getSegmentationRepresentationSpecificConfig(toolGroupId, segmentationRepresentationUID);
|
|
33
|
+
}
|
|
34
|
+
function setSegmentationRepresentationSpecificConfig(toolGroupId, segmentationRepresentationUID, config) {
|
|
35
|
+
SegmentationState.setSegmentationRepresentationSpecificConfig(toolGroupId, segmentationRepresentationUID, config);
|
|
36
|
+
}
|
|
37
|
+
function getSegmentSpecificConfig(toolGroupId, segmentationRepresentationUID, segmentIndex) {
|
|
38
|
+
return SegmentationState.getSegmentSpecificRepresentationConfig(toolGroupId, segmentationRepresentationUID, segmentIndex);
|
|
39
|
+
}
|
|
40
|
+
function setSegmentSpecificConfig(toolGroupId, segmentationRepresentationUID, config) {
|
|
41
|
+
SegmentationState.setSegmentSpecificRepresentationConfig(toolGroupId, segmentationRepresentationUID, config);
|
|
42
|
+
}
|
|
43
|
+
export { getGlobalConfig, setGlobalConfig, getGlobalRepresentationConfig, setGlobalRepresentationConfig, getToolGroupSpecificConfig, setToolGroupSpecificConfig, getSegmentationRepresentationSpecificConfig, setSegmentationRepresentationSpecificConfig, getSegmentSpecificConfig, setSegmentSpecificConfig, };
|
|
29
44
|
//# sourceMappingURL=segmentationConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmentationConfig.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/config/segmentationConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,iBAAiB,MAAM,yDAAyD,CAAC;
|
|
1
|
+
{"version":3,"file":"segmentationConfig.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/config/segmentationConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,iBAAiB,MAAM,yDAAyD,CAAC;AAa7F,SAAS,eAAe;IACtB,OAAO,iBAAiB,CAAC,eAAe,EAAE,CAAC;AAC7C,CAAC;AAMD,SAAS,eAAe,CACtB,kBAAoD;IAEpD,iBAAiB,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;AACxD,CAAC;AAOD,SAAS,6BAA6B,CACpC,kBAA+C;IAE/C,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,OAAO,YAAY,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;AAC1D,CAAC;AAUD,SAAS,6BAA6B,CACpC,kBAA+C,EAC/C,MAAwC;IAExC,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IAEvC,eAAe,CAAC;QACd,GAAG,YAAY;QACf,eAAe,EAAE;YACf,GAAG,YAAY,CAAC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ID: string, visibility: boolean): void;
|
|
2
2
|
declare function getSegmentationVisibility(toolGroupId: string, segmentationRepresentationUID: string): boolean | undefined;
|
|
3
|
-
|
|
3
|
+
declare function setVisibilityForSegmentIndex(toolGroupId: string, segmentationRepresentationUID: string, segmentIndex: number, visibility: boolean): void;
|
|
4
|
+
export { setSegmentationVisibility, getSegmentationVisibility, setVisibilityForSegmentIndex, };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { triggerSegmentationRepresentationModified } from '../triggerSegmentationEvents';
|
|
2
2
|
import { getSegmentationRepresentations } from '../../../stateManagement/segmentation/segmentationState';
|
|
3
|
+
import * as SegmentationState from '../../../stateManagement/segmentation/segmentationState';
|
|
3
4
|
function setSegmentationVisibility(toolGroupId, segmentationRepresentationUID, visibility) {
|
|
4
5
|
const toolGroupSegmentationRepresentations = getSegmentationRepresentations(toolGroupId);
|
|
5
6
|
if (!toolGroupSegmentationRepresentations) {
|
|
@@ -22,5 +23,18 @@ function getSegmentationVisibility(toolGroupId, segmentationRepresentationUID) {
|
|
|
22
23
|
}
|
|
23
24
|
return segmentationData.visibility;
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
+
function setVisibilityForSegmentIndex(toolGroupId, segmentationRepresentationUID, segmentIndex, visibility) {
|
|
27
|
+
const segRepresentation = SegmentationState.getSegmentationRepresentationByUID(toolGroupId, segmentationRepresentationUID);
|
|
28
|
+
if (!segRepresentation) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (visibility) {
|
|
32
|
+
segRepresentation.segmentsHidden.delete(segmentIndex);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
segRepresentation.segmentsHidden.add(segmentIndex);
|
|
36
|
+
}
|
|
37
|
+
triggerSegmentationRepresentationModified(toolGroupId, segmentationRepresentationUID);
|
|
38
|
+
}
|
|
39
|
+
export { setSegmentationVisibility, getSegmentationVisibility, setVisibilityForSegmentIndex, };
|
|
26
40
|
//# sourceMappingURL=segmentationVisibility.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmentationVisibility.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/config/segmentationVisibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yCAAyC,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAE,8BAA8B,EAAE,MAAM,yDAAyD,CAAC;
|
|
1
|
+
{"version":3,"file":"segmentationVisibility.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/config/segmentationVisibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yCAAyC,EAAE,MAAM,8BAA8B,CAAC;AACzF,OAAO,EAAE,8BAA8B,EAAE,MAAM,yDAAyD,CAAC;AAEzG,OAAO,KAAK,iBAAiB,MAAM,yDAAyD,CAAC;AAW7F,SAAS,yBAAyB,CAChC,WAAmB,EACnB,6BAAqC,EACrC,UAAmB;IAEnB,MAAM,oCAAoC,GACxC,8BAA8B,CAAC,WAAW,CAAC,CAAC;IAE9C,IAAI,CAAC,oCAAoC,EAAE;QACzC,OAAO;KACR;IAED,oCAAoC,CAAC,OAAO,CAC1C,CAAC,cAA+C,EAAE,EAAE;QAClD,IACE,cAAc,CAAC,6BAA6B;YAC5C,6BAA6B,EAC7B;YACA,cAAc,CAAC,UAAU,GAAG,UAAU,CAAC;YACvC,yCAAyC,CACvC,WAAW,EACX,cAAc,CAAC,6BAA6B,CAC7C,CAAC;SACH;IACH,CAAC,CACF,CAAC;AACJ,CAAC;AAWD,SAAS,yBAAyB,CAChC,WAAmB,EACnB,6BAAqC;IAErC,MAAM,2BAA2B,GAC/B,8BAA8B,CAAC,WAAW,CAAC,CAAC;IAE9C,MAAM,gBAAgB,GAAG,2BAA2B,CAAC,IAAI,CACvD,CAAC,cAA+C,EAAE,EAAE,CAClD,cAAc,CAAC,6BAA6B;QAC5C,6BAA6B,CAChC,CAAC;IAEF,IAAI,CAAC,gBAAgB,EAAE;QACrB,OAAO;KACR;IAED,OAAO,gBAAgB,CAAC,UAAU,CAAC;AACrC,CAAC;AAED,SAAS,4BAA4B,CACnC,WAAmB,EACnB,6BAAqC,EACrC,YAAoB,EACpB,UAAmB;IAEnB,MAAM,iBAAiB,GACrB,iBAAiB,CAAC,kCAAkC,CAClD,WAAW,EACX,6BAA6B,CAC9B,CAAC;IAEJ,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO;KACR;IAED,IAAI,UAAU,EAAE;QACd,iBAAiB,CAAC,cAAc,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;KACvD;SAAM;QACL,iBAAiB,CAAC,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;KACpD;IAED,yCAAyC,CACvC,WAAW,EACX,6BAA6B,CAC9B,CAAC;AACJ,CAAC;AAED,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,4BAA4B,GAC7B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function removeSegmentationsFromToolGroup(toolGroupId: string, segmentationRepresentationUIDs?: string[] | undefined): void;
|
|
1
|
+
declare function removeSegmentationsFromToolGroup(toolGroupId: string, segmentationRepresentationUIDs?: string[] | undefined, immediate?: boolean): void;
|
|
2
2
|
export default removeSegmentationsFromToolGroup;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import SegmentationRepresentations from '../../enums/SegmentationRepresentations';
|
|
2
2
|
import { labelmapDisplay } from '../../tools/displayTools/Labelmap';
|
|
3
3
|
import { getSegmentationRepresentations, getSegmentationRepresentationByUID, } from './segmentationState';
|
|
4
|
-
function removeSegmentationsFromToolGroup(toolGroupId, segmentationRepresentationUIDs) {
|
|
4
|
+
function removeSegmentationsFromToolGroup(toolGroupId, segmentationRepresentationUIDs, immediate) {
|
|
5
5
|
const toolGroupSegRepresentations = getSegmentationRepresentations(toolGroupId);
|
|
6
|
-
if (!
|
|
7
|
-
|
|
8
|
-
console.warn('removeSegmentationsFromToolGroup: No segmentationRepresentations found for toolGroupId: ', toolGroupId);
|
|
6
|
+
if (!toolGroupSegRepresentations ||
|
|
7
|
+
toolGroupSegRepresentations.length === 0) {
|
|
9
8
|
return;
|
|
10
9
|
}
|
|
11
10
|
const toolGroupSegRepresentationUIDs = toolGroupSegRepresentations.map((representation) => representation.segmentationRepresentationUID);
|
|
@@ -20,14 +19,14 @@ function removeSegmentationsFromToolGroup(toolGroupId, segmentationRepresentatio
|
|
|
20
19
|
segRepresentationUIDsToRemove = toolGroupSegRepresentationUIDs;
|
|
21
20
|
}
|
|
22
21
|
segRepresentationUIDsToRemove.forEach((segmentationDataUID) => {
|
|
23
|
-
_removeSegmentation(toolGroupId, segmentationDataUID);
|
|
22
|
+
_removeSegmentation(toolGroupId, segmentationDataUID, immediate);
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
|
-
function _removeSegmentation(toolGroupId, segmentationRepresentationUID) {
|
|
25
|
+
function _removeSegmentation(toolGroupId, segmentationRepresentationUID, immediate) {
|
|
27
26
|
const segmentationRepresentation = getSegmentationRepresentationByUID(toolGroupId, segmentationRepresentationUID);
|
|
28
27
|
const { type } = segmentationRepresentation;
|
|
29
28
|
if (type === SegmentationRepresentations.Labelmap) {
|
|
30
|
-
labelmapDisplay.removeSegmentationRepresentation(toolGroupId, segmentationRepresentationUID);
|
|
29
|
+
labelmapDisplay.removeSegmentationRepresentation(toolGroupId, segmentationRepresentationUID, immediate);
|
|
31
30
|
}
|
|
32
31
|
else {
|
|
33
32
|
throw new Error(`The representation ${type} is not supported yet`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeSegmentationsFromToolGroup.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/removeSegmentationsFromToolGroup.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,OAAO,EACL,8BAA8B,EAC9B,kCAAkC,GACnC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"removeSegmentationsFromToolGroup.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/removeSegmentationsFromToolGroup.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,OAAO,EACL,8BAA8B,EAC9B,kCAAkC,GACnC,MAAM,qBAAqB,CAAC;AAQ7B,SAAS,gCAAgC,CACvC,WAAmB,EACnB,8BAAqD,EACrD,SAAmB;IAEnB,MAAM,2BAA2B,GAC/B,8BAA8B,CAAC,WAAW,CAAC,CAAC;IAE9C,IACE,CAAC,2BAA2B;QAC5B,2BAA2B,CAAC,MAAM,KAAK,CAAC,EACxC;QACA,OAAO;KACR;IAED,MAAM,8BAA8B,GAAG,2BAA2B,CAAC,GAAG,CACpE,CAAC,cAAc,EAAE,EAAE,CAAC,cAAc,CAAC,6BAA6B,CACjE,CAAC;IAEF,IAAI,6BAA6B,GAAG,8BAA8B,CAAC;IACnE,IAAI,6BAA6B,EAAE;QAGjC,MAAM,4BAA4B,GAAG,8BAA8B,CAAC,MAAM,CACxE,CAAC,oBAAoB,EAAE,EAAE,CACvB,CAAC,8BAA8B,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CACjE,CAAC;QAEF,IAAI,4BAA4B,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3C,MAAM,IAAI,KAAK,CACb,+EAA+E,IAAI,CAAC,SAAS,CAC3F,4BAA4B,CAC7B,EAAE,CACJ,CAAC;SACH;KACF;SAAM;QAEL,6BAA6B,GAAG,8BAA8B,CAAC;KAChE;IAED,6BAA6B,CAAC,OAAO,CAAC,CAAC,mBAAmB,EAAE,EAAE;QAC5D,mBAAmB,CAAC,WAAW,EAAE,mBAAmB,EAAE,SAAS,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,mBAAmB,CAC1B,WAAmB,EACnB,6BAAqC,EACrC,SAAmB;IAEnB,MAAM,0BAA0B,GAAG,kCAAkC,CACnE,WAAW,EACX,6BAA6B,CAC9B,CAAC;IAEF,MAAM,EAAE,IAAI,EAAE,GAAG,0BAA0B,CAAC;IAE5C,IAAI,IAAI,KAAK,2BAA2B,CAAC,QAAQ,EAAE;QACjD,eAAe,CAAC,gCAAgC,CAC9C,WAAW,EACX,6BAA6B,EAC7B,SAAS,CACV,CAAC;KACH;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,uBAAuB,CAAC,CAAC;KACpE;AACH,CAAC;AAED,eAAe,gCAAgC,CAAC"}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import type { ColorLUT, Segmentation, SegmentationPublicInput, SegmentationRepresentationConfig, ToolGroupSpecificRepresentation, ToolGroupSpecificRepresentations } from '../../types/SegmentationStateTypes';
|
|
1
|
+
import type { ColorLUT, RepresentationConfig, Segmentation, SegmentationPublicInput, SegmentationRepresentationConfig, SegmentSpecificRepresentationConfig, ToolGroupSpecificRepresentation, ToolGroupSpecificRepresentations } from '../../types/SegmentationStateTypes';
|
|
2
2
|
declare function getDefaultSegmentationStateManager(): import("./SegmentationStateManager").default;
|
|
3
3
|
declare function getSegmentation(segmentationId: string): Segmentation | undefined;
|
|
4
4
|
declare function getSegmentations(): Segmentation[] | [];
|
|
5
5
|
declare function addSegmentation(segmentationInput: SegmentationPublicInput, suppressEvents?: boolean): void;
|
|
6
6
|
declare function getSegmentationRepresentations(toolGroupId: string): ToolGroupSpecificRepresentations | [];
|
|
7
|
-
declare function
|
|
7
|
+
declare function getToolGroupIdsWithSegmentation(segmentationId: string): string[];
|
|
8
8
|
declare function getToolGroupSpecificConfig(toolGroupId: string): SegmentationRepresentationConfig;
|
|
9
9
|
declare function setToolGroupSpecificConfig(toolGroupId: string, config: SegmentationRepresentationConfig, suppressEvents?: boolean): void;
|
|
10
|
+
declare function setSegmentationRepresentationSpecificConfig(toolGroupId: string, segmentationRepresentationUID: string, config: RepresentationConfig, suppressEvents?: boolean): void;
|
|
11
|
+
declare function getSegmentationRepresentationSpecificConfig(toolGroupId: string, segmentationRepresentationUID: string): RepresentationConfig;
|
|
12
|
+
declare function getSegmentSpecificRepresentationConfig(toolGroupId: string, segmentationRepresentationUID: string, segmentIndex: number): RepresentationConfig;
|
|
13
|
+
declare function setSegmentSpecificRepresentationConfig(toolGroupId: string, segmentationRepresentationUID: string, config: SegmentSpecificRepresentationConfig, suppressEvents?: boolean): void;
|
|
10
14
|
declare function addSegmentationRepresentation(toolGroupId: string, segmentationRepresentation: ToolGroupSpecificRepresentation, suppressEvents?: boolean): void;
|
|
11
15
|
declare function getGlobalConfig(): SegmentationRepresentationConfig;
|
|
12
16
|
declare function setGlobalConfig(config: SegmentationRepresentationConfig, suppressEvents?: boolean): void;
|
|
13
17
|
declare function getSegmentationRepresentationByUID(toolGroupId: string, segmentationRepresentationUID: string): ToolGroupSpecificRepresentation | undefined;
|
|
14
18
|
declare function removeSegmentation(segmentationId: string): void;
|
|
15
19
|
declare function removeSegmentationRepresentation(toolGroupId: string, segmentationRepresentationUID: string): void;
|
|
20
|
+
declare function removeColorLUT(colorLUTIndex: number): void;
|
|
16
21
|
declare function getColorLUT(index: number): ColorLUT | undefined;
|
|
17
22
|
declare function addColorLUT(colorLUT: ColorLUT, index: number): void;
|
|
18
|
-
export { getDefaultSegmentationStateManager, getSegmentation, getSegmentations, addSegmentation, removeSegmentation, getSegmentationRepresentations, addSegmentationRepresentation, removeSegmentationRepresentation, getToolGroupSpecificConfig, setToolGroupSpecificConfig, getGlobalConfig, setGlobalConfig,
|
|
23
|
+
export { getDefaultSegmentationStateManager, getSegmentation, getSegmentations, addSegmentation, removeSegmentation, getSegmentationRepresentations, addSegmentationRepresentation, removeSegmentationRepresentation, getToolGroupSpecificConfig, setToolGroupSpecificConfig, getGlobalConfig, setGlobalConfig, getSegmentationRepresentationSpecificConfig, setSegmentationRepresentationSpecificConfig, getSegmentSpecificRepresentationConfig, setSegmentSpecificRepresentationConfig, getToolGroupIdsWithSegmentation, getSegmentationRepresentationByUID, addColorLUT, getColorLUT, removeColorLUT, };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defaultSegmentationStateManager } from './SegmentationStateManager';
|
|
2
2
|
import { triggerSegmentationRepresentationModified, triggerSegmentationModified, triggerSegmentationRepresentationRemoved, triggerSegmentationRemoved, } from './triggerSegmentationEvents';
|
|
3
|
-
import { getDefaultRepresentationConfig } from '../../utilities/segmentation';
|
|
4
3
|
import normalizeSegmentationInput from './helpers/normalizeSegmentationInput';
|
|
4
|
+
import getDefaultLabelmapConfig from '../../tools/displayTools/Labelmap/labelmapConfig';
|
|
5
|
+
import { SegmentationRepresentations } from '../../enums';
|
|
5
6
|
function getDefaultSegmentationStateManager() {
|
|
6
7
|
return defaultSegmentationStateManager;
|
|
7
8
|
}
|
|
@@ -17,7 +18,6 @@ function getSegmentations() {
|
|
|
17
18
|
function addSegmentation(segmentationInput, suppressEvents) {
|
|
18
19
|
const segmentationStateManager = getDefaultSegmentationStateManager();
|
|
19
20
|
const segmentation = normalizeSegmentationInput(segmentationInput);
|
|
20
|
-
_initializeDefaultConfig(segmentation);
|
|
21
21
|
segmentationStateManager.addSegmentation(segmentation);
|
|
22
22
|
if (!suppressEvents) {
|
|
23
23
|
triggerSegmentationModified(segmentation.segmentationId);
|
|
@@ -27,7 +27,7 @@ function getSegmentationRepresentations(toolGroupId) {
|
|
|
27
27
|
const segmentationStateManager = getDefaultSegmentationStateManager();
|
|
28
28
|
return segmentationStateManager.getSegmentationRepresentations(toolGroupId);
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function getToolGroupIdsWithSegmentation(segmentationId) {
|
|
31
31
|
const segmentationStateManager = getDefaultSegmentationStateManager();
|
|
32
32
|
const state = segmentationStateManager.getState();
|
|
33
33
|
const toolGroupIds = Object.keys(state.toolGroups);
|
|
@@ -53,6 +53,28 @@ function setToolGroupSpecificConfig(toolGroupId, config, suppressEvents) {
|
|
|
53
53
|
triggerSegmentationRepresentationModified(toolGroupId);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
+
function setSegmentationRepresentationSpecificConfig(toolGroupId, segmentationRepresentationUID, config, suppressEvents = false) {
|
|
57
|
+
const segmentationStateManager = getDefaultSegmentationStateManager();
|
|
58
|
+
segmentationStateManager.setSegmentationRepresentationSpecificConfig(toolGroupId, segmentationRepresentationUID, config);
|
|
59
|
+
if (!suppressEvents) {
|
|
60
|
+
triggerSegmentationRepresentationModified(toolGroupId, segmentationRepresentationUID);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function getSegmentationRepresentationSpecificConfig(toolGroupId, segmentationRepresentationUID) {
|
|
64
|
+
const segmentationStateManager = getDefaultSegmentationStateManager();
|
|
65
|
+
return segmentationStateManager.getSegmentationRepresentationSpecificConfig(toolGroupId, segmentationRepresentationUID);
|
|
66
|
+
}
|
|
67
|
+
function getSegmentSpecificRepresentationConfig(toolGroupId, segmentationRepresentationUID, segmentIndex) {
|
|
68
|
+
const segmentationStateManager = getDefaultSegmentationStateManager();
|
|
69
|
+
return segmentationStateManager.getSegmentSpecificConfig(toolGroupId, segmentationRepresentationUID, segmentIndex);
|
|
70
|
+
}
|
|
71
|
+
function setSegmentSpecificRepresentationConfig(toolGroupId, segmentationRepresentationUID, config, suppressEvents = false) {
|
|
72
|
+
const segmentationStateManager = getDefaultSegmentationStateManager();
|
|
73
|
+
segmentationStateManager.setSegmentSpecificConfig(toolGroupId, segmentationRepresentationUID, config);
|
|
74
|
+
if (!suppressEvents) {
|
|
75
|
+
triggerSegmentationRepresentationModified(toolGroupId, segmentationRepresentationUID);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
56
78
|
function addSegmentationRepresentation(toolGroupId, segmentationRepresentation, suppressEvents) {
|
|
57
79
|
const segmentationStateManager = getDefaultSegmentationStateManager();
|
|
58
80
|
segmentationStateManager.addSegmentationRepresentation(toolGroupId, segmentationRepresentation);
|
|
@@ -85,6 +107,10 @@ function removeSegmentationRepresentation(toolGroupId, segmentationRepresentatio
|
|
|
85
107
|
segmentationStateManager.removeSegmentationRepresentation(toolGroupId, segmentationRepresentationUID);
|
|
86
108
|
triggerSegmentationRepresentationRemoved(toolGroupId, segmentationRepresentationUID);
|
|
87
109
|
}
|
|
110
|
+
function removeColorLUT(colorLUTIndex) {
|
|
111
|
+
const segmentationStateManager = getDefaultSegmentationStateManager();
|
|
112
|
+
segmentationStateManager.removeColorLUT(colorLUTIndex);
|
|
113
|
+
}
|
|
88
114
|
function getColorLUT(index) {
|
|
89
115
|
const segmentationStateManager = getDefaultSegmentationStateManager();
|
|
90
116
|
return segmentationStateManager.getColorLUT(index);
|
|
@@ -93,16 +119,13 @@ function addColorLUT(colorLUT, index) {
|
|
|
93
119
|
const segmentationStateManager = getDefaultSegmentationStateManager();
|
|
94
120
|
segmentationStateManager.addColorLUT(colorLUT, index);
|
|
95
121
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
setGlobalConfig(newGlobalConfig, suppressEvents);
|
|
106
|
-
}
|
|
107
|
-
export { getDefaultSegmentationStateManager, getSegmentation, getSegmentations, addSegmentation, removeSegmentation, getSegmentationRepresentations, addSegmentationRepresentation, removeSegmentationRepresentation, getToolGroupSpecificConfig, setToolGroupSpecificConfig, getGlobalConfig, setGlobalConfig, getToolGroupsWithSegmentation, getSegmentationRepresentationByUID, addColorLUT, getColorLUT, };
|
|
122
|
+
const defaultLabelmapConfig = getDefaultLabelmapConfig();
|
|
123
|
+
const newGlobalConfig = {
|
|
124
|
+
renderInactiveSegmentations: true,
|
|
125
|
+
representations: {
|
|
126
|
+
[SegmentationRepresentations.Labelmap]: defaultLabelmapConfig,
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
setGlobalConfig(newGlobalConfig, true);
|
|
130
|
+
export { getDefaultSegmentationStateManager, getSegmentation, getSegmentations, addSegmentation, removeSegmentation, getSegmentationRepresentations, addSegmentationRepresentation, removeSegmentationRepresentation, getToolGroupSpecificConfig, setToolGroupSpecificConfig, getGlobalConfig, setGlobalConfig, getSegmentationRepresentationSpecificConfig, setSegmentationRepresentationSpecificConfig, getSegmentSpecificRepresentationConfig, setSegmentSpecificRepresentationConfig, getToolGroupIdsWithSegmentation, getSegmentationRepresentationByUID, addColorLUT, getColorLUT, removeColorLUT, };
|
|
108
131
|
//# sourceMappingURL=segmentationState.js.map
|