@cornerstonejs/tools 0.6.0 → 0.7.2
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/constants/COLOR_LUT.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -8
- package/dist/cjs/index.js +1 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/stateManagement/annotation/annotationSelection.d.ts +2 -1
- package/dist/cjs/stateManagement/annotation/annotationSelection.js +2 -1
- package/dist/cjs/stateManagement/annotation/annotationSelection.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/SegmentationStateManager.d.ts +4 -4
- package/dist/cjs/stateManagement/segmentation/SegmentationStateManager.js +9 -9
- package/dist/cjs/stateManagement/segmentation/config/segmentationColor.d.ts +2 -2
- package/dist/cjs/stateManagement/segmentation/config/segmentationColor.js +3 -3
- package/dist/cjs/stateManagement/segmentation/segmentationState.d.ts +4 -4
- package/dist/cjs/stateManagement/segmentation/segmentationState.js +6 -6
- package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js +1 -1
- package/dist/cjs/types/SegmentationStateTypes.d.ts +2 -2
- package/dist/cjs/types/index.d.ts +2 -2
- package/dist/esm/constants/COLOR_LUT.js.map +1 -1
- package/dist/esm/index.d.ts +1 -8
- package/dist/esm/index.js +1 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/stateManagement/annotation/annotationSelection.d.ts +2 -1
- package/dist/esm/stateManagement/annotation/annotationSelection.js +1 -1
- package/dist/esm/stateManagement/annotation/annotationSelection.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/SegmentationStateManager.d.ts +4 -4
- package/dist/esm/stateManagement/segmentation/SegmentationStateManager.js +9 -9
- package/dist/esm/stateManagement/segmentation/config/segmentationColor.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/config/segmentationColor.js +3 -3
- package/dist/esm/stateManagement/segmentation/segmentationState.d.ts +4 -4
- package/dist/esm/stateManagement/segmentation/segmentationState.js +5 -5
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js +1 -1
- package/dist/esm/types/SegmentationStateTypes.d.ts +2 -2
- package/dist/esm/types/index.d.ts +2 -2
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -16,7 +16,7 @@ function setColorLUT(toolGroupId, segmentationRepresentationUID, colorLUTIndex)
|
|
|
16
16
|
if (!segRepresentation) {
|
|
17
17
|
throw new Error(`setColorLUT: could not find segmentation representation with UID ${segmentationRepresentationUID}`);
|
|
18
18
|
}
|
|
19
|
-
if (!SegmentationState.
|
|
19
|
+
if (!SegmentationState.getColorLUT(colorLUTIndex)) {
|
|
20
20
|
throw new Error(`setColorLUT: could not find colorLUT with index ${colorLUTIndex}`);
|
|
21
21
|
}
|
|
22
22
|
segRepresentation.colorLUTIndex = colorLUTIndex;
|
|
@@ -28,8 +28,8 @@ function getColorForSegmentIndex(toolGroupId, segmentationRepresentationUID, seg
|
|
|
28
28
|
throw new Error(`segmentation representation with UID ${segmentationRepresentationUID} does not exist for tool group ${toolGroupId}`);
|
|
29
29
|
}
|
|
30
30
|
const { colorLUTIndex } = segmentationRepresentation;
|
|
31
|
-
const
|
|
32
|
-
return
|
|
31
|
+
const colorLUT = SegmentationState.getColorLUT(colorLUTIndex);
|
|
32
|
+
return colorLUT[segmentIndex];
|
|
33
33
|
}
|
|
34
34
|
export { getColorForSegmentIndex, addColorLUT, setColorLUT };
|
|
35
35
|
//# sourceMappingURL=segmentationColor.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ColorLUT, Segmentation, SegmentationPublicInput, SegmentationRepresentationConfig, 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[] | [];
|
|
@@ -12,6 +12,6 @@ declare function getGlobalConfig(): SegmentationRepresentationConfig;
|
|
|
12
12
|
declare function setGlobalConfig(config: SegmentationRepresentationConfig, suppressEvents?: boolean): void;
|
|
13
13
|
declare function getSegmentationRepresentationByUID(toolGroupId: string, segmentationRepresentationUID: string): ToolGroupSpecificRepresentation | undefined;
|
|
14
14
|
declare function removeSegmentationRepresentation(toolGroupId: string, segmentationRepresentationUID: string): void;
|
|
15
|
-
declare function
|
|
16
|
-
declare function addColorLUT(
|
|
17
|
-
export { getDefaultSegmentationStateManager, getSegmentation, getSegmentations, addSegmentation, getSegmentationRepresentations, addSegmentationRepresentation, removeSegmentationRepresentation, getToolGroupSpecificConfig, setToolGroupSpecificConfig, getGlobalConfig, setGlobalConfig, getToolGroupsWithSegmentation, getSegmentationRepresentationByUID, addColorLUT,
|
|
15
|
+
declare function getColorLUT(index: number): ColorLUT | undefined;
|
|
16
|
+
declare function addColorLUT(colorLUT: ColorLUT, index: number): void;
|
|
17
|
+
export { getDefaultSegmentationStateManager, getSegmentation, getSegmentations, addSegmentation, getSegmentationRepresentations, addSegmentationRepresentation, removeSegmentationRepresentation, getToolGroupSpecificConfig, setToolGroupSpecificConfig, getGlobalConfig, setGlobalConfig, getToolGroupsWithSegmentation, getSegmentationRepresentationByUID, addColorLUT, getColorLUT, };
|
|
@@ -80,13 +80,13 @@ function removeSegmentationRepresentation(toolGroupId, segmentationRepresentatio
|
|
|
80
80
|
segmentationStateManager.removeSegmentationRepresentation(toolGroupId, segmentationRepresentationUID);
|
|
81
81
|
triggerSegmentationRepresentationRemoved(toolGroupId, segmentationRepresentationUID);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function getColorLUT(index) {
|
|
84
84
|
const segmentationStateManager = getDefaultSegmentationStateManager();
|
|
85
|
-
return segmentationStateManager.
|
|
85
|
+
return segmentationStateManager.getColorLUT(index);
|
|
86
86
|
}
|
|
87
|
-
function addColorLUT(
|
|
87
|
+
function addColorLUT(colorLUT, index) {
|
|
88
88
|
const segmentationStateManager = getDefaultSegmentationStateManager();
|
|
89
|
-
segmentationStateManager.addColorLUT(
|
|
89
|
+
segmentationStateManager.addColorLUT(colorLUT, index);
|
|
90
90
|
}
|
|
91
91
|
function _initializeDefaultConfig(segmentation) {
|
|
92
92
|
const suppressEvents = true;
|
|
@@ -99,5 +99,5 @@ function _initializeDefaultConfig(segmentation) {
|
|
|
99
99
|
};
|
|
100
100
|
setGlobalConfig(newGlobalConfig, suppressEvents);
|
|
101
101
|
}
|
|
102
|
-
export { getDefaultSegmentationStateManager, getSegmentation, getSegmentations, addSegmentation, getSegmentationRepresentations, addSegmentationRepresentation, removeSegmentationRepresentation, getToolGroupSpecificConfig, setToolGroupSpecificConfig, getGlobalConfig, setGlobalConfig, getToolGroupsWithSegmentation, getSegmentationRepresentationByUID, addColorLUT,
|
|
102
|
+
export { getDefaultSegmentationStateManager, getSegmentation, getSegmentations, addSegmentation, getSegmentationRepresentations, addSegmentationRepresentation, removeSegmentationRepresentation, getToolGroupSpecificConfig, setToolGroupSpecificConfig, getGlobalConfig, setGlobalConfig, getToolGroupsWithSegmentation, getSegmentationRepresentationByUID, addColorLUT, getColorLUT, };
|
|
103
103
|
//# sourceMappingURL=segmentationState.js.map
|
|
@@ -83,7 +83,7 @@ function _setLabelmapColorAndOpacity(viewportId, actor, cfun, ofun, colorLUTInde
|
|
|
83
83
|
const renderFill = isActiveLabelmap
|
|
84
84
|
? labelmapConfig.renderFill
|
|
85
85
|
: labelmapConfig.renderFillInactive;
|
|
86
|
-
const colorLUT = SegmentationState.
|
|
86
|
+
const colorLUT = SegmentationState.getColorLUT(colorLUTIndex);
|
|
87
87
|
const numColors = Math.min(256, colorLUT.length);
|
|
88
88
|
const { volumeActor, uid } = actor;
|
|
89
89
|
const { needColorUpdate, needOpacityUpdate } = _needsTransferFunctionUpdate(viewportId, uid, fillAlpha, colorLUTIndex, renderFill);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Enums from '../enums';
|
|
2
2
|
import type { LabelmapConfig, LabelmapSegmentationData, LabelmapRenderingConfig } from './LabelmapTypes';
|
|
3
3
|
export declare type Color = [number, number, number, number];
|
|
4
|
-
export declare type
|
|
4
|
+
export declare type ColorLUT = Array<Color>;
|
|
5
5
|
export declare type RepresentationConfig = {
|
|
6
6
|
LABELMAP?: LabelmapConfig;
|
|
7
7
|
};
|
|
@@ -38,7 +38,7 @@ export declare type ToolGroupSpecificLabelmapRepresentation = ToolGroupSpecificR
|
|
|
38
38
|
export declare type ToolGroupSpecificRepresentation = ToolGroupSpecificLabelmapRepresentation;
|
|
39
39
|
export declare type ToolGroupSpecificRepresentations = Array<ToolGroupSpecificRepresentation>;
|
|
40
40
|
export declare type SegmentationState = {
|
|
41
|
-
|
|
41
|
+
colorLUT: ColorLUT[];
|
|
42
42
|
segmentations: Segmentation[];
|
|
43
43
|
globalConfig: SegmentationRepresentationConfig;
|
|
44
44
|
toolGroups: {
|
|
@@ -11,5 +11,5 @@ import type { AnnotationHandle, TextBoxHandle } from './ToolHandle';
|
|
|
11
11
|
import type InteractionTypes from './InteractionTypes';
|
|
12
12
|
import type { ToolProps, PublicToolProps } from './ToolProps';
|
|
13
13
|
import type { SVGCursorDescriptor, SVGPoint } from './CursorTypes';
|
|
14
|
-
import type { Color,
|
|
15
|
-
export type { Annotation, Annotations, FrameOfReferenceSpecificAnnotations, AnnotationState, ToolSpecificAnnotationTypes, PlanarBoundingBox, ToolProps, PublicToolProps, EventTypes, IPoints, IToolBinding, SetToolBindingsType, ToolOptionsType, InteractionTypes, IToolGroup, ToolHandle, AnnotationHandle, TextBoxHandle, Segmentation, SegmentationState, SegmentationRepresentationData, SegmentationRepresentationConfig, RepresentationConfig, ToolGroupSpecificRepresentationState, ToolGroupSpecificLabelmapRepresentation, ToolGroupSpecificRepresentation, Color,
|
|
14
|
+
import type { Color, ColorLUT, RepresentationConfig, SegmentationRepresentationConfig, SegmentationRepresentationData, Segmentation, ToolGroupSpecificRepresentationState, ToolGroupSpecificLabelmapRepresentation, ToolGroupSpecificRepresentation, SegmentationState, RepresentationPublicInput } from './SegmentationStateTypes';
|
|
15
|
+
export type { Annotation, Annotations, FrameOfReferenceSpecificAnnotations, AnnotationState, ToolSpecificAnnotationTypes, PlanarBoundingBox, ToolProps, PublicToolProps, EventTypes, IPoints, IToolBinding, SetToolBindingsType, ToolOptionsType, InteractionTypes, IToolGroup, ToolHandle, AnnotationHandle, TextBoxHandle, Segmentation, SegmentationState, SegmentationRepresentationData, SegmentationRepresentationConfig, RepresentationConfig, ToolGroupSpecificRepresentationState, ToolGroupSpecificLabelmapRepresentation, ToolGroupSpecificRepresentation, RepresentationPublicInput, Color, ColorLUT, LabelmapTypes, SVGCursorDescriptor, SVGPoint, };
|