@cornerstonejs/tools 3.33.4 → 3.33.5
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/CircleROIStartEndThresholdTool.js +30 -16
- package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.js +9 -3
- package/dist/esm/types/AnnotationTypes.d.ts +1 -0
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +3 -3
|
@@ -140,7 +140,8 @@ class CircleROIStartEndThresholdTool extends CircleROITool {
|
|
|
140
140
|
this._deactivateModify(element);
|
|
141
141
|
this._deactivateDraw(element);
|
|
142
142
|
resetElementCursor(element);
|
|
143
|
-
const
|
|
143
|
+
const { metadata } = annotation;
|
|
144
|
+
const { enabledElement } = metadata;
|
|
144
145
|
this.editData = null;
|
|
145
146
|
this.isDrawing = false;
|
|
146
147
|
if (this.isHandleOutsideImage &&
|
|
@@ -176,6 +177,7 @@ class CircleROIStartEndThresholdTool extends CircleROITool {
|
|
|
176
177
|
const { annotationUID, data, metadata } = annotation;
|
|
177
178
|
const { startCoordinate, endCoordinate } = data;
|
|
178
179
|
const { points, activeHandleIndex } = data.handles;
|
|
180
|
+
const { enabledElement: annotationEnabledElement } = metadata;
|
|
179
181
|
styleSpecifier.annotationUID = annotationUID;
|
|
180
182
|
const lineWidth = this.getStyle('lineWidth', styleSpecifier, annotation);
|
|
181
183
|
const lineDash = this.getStyle('lineDash', styleSpecifier, annotation);
|
|
@@ -219,8 +221,12 @@ class CircleROIStartEndThresholdTool extends CircleROITool {
|
|
|
219
221
|
isMiddleSlice = true;
|
|
220
222
|
}
|
|
221
223
|
data.handles.points[0][this._getIndexOfCoordinatesForViewplaneNormal(viewplaneNormal)] = middleCoordinate;
|
|
222
|
-
|
|
223
|
-
|
|
224
|
+
const iteratorVolumeIDs = annotationEnabledElement.viewport?.volumeIds.values();
|
|
225
|
+
for (const volumeId of iteratorVolumeIDs) {
|
|
226
|
+
if (annotation.invalidated &&
|
|
227
|
+
annotation.metadata.volumeId === volumeId) {
|
|
228
|
+
this._throttledCalculateCachedStats(annotation, annotationEnabledElement);
|
|
229
|
+
}
|
|
224
230
|
}
|
|
225
231
|
if (!viewport.getRenderingEngine()) {
|
|
226
232
|
console.warn('Rendering Engine has been destroyed');
|
|
@@ -323,24 +329,32 @@ class CircleROIStartEndThresholdTool extends CircleROITool {
|
|
|
323
329
|
const { viewPlaneNormal, spacingInNormal } = metadata;
|
|
324
330
|
const { startCoordinate, endCoordinate } = data;
|
|
325
331
|
const { points } = data.handles;
|
|
326
|
-
const
|
|
332
|
+
const projectionAxisIndex = this._getIndexOfCoordinatesForViewplaneNormal(viewPlaneNormal);
|
|
327
333
|
const startWorld = vec3.clone(points[0]);
|
|
334
|
+
startWorld[projectionAxisIndex] = startCoordinate;
|
|
328
335
|
const endWorld = vec3.clone(points[0]);
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
endWorld
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
endWorld[projectionAxisIndex] = endCoordinate;
|
|
337
|
+
const direction = vec3.create();
|
|
338
|
+
vec3.subtract(direction, endWorld, startWorld);
|
|
339
|
+
const distance = vec3.length(direction);
|
|
340
|
+
if (distance === 0) {
|
|
341
|
+
const handlesOnStartPlane = points.map(p => {
|
|
342
|
+
const newPoint = vec3.clone(p);
|
|
343
|
+
newPoint[projectionAxisIndex] = startCoordinate;
|
|
344
|
+
return Array.from(newPoint);
|
|
345
|
+
});
|
|
346
|
+
data.cachedStats.projectionPoints = [handlesOnStartPlane];
|
|
347
|
+
return;
|
|
339
348
|
}
|
|
340
|
-
|
|
349
|
+
vec3.normalize(direction, direction);
|
|
350
|
+
const handlesToStart = csUtils.deepClone(points);
|
|
351
|
+
handlesToStart[0][projectionAxisIndex] = startCoordinate;
|
|
352
|
+
handlesToStart[1][projectionAxisIndex] = startCoordinate;
|
|
353
|
+
const newProjectionPoints = [];
|
|
354
|
+
for (let dist = 0; dist <= distance + 1e-6; dist += spacingInNormal) {
|
|
341
355
|
newProjectionPoints.push(handlesToStart.map((point) => {
|
|
342
356
|
const newPoint = vec3.create();
|
|
343
|
-
vec3.scaleAndAdd(newPoint, point,
|
|
357
|
+
vec3.scaleAndAdd(newPoint, point, direction, dist);
|
|
344
358
|
return Array.from(newPoint);
|
|
345
359
|
}));
|
|
346
360
|
}
|
|
@@ -128,7 +128,8 @@ class RectangleROIStartEndThresholdTool extends RectangleROITool {
|
|
|
128
128
|
this._deactivateModify(element);
|
|
129
129
|
this._deactivateDraw(element);
|
|
130
130
|
resetElementCursor(element);
|
|
131
|
-
const
|
|
131
|
+
const { metadata } = annotation;
|
|
132
|
+
const { enabledElement } = metadata;
|
|
132
133
|
this.editData = null;
|
|
133
134
|
this.isDrawing = false;
|
|
134
135
|
if (this.isHandleOutsideImage &&
|
|
@@ -164,6 +165,7 @@ class RectangleROIStartEndThresholdTool extends RectangleROITool {
|
|
|
164
165
|
const { annotationUID, data, metadata } = annotation;
|
|
165
166
|
const { startCoordinate, endCoordinate } = data;
|
|
166
167
|
const { points, activeHandleIndex } = data.handles;
|
|
168
|
+
const { enabledElement: annotationEnabledElement } = metadata;
|
|
167
169
|
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
|
|
168
170
|
styleSpecifier.annotationUID = annotationUID;
|
|
169
171
|
const lineWidth = this.getStyle('lineWidth', styleSpecifier, annotation);
|
|
@@ -194,8 +196,12 @@ class RectangleROIStartEndThresholdTool extends RectangleROITool {
|
|
|
194
196
|
roundedCoord > Math.max(roundedStartCoord, roundedEndCoord)) {
|
|
195
197
|
continue;
|
|
196
198
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
+
const iteratorVolumeIDs = annotationEnabledElement.viewport?.volumeIds.values();
|
|
200
|
+
for (const volumeId of iteratorVolumeIDs) {
|
|
201
|
+
if (annotation.invalidated &&
|
|
202
|
+
annotation.metadata.volumeId === volumeId) {
|
|
203
|
+
this._throttledCalculateCachedStats(annotation, annotationEnabledElement);
|
|
204
|
+
}
|
|
199
205
|
}
|
|
200
206
|
let firstOrLastSlice = false;
|
|
201
207
|
if (roundedCoord === roundedStartCoord ||
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "3.33.
|
|
1
|
+
export declare const version = "3.33.5";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '3.33.
|
|
1
|
+
export const version = '3.33.5';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/tools",
|
|
3
|
-
"version": "3.33.
|
|
3
|
+
"version": "3.33.5",
|
|
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.33.
|
|
111
|
+
"@cornerstonejs/core": "^3.33.5",
|
|
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": "2b17e979df54cdc1fd91df95141feaa273a29de7"
|
|
131
131
|
}
|