@cornerstonejs/tools 0.4.4 → 0.5.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/README.md +7 -1
- package/dist/cjs/stateManagement/segmentation/addSegmentationRepresentations.d.ts +1 -1
- package/dist/cjs/stateManagement/segmentation/addSegmentationRepresentations.js +6 -2
- package/dist/cjs/stateManagement/segmentation/addSegmentationRepresentations.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/index.d.ts +1 -2
- package/dist/cjs/stateManagement/segmentation/index.js +1 -3
- package/dist/cjs/stateManagement/segmentation/index.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/segmentIndex.d.ts +3 -5
- package/dist/cjs/stateManagement/segmentation/segmentIndex.js +4 -30
- package/dist/cjs/stateManagement/segmentation/segmentIndex.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/segmentLocking.d.ts +4 -6
- package/dist/cjs/stateManagement/segmentation/segmentLocking.js +7 -36
- package/dist/cjs/stateManagement/segmentation/segmentLocking.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/segmentationState.js +0 -9
- package/dist/cjs/stateManagement/segmentation/segmentationState.js.map +1 -1
- package/dist/cjs/tools/annotation/BidirectionalTool.d.ts +2 -27
- package/dist/cjs/tools/annotation/BidirectionalTool.js.map +1 -1
- package/dist/cjs/tools/annotation/EllipticalROITool.d.ts +2 -29
- package/dist/cjs/tools/annotation/EllipticalROITool.js.map +1 -1
- package/dist/cjs/tools/annotation/LengthTool.d.ts +2 -25
- package/dist/cjs/tools/annotation/LengthTool.js.map +1 -1
- package/dist/cjs/tools/annotation/ProbeTool.d.ts +2 -17
- package/dist/cjs/tools/annotation/ProbeTool.js.map +1 -1
- package/dist/cjs/tools/annotation/RectangleROITool.d.ts +2 -34
- package/dist/cjs/tools/annotation/RectangleROITool.js.map +1 -1
- package/dist/cjs/tools/displayTools/Labelmap/labelmapConfig.js +0 -2
- package/dist/cjs/tools/displayTools/Labelmap/labelmapConfig.js.map +1 -1
- package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.d.ts +1 -1
- package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js +5 -3
- package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
- package/dist/cjs/tools/segmentation/BrushTool.d.ts +2 -1
- package/dist/cjs/tools/segmentation/BrushTool.js +99 -96
- package/dist/cjs/tools/segmentation/BrushTool.js.map +1 -1
- package/dist/cjs/tools/segmentation/CircleScissorsTool.js +2 -2
- package/dist/cjs/tools/segmentation/CircleScissorsTool.js.map +1 -1
- package/dist/cjs/tools/segmentation/RectangleROIStartEndThresholdTool.d.ts +2 -29
- package/dist/cjs/tools/segmentation/RectangleROIStartEndThresholdTool.js.map +1 -1
- package/dist/cjs/tools/segmentation/RectangleROIThresholdTool.d.ts +1 -22
- package/dist/cjs/tools/segmentation/RectangleROIThresholdTool.js.map +1 -1
- package/dist/cjs/tools/segmentation/RectangleScissorsTool.js +2 -2
- package/dist/cjs/tools/segmentation/RectangleScissorsTool.js.map +1 -1
- package/dist/cjs/tools/segmentation/SphereScissorsTool.js +2 -2
- package/dist/cjs/tools/segmentation/SphereScissorsTool.js.map +1 -1
- package/dist/cjs/types/LabelmapTypes.d.ts +0 -1
- package/dist/cjs/types/ToolSpecificAnnotationTypes.d.ts +168 -0
- package/dist/cjs/types/ToolSpecificAnnotationTypes.js +3 -0
- package/dist/cjs/types/ToolSpecificAnnotationTypes.js.map +1 -0
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/cjs/utilities/segmentation/createLabelmapVolumeForViewport.d.ts +18 -0
- package/dist/cjs/{stateManagement/segmentation/createNewSegmentationForToolGroup.js → utilities/segmentation/createLabelmapVolumeForViewport.js} +8 -10
- package/dist/cjs/utilities/segmentation/createLabelmapVolumeForViewport.js.map +1 -0
- 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/segmentation/thresholdVolumeByRange.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentations.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentations.js +6 -2
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentations.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/index.d.ts +1 -2
- package/dist/esm/stateManagement/segmentation/index.js +1 -2
- package/dist/esm/stateManagement/segmentation/index.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/segmentIndex.d.ts +3 -5
- package/dist/esm/stateManagement/segmentation/segmentIndex.js +3 -27
- package/dist/esm/stateManagement/segmentation/segmentIndex.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/segmentLocking.d.ts +4 -6
- package/dist/esm/stateManagement/segmentation/segmentLocking.js +4 -31
- package/dist/esm/stateManagement/segmentation/segmentLocking.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/segmentationState.js +0 -9
- package/dist/esm/stateManagement/segmentation/segmentationState.js.map +1 -1
- package/dist/esm/tools/annotation/BidirectionalTool.d.ts +2 -27
- package/dist/esm/tools/annotation/BidirectionalTool.js.map +1 -1
- package/dist/esm/tools/annotation/EllipticalROITool.d.ts +2 -29
- package/dist/esm/tools/annotation/EllipticalROITool.js.map +1 -1
- package/dist/esm/tools/annotation/LengthTool.d.ts +2 -25
- package/dist/esm/tools/annotation/LengthTool.js.map +1 -1
- package/dist/esm/tools/annotation/ProbeTool.d.ts +2 -17
- package/dist/esm/tools/annotation/ProbeTool.js.map +1 -1
- package/dist/esm/tools/annotation/RectangleROITool.d.ts +2 -34
- package/dist/esm/tools/annotation/RectangleROITool.js.map +1 -1
- package/dist/esm/tools/displayTools/Labelmap/labelmapConfig.js +0 -2
- package/dist/esm/tools/displayTools/Labelmap/labelmapConfig.js.map +1 -1
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.d.ts +1 -1
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js +5 -3
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
- package/dist/esm/tools/segmentation/BrushTool.d.ts +2 -1
- package/dist/esm/tools/segmentation/BrushTool.js +99 -96
- package/dist/esm/tools/segmentation/BrushTool.js.map +1 -1
- package/dist/esm/tools/segmentation/CircleScissorsTool.js +2 -2
- package/dist/esm/tools/segmentation/CircleScissorsTool.js.map +1 -1
- package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.d.ts +2 -29
- package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.js.map +1 -1
- package/dist/esm/tools/segmentation/RectangleROIThresholdTool.d.ts +1 -22
- package/dist/esm/tools/segmentation/RectangleROIThresholdTool.js.map +1 -1
- package/dist/esm/tools/segmentation/RectangleScissorsTool.js +2 -2
- package/dist/esm/tools/segmentation/RectangleScissorsTool.js.map +1 -1
- package/dist/esm/tools/segmentation/SphereScissorsTool.js +2 -2
- package/dist/esm/tools/segmentation/SphereScissorsTool.js.map +1 -1
- package/dist/esm/types/LabelmapTypes.d.ts +0 -1
- package/dist/esm/types/ToolSpecificAnnotationTypes.d.ts +168 -0
- package/dist/esm/types/ToolSpecificAnnotationTypes.js +2 -0
- package/dist/esm/types/ToolSpecificAnnotationTypes.js.map +1 -0
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/esm/utilities/segmentation/createLabelmapVolumeForViewport.d.ts +18 -0
- package/dist/esm/{stateManagement/segmentation/createNewSegmentationForToolGroup.js → utilities/segmentation/createLabelmapVolumeForViewport.js} +7 -10
- package/dist/esm/utilities/segmentation/createLabelmapVolumeForViewport.js.map +1 -0
- 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/segmentation/thresholdVolumeByRange.d.ts +2 -2
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +6 -6
- package/dist/cjs/stateManagement/segmentation/createNewSegmentationForToolGroup.d.ts +0 -14
- package/dist/cjs/stateManagement/segmentation/createNewSegmentationForToolGroup.js.map +0 -1
- package/dist/esm/stateManagement/segmentation/createNewSegmentationForToolGroup.d.ts +0 -14
- package/dist/esm/stateManagement/segmentation/createNewSegmentationForToolGroup.js.map +0 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import type { Types } from '@cornerstonejs/core';
|
|
2
|
+
import { Annotation } from './AnnotationTypes';
|
|
3
|
+
interface ROICachedStats {
|
|
4
|
+
[targetId: string]: {
|
|
5
|
+
Modality: string;
|
|
6
|
+
area: number;
|
|
7
|
+
max: number;
|
|
8
|
+
mean: number;
|
|
9
|
+
stdDev: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface RectangleROIAnnotation extends Annotation {
|
|
13
|
+
data: {
|
|
14
|
+
handles: {
|
|
15
|
+
points: Types.Point3[];
|
|
16
|
+
activeHandleIndex: number | null;
|
|
17
|
+
textBox: {
|
|
18
|
+
hasMoved: boolean;
|
|
19
|
+
worldPosition: Types.Point3;
|
|
20
|
+
worldBoundingBox: {
|
|
21
|
+
topLeft: Types.Point3;
|
|
22
|
+
topRight: Types.Point3;
|
|
23
|
+
bottomLeft: Types.Point3;
|
|
24
|
+
bottomRight: Types.Point3;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
label: string;
|
|
29
|
+
cachedStats?: ROICachedStats | {
|
|
30
|
+
projectionPoints?: Types.Point3[];
|
|
31
|
+
projectionPointsImageIds?: string[];
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface ProbeAnnotation extends Annotation {
|
|
36
|
+
data: {
|
|
37
|
+
handles: {
|
|
38
|
+
points: Types.Point3[];
|
|
39
|
+
};
|
|
40
|
+
cachedStats: {
|
|
41
|
+
[targetId: string]: {
|
|
42
|
+
Modality: string;
|
|
43
|
+
index: Types.Point3;
|
|
44
|
+
value: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
label: string;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface LengthAnnotation extends Annotation {
|
|
51
|
+
data: {
|
|
52
|
+
handles: {
|
|
53
|
+
points: Types.Point3[];
|
|
54
|
+
activeHandleIndex: number | null;
|
|
55
|
+
textBox: {
|
|
56
|
+
hasMoved: boolean;
|
|
57
|
+
worldPosition: Types.Point3;
|
|
58
|
+
worldBoundingBox: {
|
|
59
|
+
topLeft: Types.Point3;
|
|
60
|
+
topRight: Types.Point3;
|
|
61
|
+
bottomLeft: Types.Point3;
|
|
62
|
+
bottomRight: Types.Point3;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
label: string;
|
|
67
|
+
cachedStats: {
|
|
68
|
+
[targetId: string]: {
|
|
69
|
+
length: number;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export interface EllipticalROIAnnotation extends Annotation {
|
|
75
|
+
data: {
|
|
76
|
+
handles: {
|
|
77
|
+
points: [Types.Point3, Types.Point3, Types.Point3, Types.Point3];
|
|
78
|
+
activeHandleIndex: number | null;
|
|
79
|
+
textBox?: {
|
|
80
|
+
hasMoved: boolean;
|
|
81
|
+
worldPosition: Types.Point3;
|
|
82
|
+
worldBoundingBox: {
|
|
83
|
+
topLeft: Types.Point3;
|
|
84
|
+
topRight: Types.Point3;
|
|
85
|
+
bottomLeft: Types.Point3;
|
|
86
|
+
bottomRight: Types.Point3;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
label: string;
|
|
91
|
+
cachedStats?: ROICachedStats;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export interface BidirectionalAnnotation extends Annotation {
|
|
95
|
+
data: {
|
|
96
|
+
handles: {
|
|
97
|
+
points: Types.Point3[];
|
|
98
|
+
activeHandleIndex: number | null;
|
|
99
|
+
textBox: {
|
|
100
|
+
hasMoved: boolean;
|
|
101
|
+
worldPosition: Types.Point3;
|
|
102
|
+
worldBoundingBox: {
|
|
103
|
+
topLeft: Types.Point3;
|
|
104
|
+
topRight: Types.Point3;
|
|
105
|
+
bottomLeft: Types.Point3;
|
|
106
|
+
bottomRight: Types.Point3;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
label: string;
|
|
111
|
+
cachedStats: {
|
|
112
|
+
[targetId: string]: {
|
|
113
|
+
length: number;
|
|
114
|
+
width: number;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export interface RectangleROIThresholdAnnotation extends Annotation {
|
|
120
|
+
metadata: {
|
|
121
|
+
cameraPosition?: Types.Point3;
|
|
122
|
+
cameraFocalPoint?: Types.Point3;
|
|
123
|
+
viewPlaneNormal?: Types.Point3;
|
|
124
|
+
viewUp?: Types.Point3;
|
|
125
|
+
annotationUID?: string;
|
|
126
|
+
FrameOfReferenceUID: string;
|
|
127
|
+
referencedImageId?: string;
|
|
128
|
+
toolName: string;
|
|
129
|
+
enabledElement: Types.IEnabledElement;
|
|
130
|
+
volumeId: string;
|
|
131
|
+
};
|
|
132
|
+
data: {
|
|
133
|
+
label: string;
|
|
134
|
+
handles: {
|
|
135
|
+
points: Types.Point3[];
|
|
136
|
+
activeHandleIndex: number | null;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
export interface RectangleROIStartEndThresholdAnnotation extends Annotation {
|
|
141
|
+
metadata: {
|
|
142
|
+
cameraPosition?: Types.Point3;
|
|
143
|
+
cameraFocalPoint?: Types.Point3;
|
|
144
|
+
viewPlaneNormal?: Types.Point3;
|
|
145
|
+
viewUp?: Types.Point3;
|
|
146
|
+
annotationUID?: string;
|
|
147
|
+
FrameOfReferenceUID: string;
|
|
148
|
+
referencedImageId?: string;
|
|
149
|
+
toolName: string;
|
|
150
|
+
enabledElement: any;
|
|
151
|
+
volumeId: string;
|
|
152
|
+
spacingInNormal: number;
|
|
153
|
+
};
|
|
154
|
+
data: {
|
|
155
|
+
label: string;
|
|
156
|
+
startSlice: number;
|
|
157
|
+
endSlice: number;
|
|
158
|
+
cachedStats: {
|
|
159
|
+
projectionPoints: Types.Point3[][];
|
|
160
|
+
projectionPointsImageIds: string[];
|
|
161
|
+
};
|
|
162
|
+
handles: {
|
|
163
|
+
points: Types.Point3[];
|
|
164
|
+
activeHandleIndex: number | null;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolSpecificAnnotationTypes.js","sourceRoot":"","sources":["../../../src/types/ToolSpecificAnnotationTypes.ts"],"names":[],"mappings":""}
|
|
@@ -4,10 +4,11 @@ import type IPoints from './IPoints';
|
|
|
4
4
|
import type PlanarBoundingBox from './PlanarBoundingBox';
|
|
5
5
|
import type { SetToolBindingsType, IToolBinding, ToolOptionsType } from './ISetToolModeOptions';
|
|
6
6
|
import type IToolGroup from './IToolGroup';
|
|
7
|
+
import type * as ToolSpecificAnnotationTypes from './ToolSpecificAnnotationTypes';
|
|
7
8
|
import type ToolHandle from './ToolHandle';
|
|
8
9
|
import type { AnnotationHandle, TextBoxHandle } from './ToolHandle';
|
|
9
10
|
import type InteractionTypes from './InteractionTypes';
|
|
10
11
|
import type { ToolProps, PublicToolProps } from './ToolProps';
|
|
11
12
|
import type { SVGCursorDescriptor, SVGPoint } from './CursorTypes';
|
|
12
13
|
import type { Color, ColorLut, RepresentationConfig, SegmentationRepresentationConfig, SegmentationRepresentationData, Segmentation, ToolGroupSpecificRepresentationState, ToolGroupSpecificLabelmapRepresentation, ToolGroupSpecificRepresentation, SegmentationState } from './SegmentationStateTypes';
|
|
13
|
-
export type { Annotation, Annotations, FrameOfReferenceSpecificAnnotations, AnnotationState, PlanarBoundingBox, ToolProps, PublicToolProps, EventTypes, IPoints, IToolBinding, SetToolBindingsType, ToolOptionsType, InteractionTypes, IToolGroup, ToolHandle, AnnotationHandle, TextBoxHandle, Segmentation, SegmentationState, SegmentationRepresentationData, SegmentationRepresentationConfig, RepresentationConfig, ToolGroupSpecificRepresentationState, ToolGroupSpecificLabelmapRepresentation, ToolGroupSpecificRepresentation, Color, ColorLut, SVGCursorDescriptor, SVGPoint, };
|
|
14
|
+
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, ColorLut, SVGCursorDescriptor, SVGPoint, };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Types } from '@cornerstonejs/core';
|
|
2
|
+
export default function createLabelmapVolumeForViewport(input: {
|
|
3
|
+
viewportId: string;
|
|
4
|
+
renderingEngineId: string;
|
|
5
|
+
segmentationId?: string;
|
|
6
|
+
options?: {
|
|
7
|
+
volumeId?: string;
|
|
8
|
+
scalarData?: Float32Array | Uint8Array;
|
|
9
|
+
targetBuffer?: {
|
|
10
|
+
type: 'Float32Array' | 'Uint8Array';
|
|
11
|
+
};
|
|
12
|
+
metadata?: any;
|
|
13
|
+
dimensions?: Types.Point3;
|
|
14
|
+
spacing?: Types.Point3;
|
|
15
|
+
origin?: Types.Point3;
|
|
16
|
+
direction?: Float32Array;
|
|
17
|
+
};
|
|
18
|
+
}): Promise<string>;
|
|
@@ -11,15 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const lodash_clonedeep_1 = require("lodash.clonedeep");
|
|
13
13
|
const core_1 = require("@cornerstonejs/core");
|
|
14
|
-
|
|
15
|
-
function createNewSegmentationForToolGroup(toolGroupId, options) {
|
|
14
|
+
function createLabelmapVolumeForViewport(input) {
|
|
16
15
|
var _a;
|
|
17
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
throw new Error(`ToolGroup with Id ${toolGroupId} not found`);
|
|
21
|
-
}
|
|
22
|
-
const { viewportId, renderingEngineId } = toolGroup.viewportsInfo[0];
|
|
17
|
+
const { viewportId, renderingEngineId, options } = input;
|
|
18
|
+
let { segmentationId } = input;
|
|
23
19
|
const enabledElement = (0, core_1.getEnabledElementByIds)(viewportId, renderingEngineId);
|
|
24
20
|
if (!enabledElement) {
|
|
25
21
|
throw new Error('element disabled');
|
|
@@ -29,7 +25,9 @@ function createNewSegmentationForToolGroup(toolGroupId, options) {
|
|
|
29
25
|
throw new Error('Segmentation not ready for stackViewport');
|
|
30
26
|
}
|
|
31
27
|
const { uid } = viewport.getDefaultActor();
|
|
32
|
-
|
|
28
|
+
if (segmentationId === undefined) {
|
|
29
|
+
segmentationId = `${uid}-based-segmentation-${(_a = options === null || options === void 0 ? void 0 : options.volumeId) !== null && _a !== void 0 ? _a : core_1.utilities.uuidv4().slice(0, 8)}`;
|
|
30
|
+
}
|
|
33
31
|
if (options) {
|
|
34
32
|
const properties = (0, lodash_clonedeep_1._cloneDeep)(options);
|
|
35
33
|
yield core_1.volumeLoader.createLocalVolume(properties, segmentationId);
|
|
@@ -43,5 +41,5 @@ function createNewSegmentationForToolGroup(toolGroupId, options) {
|
|
|
43
41
|
return segmentationId;
|
|
44
42
|
});
|
|
45
43
|
}
|
|
46
|
-
exports.default =
|
|
47
|
-
//# sourceMappingURL=
|
|
44
|
+
exports.default = createLabelmapVolumeForViewport;
|
|
45
|
+
//# sourceMappingURL=createLabelmapVolumeForViewport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createLabelmapVolumeForViewport.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/createLabelmapVolumeForViewport.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uDAA6C;AAC7C,8CAK4B;AAc5B,SAA8B,+BAA+B,CAAC,KAgB7D;;;QACC,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,KAAK,CAAA;QACxD,IAAI,EAAE,cAAc,EAAE,GAAG,KAAK,CAAA;QAC9B,MAAM,cAAc,GAAG,IAAA,6BAAsB,EAAC,UAAU,EAAE,iBAAiB,CAAC,CAAA;QAE5E,IAAI,CAAC,cAAc,EAAE;YACnB,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAA;SACpC;QAED,MAAM,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAA;QACnC,IAAI,CAAC,CAAC,QAAQ,YAAY,qBAAc,CAAC,EAAE;YACzC,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;SAC5D;QAED,MAAM,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAA;QAE1C,IAAI,cAAc,KAAK,SAAS,EAAE;YAEhC,cAAc,GAAG,GAAG,GAAG,uBACrB,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,mCAAI,gBAAO,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAClD,EAAE,CAAA;SACH;QAED,IAAI,OAAO,EAAE;YAGX,MAAM,UAAU,GAAG,IAAA,6BAAU,EAAC,OAAO,CAAC,CAAA;YACtC,MAAM,mBAAY,CAAC,iBAAiB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAA;SACjE;aAAM;YAEL,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAA;YACpD,MAAM,mBAAY,CAAC,2BAA2B,CAAC,QAAQ,EAAE;gBACvD,QAAQ,EAAE,cAAc;aACzB,CAAC,CAAA;SACH;QAED,OAAO,cAAc,CAAA;;CACtB;AArDD,kDAqDC"}
|
|
@@ -3,4 +3,5 @@ import thresholdVolumeByRange from './thresholdVolumeByRange';
|
|
|
3
3
|
import createMergedLabelmapForIndex from './createMergedLabelmapForIndex';
|
|
4
4
|
import isValidRepresentationConfig from './isValidRepresentationConfig';
|
|
5
5
|
import getDefaultRepresentationConfig from './getDefaultRepresentationConfig';
|
|
6
|
-
|
|
6
|
+
import createLabelmapVolumeForViewport from './createLabelmapVolumeForViewport';
|
|
7
|
+
export { getBoundingBoxAroundShape, extend2DBoundingBoxInViewAxis, thresholdVolumeByRange, createMergedLabelmapForIndex, isValidRepresentationConfig, getDefaultRepresentationConfig, createLabelmapVolumeForViewport, };
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getDefaultRepresentationConfig = exports.isValidRepresentationConfig = exports.createMergedLabelmapForIndex = exports.thresholdVolumeByRange = exports.extend2DBoundingBoxInViewAxis = exports.getBoundingBoxAroundShape = void 0;
|
|
6
|
+
exports.createLabelmapVolumeForViewport = exports.getDefaultRepresentationConfig = exports.isValidRepresentationConfig = exports.createMergedLabelmapForIndex = exports.thresholdVolumeByRange = exports.extend2DBoundingBoxInViewAxis = exports.getBoundingBoxAroundShape = void 0;
|
|
7
7
|
const getBoundingBoxUtils_1 = require("./getBoundingBoxUtils");
|
|
8
8
|
Object.defineProperty(exports, "getBoundingBoxAroundShape", { enumerable: true, get: function () { return getBoundingBoxUtils_1.getBoundingBoxAroundShape; } });
|
|
9
9
|
Object.defineProperty(exports, "extend2DBoundingBoxInViewAxis", { enumerable: true, get: function () { return getBoundingBoxUtils_1.extend2DBoundingBoxInViewAxis; } });
|
|
@@ -15,4 +15,6 @@ const isValidRepresentationConfig_1 = __importDefault(require("./isValidRepresen
|
|
|
15
15
|
exports.isValidRepresentationConfig = isValidRepresentationConfig_1.default;
|
|
16
16
|
const getDefaultRepresentationConfig_1 = __importDefault(require("./getDefaultRepresentationConfig"));
|
|
17
17
|
exports.getDefaultRepresentationConfig = getDefaultRepresentationConfig_1.default;
|
|
18
|
+
const createLabelmapVolumeForViewport_1 = __importDefault(require("./createLabelmapVolumeForViewport"));
|
|
19
|
+
exports.createLabelmapVolumeForViewport = createLabelmapVolumeForViewport_1.default;
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/index.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/index.ts"],"names":[],"mappings":";;;;;;AAAA,+DAG8B;AAQ5B,0GAVA,+CAAyB,OAUA;AACzB,8GAVA,mDAA6B,OAUA;AAR/B,sFAA6D;AAS3D,iCATK,gCAAsB,CASL;AARxB,kGAAyE;AASvE,uCATK,sCAA4B,CASL;AAR9B,gGAAuE;AASrE,sCATK,qCAA2B,CASL;AAR7B,sGAA6E;AAS3E,yCATK,wCAA8B,CASL;AARhC,wGAA+E;AAS7E,0CATK,yCAA+B,CASL"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SegmentationRepresentationConfig, RepresentationPublicInput } from '../../types/SegmentationStateTypes';
|
|
2
|
-
declare function addSegmentationRepresentations(toolGroupId: string, representationInputArray: RepresentationPublicInput[], toolGroupSpecificRepresentationConfig?: SegmentationRepresentationConfig): Promise<
|
|
2
|
+
declare function addSegmentationRepresentations(toolGroupId: string, representationInputArray: RepresentationPublicInput[], toolGroupSpecificRepresentationConfig?: SegmentationRepresentationConfig): Promise<string[]>;
|
|
3
3
|
export default addSegmentationRepresentations;
|
|
@@ -9,15 +9,19 @@ async function addSegmentationRepresentations(toolGroupId, representationInputAr
|
|
|
9
9
|
const promises = representationInputArray.map((representationInput) => {
|
|
10
10
|
return _addSegmentationRepresentation(toolGroupId, representationInput, toolGroupSpecificRepresentationConfig);
|
|
11
11
|
});
|
|
12
|
-
await Promise.all(promises);
|
|
12
|
+
const segmentationRepresentationUIDs = await Promise.all(promises);
|
|
13
|
+
return segmentationRepresentationUIDs;
|
|
13
14
|
}
|
|
14
15
|
async function _addSegmentationRepresentation(toolGroupId, representationInput, toolGroupSpecificRepresentationConfig) {
|
|
16
|
+
let segmentationRepresentationUID;
|
|
15
17
|
if (representationInput.type === Representations.Labelmap) {
|
|
16
|
-
|
|
18
|
+
segmentationRepresentationUID =
|
|
19
|
+
await labelmapDisplay.addSegmentationRepresentation(toolGroupId, representationInput, toolGroupSpecificRepresentationConfig);
|
|
17
20
|
}
|
|
18
21
|
else {
|
|
19
22
|
throw new Error(`The representation type ${representationInput.type} is not supported`);
|
|
20
23
|
}
|
|
24
|
+
return segmentationRepresentationUID;
|
|
21
25
|
}
|
|
22
26
|
export default addSegmentationRepresentations;
|
|
23
27
|
//# sourceMappingURL=addSegmentationRepresentations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addSegmentationRepresentations.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/addSegmentationRepresentations.ts"],"names":[],"mappings":"AAKA,OAAO,eAAe,MAAM,yCAAyC,CAAA;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AAYnE,KAAK,UAAU,8BAA8B,CAC3C,WAAmB,EACnB,wBAAqD,EACrD,qCAAwE;IAGxE,MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,CAAA;IAE3C,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,wCAAwC,WAAW,EAAE,CAAC,CAAA;KACvE;IAED,MAAM,QAAQ,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC,mBAAmB,EAAE,EAAE;QACpE,OAAO,8BAA8B,CACnC,WAAW,EACX,mBAAmB,EACnB,qCAAqC,CACtC,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"addSegmentationRepresentations.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/addSegmentationRepresentations.ts"],"names":[],"mappings":"AAKA,OAAO,eAAe,MAAM,yCAAyC,CAAA;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AAYnE,KAAK,UAAU,8BAA8B,CAC3C,WAAmB,EACnB,wBAAqD,EACrD,qCAAwE;IAGxE,MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,CAAA;IAE3C,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,wCAAwC,WAAW,EAAE,CAAC,CAAA;KACvE;IAED,MAAM,QAAQ,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC,mBAAmB,EAAE,EAAE;QACpE,OAAO,8BAA8B,CACnC,WAAW,EACX,mBAAmB,EACnB,qCAAqC,CACtC,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,8BAA8B,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAElE,OAAO,8BAA8B,CAAA;AACvC,CAAC;AAED,KAAK,UAAU,8BAA8B,CAC3C,WAAmB,EACnB,mBAA8C,EAC9C,qCAAwE;IAExE,IAAI,6BAA6B,CAAA;IAEjC,IAAI,mBAAmB,CAAC,IAAI,KAAK,eAAe,CAAC,QAAQ,EAAE;QACzD,6BAA6B;YAC3B,MAAM,eAAe,CAAC,6BAA6B,CACjD,WAAW,EACX,mBAAmB,EACnB,qCAAqC,CACtC,CAAA;KACJ;SAAM;QACL,MAAM,IAAI,KAAK,CACb,2BAA2B,mBAAmB,CAAC,IAAI,mBAAmB,CACvE,CAAA;KACF;IAED,OAAO,6BAA6B,CAAA;AACtC,CAAC;AAED,eAAe,8BAA8B,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import removeSegmentationsFromToolGroup from './removeSegmentationsFromToolGroup';
|
|
2
|
-
import createNewSegmentationForToolGroup from './createNewSegmentationForToolGroup';
|
|
3
2
|
import addSegmentations from './addSegmentations';
|
|
4
3
|
import addSegmentationRepresentations from './addSegmentationRepresentations';
|
|
5
4
|
import * as activeSegmentation from './activeSegmentation';
|
|
@@ -10,4 +9,4 @@ import * as state from './segmentationState';
|
|
|
10
9
|
import * as segmentationVisibility from './segmentationVisibility';
|
|
11
10
|
import * as segmentIndex from './segmentIndex';
|
|
12
11
|
import * as triggerSegmentationEvents from './triggerSegmentationEvents';
|
|
13
|
-
export { state, addSegmentations, activeSegmentation, addSegmentationRepresentations, removeSegmentationsFromToolGroup,
|
|
12
|
+
export { state, addSegmentations, activeSegmentation, addSegmentationRepresentations, removeSegmentationsFromToolGroup, segmentLocking, segmentationColor, segmentationConfig, segmentationVisibility, segmentIndex, triggerSegmentationEvents, };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import removeSegmentationsFromToolGroup from './removeSegmentationsFromToolGroup';
|
|
2
|
-
import createNewSegmentationForToolGroup from './createNewSegmentationForToolGroup';
|
|
3
2
|
import addSegmentations from './addSegmentations';
|
|
4
3
|
import addSegmentationRepresentations from './addSegmentationRepresentations';
|
|
5
4
|
import * as activeSegmentation from './activeSegmentation';
|
|
@@ -10,5 +9,5 @@ import * as state from './segmentationState';
|
|
|
10
9
|
import * as segmentationVisibility from './segmentationVisibility';
|
|
11
10
|
import * as segmentIndex from './segmentIndex';
|
|
12
11
|
import * as triggerSegmentationEvents from './triggerSegmentationEvents';
|
|
13
|
-
export { state, addSegmentations, activeSegmentation, addSegmentationRepresentations, removeSegmentationsFromToolGroup,
|
|
12
|
+
export { state, addSegmentations, activeSegmentation, addSegmentationRepresentations, removeSegmentationsFromToolGroup, segmentLocking, segmentationColor, segmentationConfig, segmentationVisibility, segmentIndex, triggerSegmentationEvents, };
|
|
14
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,MAAM,oCAAoC,CAAA;AACjF,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,MAAM,oCAAoC,CAAA;AACjF,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,8BAA8B,MAAM,kCAAkC,CAAA;AAE7E,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,iBAAiB,MAAM,qBAAqB,CAAA;AACxD,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAA;AAC5C,OAAO,KAAK,sBAAsB,MAAM,0BAA0B,CAAA;AAClE,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,yBAAyB,MAAM,6BAA6B,CAAA;AAExE,OAAO,EACL,KAAK,EACL,gBAAgB,EAChB,kBAAkB,EAClB,8BAA8B,EAC9B,gCAAgC,EAChC,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EACZ,yBAAyB,GAC1B,CAAA"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
declare function
|
|
3
|
-
|
|
4
|
-
declare function getActiveSegmentIndexForSegmentation(segmentationId: string): number | undefined;
|
|
5
|
-
export { getActiveSegmentIndex, setActiveSegmentIndex, getActiveSegmentIndexForSegmentation, setActiveSegmentIndexForSegmentation, };
|
|
1
|
+
declare function setActiveSegmentIndex(segmentationId: string, segmentIndex: number): void;
|
|
2
|
+
declare function getActiveSegmentIndex(segmentationId: string): number | undefined;
|
|
3
|
+
export { getActiveSegmentIndex, setActiveSegmentIndex };
|
|
@@ -1,41 +1,17 @@
|
|
|
1
|
-
import { getActiveSegmentationRepresentation } from './activeSegmentation';
|
|
2
1
|
import { getSegmentation } from './segmentationState';
|
|
3
2
|
import { triggerSegmentationModified } from './triggerSegmentationEvents';
|
|
4
|
-
function
|
|
5
|
-
const segmentationRepresentation = getActiveSegmentationRepresentation(toolGroupId);
|
|
6
|
-
if (!segmentationRepresentation) {
|
|
7
|
-
throw new Error('toolGroup does not contain an active segmentation');
|
|
8
|
-
}
|
|
9
|
-
const { segmentationId } = segmentationRepresentation;
|
|
10
|
-
const segmentation = getSegmentation(segmentationId);
|
|
11
|
-
if (segmentation) {
|
|
12
|
-
return segmentation.activeSegmentIndex;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function setActiveSegmentIndex(toolGroupId, segmentIndex) {
|
|
16
|
-
const segmentationRepresentation = getActiveSegmentationRepresentation(toolGroupId);
|
|
17
|
-
if (!segmentationRepresentation) {
|
|
18
|
-
throw new Error('element does not contain an active segmentation');
|
|
19
|
-
}
|
|
20
|
-
const { segmentationId } = segmentationRepresentation;
|
|
21
|
-
const segmentation = getSegmentation(segmentationId);
|
|
22
|
-
if (segmentation?.activeSegmentIndex !== segmentIndex) {
|
|
23
|
-
segmentation.activeSegmentIndex = segmentIndex;
|
|
24
|
-
triggerSegmentationModified(segmentationId);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function setActiveSegmentIndexForSegmentation(segmentationId, segmentIndex) {
|
|
3
|
+
function setActiveSegmentIndex(segmentationId, segmentIndex) {
|
|
28
4
|
const segmentation = getSegmentation(segmentationId);
|
|
29
5
|
if (segmentation?.activeSegmentIndex !== segmentIndex) {
|
|
30
6
|
segmentation.activeSegmentIndex = segmentIndex;
|
|
31
7
|
triggerSegmentationModified(segmentationId);
|
|
32
8
|
}
|
|
33
9
|
}
|
|
34
|
-
function
|
|
10
|
+
function getActiveSegmentIndex(segmentationId) {
|
|
35
11
|
const segmentation = getSegmentation(segmentationId);
|
|
36
12
|
if (segmentation) {
|
|
37
13
|
return segmentation.activeSegmentIndex;
|
|
38
14
|
}
|
|
39
15
|
}
|
|
40
|
-
export { getActiveSegmentIndex, setActiveSegmentIndex
|
|
16
|
+
export { getActiveSegmentIndex, setActiveSegmentIndex };
|
|
41
17
|
//# sourceMappingURL=segmentIndex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmentIndex.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/segmentIndex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"segmentIndex.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/segmentIndex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AAUzE,SAAS,qBAAqB,CAC5B,cAAsB,EACtB,YAAoB;IAEpB,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAA;IAEpD,IAAI,YAAY,EAAE,kBAAkB,KAAK,YAAY,EAAE;QACrD,YAAY,CAAC,kBAAkB,GAAG,YAAY,CAAA;QAE9C,2BAA2B,CAAC,cAAc,CAAC,CAAA;KAC5C;AACH,CAAC;AAOD,SAAS,qBAAqB,CAAC,cAAsB;IACnD,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAA;IAEpD,IAAI,YAAY,EAAE;QAChB,OAAO,YAAY,CAAC,kBAAkB,CAAA;KACvC;AACH,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
declare function getSegmentIndexLocked(
|
|
2
|
-
declare function setSegmentIndexLocked(
|
|
3
|
-
declare function
|
|
4
|
-
|
|
5
|
-
declare function getSegmentsLockedForSegmentation(segmentationId: string): number[] | [];
|
|
6
|
-
export { getSegmentIndexLocked, setSegmentIndexLocked, getSegmentIndexLockedForSegmentation, setSegmentIndexLockedForSegmentation, getSegmentsLockedForSegmentation, };
|
|
1
|
+
declare function getSegmentIndexLocked(segmentationId: string, segmentIndex: number): boolean;
|
|
2
|
+
declare function setSegmentIndexLocked(segmentationId: string, segmentIndex: number, locked?: boolean): void;
|
|
3
|
+
declare function getLockedSegments(segmentationId: string): number[] | [];
|
|
4
|
+
export { getSegmentIndexLocked, setSegmentIndexLocked, getLockedSegments };
|
|
@@ -1,33 +1,6 @@
|
|
|
1
|
-
import { getActiveSegmentationRepresentation } from './activeSegmentation';
|
|
2
1
|
import { getSegmentation } from '../../stateManagement/segmentation/segmentationState';
|
|
3
2
|
import { triggerSegmentationModified } from './triggerSegmentationEvents';
|
|
4
|
-
function getSegmentIndexLocked(
|
|
5
|
-
const activeSegmentationRepresentation = getActiveSegmentationRepresentation(toolGroupId);
|
|
6
|
-
if (!activeSegmentationRepresentation) {
|
|
7
|
-
throw new Error('element does not contain an active segmentation');
|
|
8
|
-
}
|
|
9
|
-
const { segmentationId } = activeSegmentationRepresentation;
|
|
10
|
-
const segmentationGlobalState = getSegmentation(segmentationId);
|
|
11
|
-
const lockedSegments = segmentationGlobalState.segmentsLocked;
|
|
12
|
-
return lockedSegments.has(segmentIndex);
|
|
13
|
-
}
|
|
14
|
-
function setSegmentIndexLocked(toolGroupId, segmentIndex, locked = true) {
|
|
15
|
-
const activeSegmentationRepresentation = getActiveSegmentationRepresentation(toolGroupId);
|
|
16
|
-
if (!activeSegmentationRepresentation) {
|
|
17
|
-
throw new Error('element does not contain an active segmentation');
|
|
18
|
-
}
|
|
19
|
-
const { segmentationId } = activeSegmentationRepresentation;
|
|
20
|
-
const segmentation = getSegmentation(segmentationId);
|
|
21
|
-
const { segmentsLocked } = segmentation;
|
|
22
|
-
if (locked) {
|
|
23
|
-
segmentsLocked.add(segmentIndex);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
segmentsLocked.delete(segmentIndex);
|
|
27
|
-
}
|
|
28
|
-
triggerSegmentationModified(segmentationId);
|
|
29
|
-
}
|
|
30
|
-
function getSegmentIndexLockedForSegmentation(segmentationId, segmentIndex) {
|
|
3
|
+
function getSegmentIndexLocked(segmentationId, segmentIndex) {
|
|
31
4
|
const segmentation = getSegmentation(segmentationId);
|
|
32
5
|
if (!segmentation) {
|
|
33
6
|
throw new Error(`No segmentation state found for ${segmentationId}`);
|
|
@@ -35,7 +8,7 @@ function getSegmentIndexLockedForSegmentation(segmentationId, segmentIndex) {
|
|
|
35
8
|
const { segmentsLocked } = segmentation;
|
|
36
9
|
return segmentsLocked.has(segmentIndex);
|
|
37
10
|
}
|
|
38
|
-
function
|
|
11
|
+
function setSegmentIndexLocked(segmentationId, segmentIndex, locked = true) {
|
|
39
12
|
const segmentation = getSegmentation(segmentationId);
|
|
40
13
|
if (!segmentation) {
|
|
41
14
|
throw new Error(`No segmentation state found for ${segmentationId}`);
|
|
@@ -49,7 +22,7 @@ function setSegmentIndexLockedForSegmentation(segmentationId, segmentIndex, lock
|
|
|
49
22
|
}
|
|
50
23
|
triggerSegmentationModified(segmentationId);
|
|
51
24
|
}
|
|
52
|
-
function
|
|
25
|
+
function getLockedSegments(segmentationId) {
|
|
53
26
|
const segmentation = getSegmentation(segmentationId);
|
|
54
27
|
if (!segmentation) {
|
|
55
28
|
throw new Error(`No segmentation state found for ${segmentationId}`);
|
|
@@ -57,5 +30,5 @@ function getSegmentsLockedForSegmentation(segmentationId) {
|
|
|
57
30
|
const { segmentsLocked } = segmentation;
|
|
58
31
|
return Array.from(segmentsLocked);
|
|
59
32
|
}
|
|
60
|
-
export { getSegmentIndexLocked, setSegmentIndexLocked,
|
|
33
|
+
export { getSegmentIndexLocked, setSegmentIndexLocked, getLockedSegments };
|
|
61
34
|
//# sourceMappingURL=segmentLocking.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmentLocking.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/segmentLocking.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"segmentLocking.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/segmentLocking.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,sDAAsD,CAAA;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AASzE,SAAS,qBAAqB,CAC5B,cAAsB,EACtB,YAAoB;IAEpB,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAA;IAEpD,IAAI,CAAC,YAAY,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,mCAAmC,cAAc,EAAE,CAAC,CAAA;KACrE;IAED,MAAM,EAAE,cAAc,EAAE,GAAG,YAAY,CAAA;IACvC,OAAO,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;AACzC,CAAC;AAQD,SAAS,qBAAqB,CAC5B,cAAsB,EACtB,YAAoB,EACpB,MAAM,GAAG,IAAI;IAEb,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAA;IAEpD,IAAI,CAAC,YAAY,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,mCAAmC,cAAc,EAAE,CAAC,CAAA;KACrE;IAED,MAAM,EAAE,cAAc,EAAE,GAAG,YAAY,CAAA;IAEvC,IAAI,MAAM,EAAE;QACV,cAAc,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;KACjC;SAAM;QACL,cAAc,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;KACpC;IAED,2BAA2B,CAAC,cAAc,CAAC,CAAA;AAC7C,CAAC;AAQD,SAAS,iBAAiB,CAAC,cAAsB;IAC/C,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAA;IAEpD,IAAI,CAAC,YAAY,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,mCAAmC,cAAc,EAAE,CAAC,CAAA;KACrE;IAED,MAAM,EAAE,cAAc,EAAE,GAAG,YAAY,CAAA;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;AACnC,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -71,15 +71,6 @@ function setGlobalConfig(config, suppressEvents) {
|
|
|
71
71
|
triggerSegmentationModified();
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
function getActiveSegmentationRepresentation(toolGroupId) {
|
|
75
|
-
const segmentationStateManager = getDefaultSegmentationStateManager();
|
|
76
|
-
const toolGroupSegmentationRepresentations = segmentationStateManager.getSegmentationRepresentations(toolGroupId);
|
|
77
|
-
if (toolGroupSegmentationRepresentations.length === 0) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const activeRepresentation = toolGroupSegmentationRepresentations.find((representation) => representation.active);
|
|
81
|
-
return activeRepresentation;
|
|
82
|
-
}
|
|
83
74
|
function getSegmentationRepresentationByUID(toolGroupId, segmentationRepresentationUID) {
|
|
84
75
|
const segmentationStateManager = getDefaultSegmentationStateManager();
|
|
85
76
|
return segmentationStateManager.getSegmentationRepresentationByUID(toolGroupId, segmentationRepresentationUID);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmentationState.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/segmentationState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAA;AAC5E,OAAO,EACL,yCAAyC,EACzC,2BAA2B,EAC3B,wCAAwC,GACzC,MAAM,6BAA6B,CAAA;AAUpC,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA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EAAE,CAAA;IACrE,wBAAwB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;IAEhD,IAAI,CAAC,cAAc,EAAE;QACnB,2BAA2B,EAAE,CAAA;KAC9B;AACH,CAAC;AAWD,SAAS,
|
|
1
|
+
{"version":3,"file":"segmentationState.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/segmentationState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAA;AAC5E,OAAO,EACL,yCAAyC,EACzC,2BAA2B,EAC3B,wCAAwC,GACzC,MAAM,6BAA6B,CAAA;AAUpC,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAA;AAC7E,OAAO,0BAA0B,MAAM,sCAAsC,CAAA;AAK7E,SAAS,kCAAkC;IACzC,OAAO,+BAA+B,CAAA;AACxC,CAAC;AAaD,SAAS,eAAe,CAAC,cAAsB;IAC7C,MAAM,wBAAwB,GAAG,kCAAkC,EAAE,CAAA;IACrE,OAAO,wBAAwB,CAAC,eAAe,CAAC,cAAc,CAAC,CAAA;AACjE,CAAC;AAMD,SAAS,gBAAgB;IACvB,MAAM,wBAAwB,GAAG,kCAAkC,EAAE,CAAA;IACrE,MAAM,KAAK,GAAG,wBAAwB,CAAC,QAAQ,EAAE,CAAA;IAEjD,OAAO,KAAK,CAAC,aAAa,CAAA;AAC5B,CAAC;AAOD,SAAS,eAAe,CACtB,iBAA0C,EAC1C,cAAwB;IAExB,MAAM,wBAAwB,GAAG,kCAAkC,EAAE,CAAA;IAErE,MAAM,YAAY,GAAG,0BAA0B,CAAC,iBAAiB,CAAC,CAAA;IAClE,wBAAwB,CAAC,YAAY,CAAC,CAAA;IAEtC,wBAAwB,CAAC,eAAe,CAAC,YAAY,CAAC,CAAA;IAEtD,IAAI,CAAC,cAAc,EAAE;QACnB,2BAA2B,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;KACzD;AACH,CAAC;AAQD,SAAS,8BAA8B,CACrC,W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CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;AAEvD,CAAC;AAED,SAAS,wBAAwB,CAAC,YAA0B;IAC1D,MAAM,cAAc,GAAG,IAAI,CAAA;IAC3B,MAAM,aAAa,GAAG,8BAA8B,CAAC,YAAY,CAAC,CAAA;IAElE,MAAM,eAAe,GAAqC;QACxD,2BAA2B,EAAE,IAAI;QACjC,eAAe,EAAE;YACf,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,aAAa;SACnC;KACF,CAAA;IACD,eAAe,CAAC,eAAe,EAAE,cAAc,CAAC,CAAA;AAClD,CAAC;AAED,OAAO,EAEL,kCAAkC,EAElC,eAAe,EACf,gBAAgB,EAChB,eAAe,EAEf,8BAA8B,EAC9B,6BAA6B,EAC7B,gCAAgC,EAEhC,0BAA0B,EAC1B,0BAA0B,EAC1B,eAAe,EACf,eAAe,EAEf,6BAA6B,EAC7B,kCAAkC,EAElC,WAAW,EACX,WAAW,GACZ,CAAA"}
|
|
@@ -1,32 +1,8 @@
|
|
|
1
1
|
import type { Types } from '@cornerstonejs/core';
|
|
2
2
|
import { AnnotationTool } from '../base';
|
|
3
|
-
import {
|
|
3
|
+
import { EventTypes, ToolHandle, PublicToolProps, ToolProps, InteractionTypes } from '../../types';
|
|
4
|
+
import { BidirectionalAnnotation } from '../../types/ToolSpecificAnnotationTypes';
|
|
4
5
|
import { MouseDragEventType, MouseMoveEventType } from '../../types/EventTypes';
|
|
5
|
-
interface BidirectionalAnnotation extends Annotation {
|
|
6
|
-
data: {
|
|
7
|
-
handles: {
|
|
8
|
-
points: Types.Point3[];
|
|
9
|
-
activeHandleIndex: number | null;
|
|
10
|
-
textBox: {
|
|
11
|
-
hasMoved: boolean;
|
|
12
|
-
worldPosition: Types.Point3;
|
|
13
|
-
worldBoundingBox: {
|
|
14
|
-
topLeft: Types.Point3;
|
|
15
|
-
topRight: Types.Point3;
|
|
16
|
-
bottomLeft: Types.Point3;
|
|
17
|
-
bottomRight: Types.Point3;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
label: string;
|
|
22
|
-
cachedStats: {
|
|
23
|
-
[targetId: string]: {
|
|
24
|
-
length: number;
|
|
25
|
-
width: number;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
6
|
export default class BidirectionalTool extends AnnotationTool {
|
|
31
7
|
static toolName: string;
|
|
32
8
|
touchDragCallback: any;
|
|
@@ -64,4 +40,3 @@ export default class BidirectionalTool extends AnnotationTool {
|
|
|
64
40
|
_calculateCachedStats: (annotation: any, renderingEngine: any, enabledElement: any) => any;
|
|
65
41
|
_isInsideVolume: (index1: any, index2: any, index3: any, index4: any, dimensions: any) => boolean;
|
|
66
42
|
}
|
|
67
|
-
export {};
|