@cornerstonejs/tools 3.30.2 → 3.31.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/esm/tools/segmentation/LabelmapBaseTool.d.ts +2 -0
- package/dist/esm/tools/segmentation/LabelmapBaseTool.js +11 -0
- package/dist/esm/tools/segmentation/strategies/BrushStrategy.d.ts +1 -0
- package/dist/esm/tools/segmentation/strategies/compositions/preview.js +2 -0
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +3 -3
|
@@ -68,6 +68,8 @@ export default class LabelmapBaseTool extends BaseTool {
|
|
|
68
68
|
constructor(toolProps: any, defaultToolProps: any);
|
|
69
69
|
protected _historyRedoHandler(evt: any): void;
|
|
70
70
|
protected get _previewData(): PreviewData;
|
|
71
|
+
hasPreviewData(): boolean;
|
|
72
|
+
shouldResolvePreviewRequests(): boolean;
|
|
71
73
|
createMemo(segmentationId: string, segmentationVoxelManager: any): LabelmapMemo.LabelmapMemo;
|
|
72
74
|
protected createEditData(element: any): EditDataReturnType;
|
|
73
75
|
protected getEditData({ viewport, representationData, segmentsLocked, segmentationId, }: {
|
|
@@ -54,6 +54,13 @@ export default class LabelmapBaseTool extends BaseTool {
|
|
|
54
54
|
get _previewData() {
|
|
55
55
|
return LabelmapBaseTool.previewData;
|
|
56
56
|
}
|
|
57
|
+
hasPreviewData() {
|
|
58
|
+
return !!this._previewData.preview;
|
|
59
|
+
}
|
|
60
|
+
shouldResolvePreviewRequests() {
|
|
61
|
+
return ((this.mode === 'Active' || this.mode === 'Enabled') &&
|
|
62
|
+
this.hasPreviewData());
|
|
63
|
+
}
|
|
57
64
|
createMemo(segmentationId, segmentationVoxelManager) {
|
|
58
65
|
const voxelManagerId = segmentationVoxelManager.id;
|
|
59
66
|
if (this.memo &&
|
|
@@ -229,6 +236,10 @@ export default class LabelmapBaseTool extends BaseTool {
|
|
|
229
236
|
const enabledElement = getEnabledElement(element);
|
|
230
237
|
const results = this.applyActiveStrategyCallback(enabledElement, this.getOperationData(element), StrategyCallbacks.AddPreview);
|
|
231
238
|
_previewData.isDrag = true;
|
|
239
|
+
if (results?.modified) {
|
|
240
|
+
_previewData.preview = results;
|
|
241
|
+
_previewData.element = element;
|
|
242
|
+
}
|
|
232
243
|
return results;
|
|
233
244
|
}
|
|
234
245
|
rejectPreview(element = this._previewData.element) {
|
|
@@ -37,6 +37,7 @@ export type InitializedOperationData = LabelmapToolOperationDataAny & {
|
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
memo?: LabelmapMemo;
|
|
40
|
+
modified?: boolean;
|
|
40
41
|
};
|
|
41
42
|
export type StrategyFunction = (operationData: InitializedOperationData, ...args: any[]) => unknown;
|
|
42
43
|
export type CompositionInstance = {
|
|
@@ -18,6 +18,7 @@ export default {
|
|
|
18
18
|
},
|
|
19
19
|
[StrategyCallbacks.Initialize]: (operationData) => {
|
|
20
20
|
const { segmentIndex, previewColor, previewSegmentIndex } = operationData;
|
|
21
|
+
operationData.modified = false;
|
|
21
22
|
if (previewSegmentIndex == null || segmentIndex == null) {
|
|
22
23
|
return;
|
|
23
24
|
}
|
|
@@ -25,6 +26,7 @@ export default {
|
|
|
25
26
|
viewportIds?.forEach((viewportId) => {
|
|
26
27
|
setSegmentIndexColor(viewportId, operationData.segmentationId, previewSegmentIndex, previewColor);
|
|
27
28
|
});
|
|
29
|
+
operationData.modified = true;
|
|
28
30
|
},
|
|
29
31
|
[StrategyCallbacks.AcceptPreview]: (operationData) => {
|
|
30
32
|
const { previewSegmentIndex, segmentationVoxelManager, memo, segmentIndex, centerSegmentIndexInfo, } = operationData || {};
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "3.
|
|
1
|
+
export declare const version = "3.31.0";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '3.
|
|
1
|
+
export const version = '3.31.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.31.0",
|
|
4
4
|
"description": "Cornerstone3D Tools",
|
|
5
5
|
"types": "./dist/esm/index.d.ts",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"canvas": "^3.1.0"
|
|
109
109
|
},
|
|
110
110
|
"peerDependencies": {
|
|
111
|
-
"@cornerstonejs/core": "^3.
|
|
111
|
+
"@cornerstonejs/core": "^3.31.0",
|
|
112
112
|
"@kitware/vtk.js": "32.12.1",
|
|
113
113
|
"@types/d3-array": "^3.0.4",
|
|
114
114
|
"@types/d3-interpolate": "^3.0.1",
|
|
@@ -127,5 +127,5 @@
|
|
|
127
127
|
"type": "individual",
|
|
128
128
|
"url": "https://ohif.org/donate"
|
|
129
129
|
},
|
|
130
|
-
"gitHead": "
|
|
130
|
+
"gitHead": "ea3e44970a9e535db1f38c8186653ffb7376ecf9"
|
|
131
131
|
}
|