@cornerstonejs/tools 5.8.2 → 5.10.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/esm/config.js +3 -1
- package/dist/esm/cursors/setCursorForElement.js +3 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownActivate.js +3 -1
- package/dist/esm/eventDispatchers/touchEventHandlers/touchStartActivate.js +3 -1
- package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js +3 -1
- package/dist/esm/stateManagement/annotation/AnnotationRenderingEngine.js +3 -1
- package/dist/esm/stateManagement/segmentation/SegmentationRenderingEngine.js +4 -2
- package/dist/esm/stateManagement/segmentation/SegmentationStateManager.js +9 -3
- package/dist/esm/stateManagement/segmentation/addColorLUT.js +3 -1
- package/dist/esm/stateManagement/segmentation/config/segmentationColor.js +3 -1
- package/dist/esm/stateManagement/segmentation/helpers/normalizeSegmentationInput.js +2 -0
- package/dist/esm/stateManagement/segmentation/internalAddRepresentationData.js +3 -1
- package/dist/esm/stateManagement/segmentation/internalAddSegmentationRepresentation.js +3 -1
- package/dist/esm/stateManagement/segmentation/removeSegmentationRepresentations.js +3 -1
- package/dist/esm/stateManagement/segmentation/segmentIndex.js +3 -1
- package/dist/esm/stateManagement/segmentation/utilities/convertContourHoles.js +9 -7
- package/dist/esm/stateManagement/segmentation/utilities/decimateContours.js +6 -4
- package/dist/esm/stateManagement/segmentation/utilities/getPolylineMap.js +3 -1
- package/dist/esm/stateManagement/segmentation/utilities/removeContourHoles.js +5 -3
- package/dist/esm/stateManagement/segmentation/utilities/removeContourIslands.js +5 -3
- package/dist/esm/stateManagement/segmentation/utilities/smoothContours.js +6 -4
- package/dist/esm/store/SynchronizerManager/Synchronizer.js +4 -2
- package/dist/esm/store/ToolGroupManager/ToolGroup.js +17 -15
- package/dist/esm/store/ToolGroupManager/createToolGroup.js +3 -1
- package/dist/esm/store/filterToolsWithAnnotationsForElement.js +3 -1
- package/dist/esm/tools/AdvancedMagnifyTool.js +3 -1
- package/dist/esm/tools/CrosshairsTool.js +4 -2
- package/dist/esm/tools/MIPJumpToClickTool.js +3 -1
- package/dist/esm/tools/OrientationControllerTool.js +6 -4
- package/dist/esm/tools/OverlayGridTool.js +5 -3
- package/dist/esm/tools/ReferenceCursors.js +3 -1
- package/dist/esm/tools/ReferenceLinesTool.js +3 -1
- package/dist/esm/tools/SculptorTool.js +7 -5
- package/dist/esm/tools/SegmentationIntersectionTool.js +3 -1
- package/dist/esm/tools/VolumeCroppingControlTool.js +5 -3
- package/dist/esm/tools/VolumeCroppingTool.js +5 -3
- package/dist/esm/tools/WindowLevelRegionTool.js +3 -1
- package/dist/esm/tools/annotation/AngleTool.js +3 -1
- package/dist/esm/tools/annotation/ArrowAnnotateTool.js +3 -1
- package/dist/esm/tools/annotation/BidirectionalTool.js +3 -1
- package/dist/esm/tools/annotation/CircleROITool.js +30 -33
- package/dist/esm/tools/annotation/CobbAngleTool.js +3 -1
- package/dist/esm/tools/annotation/DragProbeTool.js +3 -1
- package/dist/esm/tools/annotation/ETDRSGridTool.js +3 -1
- package/dist/esm/tools/annotation/EllipticalROITool.js +35 -38
- package/dist/esm/tools/annotation/HeightTool.js +3 -1
- package/dist/esm/tools/annotation/KeyImageTool.js +3 -1
- package/dist/esm/tools/annotation/LabelTool.js +3 -1
- package/dist/esm/tools/annotation/LengthTool.js +4 -2
- package/dist/esm/tools/annotation/LivewireContourTool.js +3 -1
- package/dist/esm/tools/annotation/PlanarFreehandROITool.d.ts +13 -2
- package/dist/esm/tools/annotation/PlanarFreehandROITool.js +28 -81
- package/dist/esm/tools/annotation/ProbeTool.js +3 -1
- package/dist/esm/tools/annotation/RectangleROITool.js +31 -20
- package/dist/esm/tools/annotation/SplineROITool.js +3 -1
- package/dist/esm/tools/annotation/UltrasoundDirectionalTool.js +3 -1
- package/dist/esm/tools/annotation/UltrasoundPleuraBLineTool/UltrasoundPleuraBLineTool.js +5 -3
- package/dist/esm/tools/annotation/VideoRedactionTool.js +3 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/findOpenUShapedContourVectorToPeak.js +3 -1
- package/dist/esm/tools/base/AnnotationTool.js +3 -1
- package/dist/esm/tools/base/ContourBaseTool.js +3 -1
- package/dist/esm/tools/displayTools/Contour/contourDisplay.js +4 -2
- package/dist/esm/tools/displayTools/Contour/contourHandler/handleContourSegmentation.js +3 -1
- package/dist/esm/tools/displayTools/Contour/contourHandler/utils.js +3 -1
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js +4 -2
- package/dist/esm/tools/displayTools/Labelmap/labelmapRenderPlan/legacyVolumePlan.js +4 -2
- package/dist/esm/tools/displayTools/Labelmap/syncStackLabelmapActors.js +3 -1
- package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js +6 -4
- package/dist/esm/tools/segmentation/CircleROIStartEndThresholdTool.js +3 -1
- package/dist/esm/tools/segmentation/CircleScissorsTool.js +3 -1
- package/dist/esm/tools/segmentation/LabelmapEditWithContour.js +3 -1
- package/dist/esm/tools/segmentation/PaintFillTool.js +3 -1
- package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.js +3 -1
- package/dist/esm/tools/segmentation/RectangleROIThresholdTool.js +3 -1
- package/dist/esm/tools/segmentation/RectangleScissorsTool.js +3 -1
- package/dist/esm/tools/segmentation/SegmentBidirectionalTool.js +3 -1
- package/dist/esm/tools/segmentation/SegmentSelectTool.d.ts +6 -1
- package/dist/esm/tools/segmentation/SegmentSelectTool.js +30 -4
- package/dist/esm/tools/segmentation/SphereScissorsTool.js +3 -1
- package/dist/esm/tools/segmentation/strategies/compositions/circularCursor.js +3 -1
- package/dist/esm/tools/segmentation/strategies/compositions/index.js +1 -1
- package/dist/esm/types/SegmentationStateTypes.d.ts +4 -0
- package/dist/esm/utilities/calibrateImageSpacing.js +3 -1
- package/dist/esm/utilities/cine/playClip.js +3 -1
- package/dist/esm/utilities/contourSegmentation/applyContourStroke.js +3 -1
- package/dist/esm/utilities/contourSegmentation/contourSegmentationOperation.js +4 -2
- package/dist/esm/utilities/contourSegmentation/convertContourSegmentation.js +3 -1
- package/dist/esm/utilities/contourSegmentation/logicalOperators.js +6 -4
- package/dist/esm/utilities/contourSegmentation/mergeMultipleAnnotations.js +3 -1
- package/dist/esm/utilities/contourSegmentation/sharedOperations.js +3 -1
- package/dist/esm/utilities/contours/generateContourSetsFromLabelmap.js +3 -1
- package/dist/esm/utilities/contours/interpolation/findAnnotationForInterpolation.js +3 -1
- package/dist/esm/utilities/contours/interpolation/interpolate.js +3 -1
- package/dist/esm/utilities/dynamicVolume/generateImageFromTimeData.js +4 -2
- package/dist/esm/utilities/dynamicVolume/getDataInTime.js +3 -1
- package/dist/esm/utilities/index.d.ts +2 -1
- package/dist/esm/utilities/index.js +2 -1
- package/dist/esm/utilities/livewire/LivewireScissors.js +3 -1
- package/dist/esm/utilities/math/basic/Calculator.js +3 -1
- package/dist/esm/utilities/math/polyline/addCanvasPointsToArray.js +3 -1
- package/dist/esm/utilities/math/polyline/combinePolyline.js +4 -2
- package/dist/esm/utilities/math/polyline/getSubPixelSpacingAndXYDirections.js +12 -6
- package/dist/esm/utilities/math/polyline/intersectPolylines.js +4 -2
- package/dist/esm/utilities/math/polyline/subtractPolylines.js +4 -2
- package/dist/esm/utilities/sampleAreaAnnotationVoxels.d.ts +44 -0
- package/dist/esm/utilities/sampleAreaAnnotationVoxels.js +63 -0
- package/dist/esm/utilities/segmentation/InterpolationManager/InterpolationManager.js +5 -3
- package/dist/esm/utilities/segmentation/growCut/runFloodFillSegmentation.js +10 -5
- package/dist/esm/utilities/segmentation/growCut/runGrowCut.js +3 -1
- package/dist/esm/utilities/segmentation/growCut/runGrowCutForSphere.js +3 -1
- package/dist/esm/utilities/segmentation/growCut/runOneClickGrowCut.js +10 -8
- package/dist/esm/utilities/segmentation/isLineInSegment.js +3 -1
- package/dist/esm/utilities/segmentation/islandRemoval.js +3 -1
- package/dist/esm/utilities/segmentation/segmentContourAction.js +4 -2
- package/dist/esm/utilities/segmentation/utilsForWorker.js +4 -2
- package/dist/esm/utilities/spatial/areViewportsSpatiallyLinked.js +2 -1
- package/dist/esm/utilities/stackPrefetch/stackContextPrefetch.js +5 -3
- package/dist/esm/utilities/stackPrefetch/stackPrefetch.js +4 -2
- package/dist/esm/utilities/triggerAnnotationRenderForToolGroupIds.js +4 -2
- package/dist/esm/utilities/triggerAnnotationRenderForViewportIds.js +4 -2
- package/dist/esm/utilities/voi/colorbar/Colorbar.js +3 -1
- package/dist/esm/utilities/voi/windowlevel/extractWindowLevelRegionToolData.js +3 -1
- package/dist/esm/utilities/vtkjs/OrientationControllerWidget/index.js +4 -2
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/workers/computeWorker.js +5 -3
- package/package.json +4 -5
- package/LICENSE +0 -21
|
@@ -22,7 +22,11 @@ import { isViewportPreScaled } from '../../utilities/viewport/isViewportPreScale
|
|
|
22
22
|
import { BasicStatsCalculator } from '../../utilities/math/basic/index.js';
|
|
23
23
|
import { getStyleProperty } from '../../stateManagement/annotation/config/helpers.js';
|
|
24
24
|
import { defaultAreaGetTextLines } from '../../utilities/defaultGetTextLines.js';
|
|
25
|
+
import sampleAreaAnnotationVoxels from '../../utilities/sampleAreaAnnotationVoxels.js';
|
|
26
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
27
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.annotation.RectangleROITool');
|
|
25
28
|
const { transformWorldToIndex, transformWorldToIndexContinuous } = csUtils;
|
|
29
|
+
const { createRectangleShape } = csUtils.voxelSlab;
|
|
26
30
|
class RectangleROITool extends AnnotationTool {
|
|
27
31
|
constructor(toolProps = {}, defaultToolProps = {
|
|
28
32
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -360,7 +364,7 @@ class RectangleROITool extends AnnotationTool {
|
|
|
360
364
|
}
|
|
361
365
|
}
|
|
362
366
|
if (!viewport.getRenderingEngine()) {
|
|
363
|
-
|
|
367
|
+
cs3dLogger.warn('Rendering Engine has been destroyed');
|
|
364
368
|
return renderStatus;
|
|
365
369
|
}
|
|
366
370
|
let activeHandleCanvasCoords;
|
|
@@ -445,17 +449,6 @@ class RectangleROITool extends AnnotationTool {
|
|
|
445
449
|
const isHandleOutsideTarget = !this._isInsideVolume(pos1Index, pos2Index, dimensions);
|
|
446
450
|
isHandleOutsideAnyTarget ||= isHandleOutsideTarget;
|
|
447
451
|
if (!isHandleOutsideTarget) {
|
|
448
|
-
const iMin = Math.min(pos1Index[0], pos2Index[0]);
|
|
449
|
-
const iMax = Math.max(pos1Index[0], pos2Index[0]);
|
|
450
|
-
const jMin = Math.min(pos1Index[1], pos2Index[1]);
|
|
451
|
-
const jMax = Math.max(pos1Index[1], pos2Index[1]);
|
|
452
|
-
const kMin = Math.min(pos1Index[2], pos2Index[2]);
|
|
453
|
-
const kMax = Math.max(pos1Index[2], pos2Index[2]);
|
|
454
|
-
const boundsIJK = [
|
|
455
|
-
[iMin, iMax],
|
|
456
|
-
[jMin, jMax],
|
|
457
|
-
[kMin, kMax],
|
|
458
|
-
];
|
|
459
452
|
const handles = [pos1Index, pos2Index];
|
|
460
453
|
const calibrate = getCalibratedLengthUnitsAndScale(image, handles);
|
|
461
454
|
const width = _a.calculateLengthInIndex(calibrate, [
|
|
@@ -473,14 +466,32 @@ class RectangleROITool extends AnnotationTool {
|
|
|
473
466
|
isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
|
|
474
467
|
};
|
|
475
468
|
const modalityUnit = getPixelValueUnits(metadata.Modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
469
|
+
const pointsInShape = sampleAreaAnnotationVoxels({
|
|
470
|
+
annotation,
|
|
471
|
+
image,
|
|
472
|
+
voxelManager: voxelManager,
|
|
473
|
+
points: worldHandles,
|
|
474
|
+
createShape: ({ volume, planePoint, viewPlaneNormal }) => {
|
|
475
|
+
const majorAxis = vec3.sub(vec3.create(), worldHandles[1], worldHandles[0]);
|
|
476
|
+
const majorHalfLength = vec3.distance(worldHandles[0], worldHandles[1]) / 2;
|
|
477
|
+
const minorHalfLength = vec3.distance(worldHandles[0], worldHandles[2]) / 2;
|
|
478
|
+
if (!(majorHalfLength > 0) || !(minorHalfLength > 0)) {
|
|
479
|
+
return null;
|
|
480
|
+
}
|
|
481
|
+
return createRectangleShape({
|
|
482
|
+
volume,
|
|
483
|
+
planePoint,
|
|
484
|
+
viewPlaneNormal,
|
|
485
|
+
centerWorld: vec3.lerp(vec3.create(), worldHandles[0], worldHandles[3], 0.5),
|
|
486
|
+
majorAxis,
|
|
487
|
+
majorHalfLength,
|
|
488
|
+
minorHalfLength,
|
|
489
|
+
});
|
|
490
|
+
},
|
|
491
|
+
minimumPoints: 4,
|
|
492
|
+
onSample: this.configuration.statsCalculator.statsCallback,
|
|
493
|
+
storePointData: this.configuration.storePointData,
|
|
494
|
+
});
|
|
484
495
|
const stats = this.configuration.statsCalculator.getStatistics();
|
|
485
496
|
cachedStats[targetId] = {
|
|
486
497
|
Modality: metadata.Modality,
|
|
@@ -18,6 +18,8 @@ import { BSpline } from './splines/BSpline.js';
|
|
|
18
18
|
import ContourSegmentationBaseTool from '../base/ContourSegmentationBaseTool.js';
|
|
19
19
|
import { triggerAnnotationRenderForViewportIds } from '../../utilities/index.js';
|
|
20
20
|
import { convertContourSegmentationAnnotation } from '../../utilities/contourSegmentation/index.js';
|
|
21
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
22
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.annotation.SplineROITool');
|
|
21
23
|
const SPLINE_MIN_POINTS = 3;
|
|
22
24
|
const SPLINE_CLICK_CLOSE_CURVE_DIST = 10;
|
|
23
25
|
const DEFAULT_SPLINE_CONFIG = {
|
|
@@ -817,7 +819,7 @@ SplineROITool.hydrate = (viewportId, points, options) => {
|
|
|
817
819
|
return;
|
|
818
820
|
}
|
|
819
821
|
if (points.length < SPLINE_MIN_POINTS) {
|
|
820
|
-
|
|
822
|
+
cs3dLogger.warn('Spline requires at least 3 control points');
|
|
821
823
|
return;
|
|
822
824
|
}
|
|
823
825
|
const { FrameOfReferenceUID, referencedImageId, viewPlaneNormal, viewUp, instance, viewport, } = _a.hydrateBase(_a, enabledElement, points, options);
|
|
@@ -12,6 +12,8 @@ import triggerAnnotationRenderForViewportIds from '../../utilities/triggerAnnota
|
|
|
12
12
|
import { resetElementCursor, hideElementCursor, } from '../../cursors/elementCursor.js';
|
|
13
13
|
import { getCalibratedProbeUnitsAndValue } from '../../utilities/getCalibratedUnits.js';
|
|
14
14
|
import { lineSegment } from '../../utilities/math/index.js';
|
|
15
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
16
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.annotation.UltrasoundDirectionalTool');
|
|
15
17
|
const { transformWorldToIndexContinuous } = csUtils;
|
|
16
18
|
class UltrasoundDirectionalTool extends AnnotationTool {
|
|
17
19
|
constructor(toolProps = {}, defaultToolProps = {
|
|
@@ -248,7 +250,7 @@ class UltrasoundDirectionalTool extends AnnotationTool {
|
|
|
248
250
|
this._throttledCalculateCachedStats(annotation, renderingEngine, enabledElement);
|
|
249
251
|
}
|
|
250
252
|
if (!viewport.getRenderingEngine()) {
|
|
251
|
-
|
|
253
|
+
cs3dLogger.warn('Rendering Engine has been destroyed');
|
|
252
254
|
return renderStatus;
|
|
253
255
|
}
|
|
254
256
|
let handleGroupUID = '0';
|
|
@@ -15,6 +15,8 @@ import triggerAnnotationRenderForViewportIds from '../../../utilities/triggerAnn
|
|
|
15
15
|
import { resetElementCursor, hideElementCursor, } from '../../../cursors/elementCursor.js';
|
|
16
16
|
import { angleFromCenter, calculateInnerFanPercentage, clipInterval, intervalFromPoints, mergeIntervals, subtractIntervals, } from '../../../utilities/math/fan/fanUtils.js';
|
|
17
17
|
import { calculateFanGeometry } from './utils/fanExtraction.js';
|
|
18
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
19
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.annotation.UltrasoundPleuraBLineTool.UltrasoundPleuraBLineTool');
|
|
18
20
|
const { transformIndexToWorld } = utilities;
|
|
19
21
|
class UltrasoundPleuraBLineTool extends AnnotationTool {
|
|
20
22
|
constructor(toolProps = {}, defaultToolProps = {
|
|
@@ -328,7 +330,7 @@ class UltrasoundPleuraBLineTool extends AnnotationTool {
|
|
|
328
330
|
});
|
|
329
331
|
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
|
|
330
332
|
if (!viewport.getRenderingEngine()) {
|
|
331
|
-
|
|
333
|
+
cs3dLogger.warn('Rendering Engine has been destroyed');
|
|
332
334
|
return renderStatus;
|
|
333
335
|
}
|
|
334
336
|
let activeHandleCanvasCoords;
|
|
@@ -408,7 +410,7 @@ class UltrasoundPleuraBLineTool extends AnnotationTool {
|
|
|
408
410
|
annotation.metadata.referencedImageId === currentImageId);
|
|
409
411
|
pleuraAnnotationsToDraw.forEach((annotation) => {
|
|
410
412
|
if (!viewport.getRenderingEngine()) {
|
|
411
|
-
|
|
413
|
+
cs3dLogger.warn('Rendering Engine has been destroyed');
|
|
412
414
|
return renderStatus;
|
|
413
415
|
}
|
|
414
416
|
drawAnnotation(annotation);
|
|
@@ -418,7 +420,7 @@ class UltrasoundPleuraBLineTool extends AnnotationTool {
|
|
|
418
420
|
annotation.metadata.referencedImageId === currentImageId);
|
|
419
421
|
bLineAnnotationsToDraw.forEach((annotation) => {
|
|
420
422
|
if (!viewport.getRenderingEngine()) {
|
|
421
|
-
|
|
423
|
+
cs3dLogger.warn('Rendering Engine has been destroyed');
|
|
422
424
|
return renderStatus;
|
|
423
425
|
}
|
|
424
426
|
drawAnnotation(annotation);
|
|
@@ -11,6 +11,8 @@ import * as rectangle from '../../utilities/math/rectangle/index.js';
|
|
|
11
11
|
import { resetElementCursor, hideElementCursor, } from '../../cursors/elementCursor.js';
|
|
12
12
|
import triggerAnnotationRenderForViewportIds from '../../utilities/triggerAnnotationRenderForViewportIds.js';
|
|
13
13
|
import getWorldWidthAndHeightFromTwoPoints from '../../utilities/planar/getWorldWidthAndHeightFromTwoPoints.js';
|
|
14
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
15
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.annotation.VideoRedactionTool');
|
|
14
16
|
class VideoRedactionTool extends AnnotationTool {
|
|
15
17
|
constructor(toolConfiguration = {}) {
|
|
16
18
|
super(toolConfiguration, {
|
|
@@ -276,7 +278,7 @@ class VideoRedactionTool extends AnnotationTool {
|
|
|
276
278
|
const lineDash = this.getStyle('lineDash', styleSpecifier, annotation);
|
|
277
279
|
const color = this.getStyle('color', styleSpecifier, annotation);
|
|
278
280
|
if (!viewport.getRenderingEngine()) {
|
|
279
|
-
|
|
281
|
+
cs3dLogger.warn('Rendering Engine has been destroyed');
|
|
280
282
|
return;
|
|
281
283
|
}
|
|
282
284
|
let activeHandleCanvasCoords;
|
package/dist/esm/tools/annotation/planarFreehandROITool/findOpenUShapedContourVectorToPeak.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { vec2 } from 'gl-matrix';
|
|
2
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
3
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.annotation.planarFreehandROITool.findOpenUShapedContourVectorToPeak');
|
|
2
4
|
export default function findOpenUShapedContourVectorToPeak(canvasPoints, viewport) {
|
|
3
5
|
const first = canvasPoints[0];
|
|
4
6
|
const last = canvasPoints[canvasPoints.length - 1];
|
|
@@ -85,7 +87,7 @@ function findOpenUShapedContourVectorToPeakOrthogonal(canvasPoints, viewport) {
|
|
|
85
87
|
prevPoint = p;
|
|
86
88
|
}
|
|
87
89
|
if (!orthogonalPoint) {
|
|
88
|
-
|
|
90
|
+
cs3dLogger.warn('No orthogonal intersection found for open U-shaped contour');
|
|
89
91
|
return null;
|
|
90
92
|
}
|
|
91
93
|
const toOrthogonal = [
|
|
@@ -14,6 +14,8 @@ import { setAnnotationSelected } from '../../stateManagement/annotation/annotati
|
|
|
14
14
|
import { addContourSegmentationAnnotation } from '../../utilities/contourSegmentation/index.js';
|
|
15
15
|
import { safeStructuredClone } from '../../utilities/safeStructuredClone.js';
|
|
16
16
|
import getViewportICamera from '../../utilities/getViewportICamera.js';
|
|
17
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
18
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.base.AnnotationTool');
|
|
17
19
|
const { DefaultHistoryMemo } = csUtils.HistoryMemo;
|
|
18
20
|
class AnnotationTool extends AnnotationDisplayTool {
|
|
19
21
|
static createAnnotationForViewport(viewport, ...annotationBaseData) {
|
|
@@ -279,7 +281,7 @@ class AnnotationTool extends AnnotationDisplayTool {
|
|
|
279
281
|
}
|
|
280
282
|
const currentAnnotation = getAnnotation(annotationUID);
|
|
281
283
|
if (!currentAnnotation) {
|
|
282
|
-
|
|
284
|
+
cs3dLogger.warn('No current annotation');
|
|
283
285
|
return;
|
|
284
286
|
}
|
|
285
287
|
Object.assign(currentAnnotation.data, state.data);
|
|
@@ -3,6 +3,8 @@ import { drawPath as drawPathSvg } from '../../drawingSvg/index.js';
|
|
|
3
3
|
import AnnotationTool from './AnnotationTool.js';
|
|
4
4
|
import updateContourPolyline from '../../utilities/contours/updateContourPolyline.js';
|
|
5
5
|
import getContourHolesDataCanvas from '../../utilities/contours/getContourHolesDataCanvas.js';
|
|
6
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
7
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.base.ContourBaseTool');
|
|
6
8
|
class ContourBaseTool extends AnnotationTool {
|
|
7
9
|
constructor(toolProps, defaultToolProps) {
|
|
8
10
|
super(toolProps, defaultToolProps);
|
|
@@ -29,7 +31,7 @@ class ContourBaseTool extends AnnotationTool {
|
|
|
29
31
|
const { viewport } = enabledElement;
|
|
30
32
|
const { element } = viewport;
|
|
31
33
|
if (!viewport.getRenderingEngine()) {
|
|
32
|
-
|
|
34
|
+
cs3dLogger.warn('Rendering Engine has been destroyed');
|
|
33
35
|
return renderStatus;
|
|
34
36
|
}
|
|
35
37
|
let annotations = getAnnotations(this.getToolName(), element);
|
|
@@ -9,6 +9,8 @@ import { computeAndAddRepresentation } from '../../../utilities/segmentation/com
|
|
|
9
9
|
import { getUniqueSegmentIndices } from '../../../utilities/segmentation/getUniqueSegmentIndices.js';
|
|
10
10
|
import { getAnnotation } from '../../../stateManagement/annotation/annotationState.js';
|
|
11
11
|
import { vec3 } from 'gl-matrix';
|
|
12
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
13
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.displayTools.Contour.contourDisplay');
|
|
12
14
|
const polySegConversionInProgressForViewportId = new Map();
|
|
13
15
|
const processedViewportSegmentations = new Map();
|
|
14
16
|
function removeRepresentation(viewportId, segmentationId, renderImmediate = false) {
|
|
@@ -38,12 +40,12 @@ async function render(viewport, contourRepresentation) {
|
|
|
38
40
|
contourData = await computeAndAddRepresentation(segmentationId, Representations.Contour, () => polySeg.computeContourData(segmentationId, { viewport }));
|
|
39
41
|
}
|
|
40
42
|
catch (error) {
|
|
41
|
-
|
|
43
|
+
cs3dLogger.warn('Unable to compute contour data for segmentationId', segmentationId, error);
|
|
42
44
|
}
|
|
43
45
|
polySegConversionInProgressForViewportId.set(viewport.id, false);
|
|
44
46
|
}
|
|
45
47
|
else if (!contourData && !getPolySeg()) {
|
|
46
|
-
|
|
48
|
+
cs3dLogger.debug(`No contour data found for segmentationId ${segmentationId} and PolySeg add-on is not configured. Unable to convert from other representations to contour. Please register PolySeg using cornerstoneTools.init({ addons: { polySeg } }) to enable automatic conversion.`);
|
|
47
49
|
}
|
|
48
50
|
if (!contourData) {
|
|
49
51
|
return;
|
|
@@ -6,6 +6,8 @@ import getViewportICamera from '../../../../utilities/getViewportICamera.js';
|
|
|
6
6
|
import { validateGeometry } from './utils.js';
|
|
7
7
|
import { SegmentationRepresentations } from '../../../../enums/index.js';
|
|
8
8
|
import { segmentationStyle } from '../../../../stateManagement/segmentation/SegmentationStyle.js';
|
|
9
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
10
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.displayTools.Contour.contourHandler.handleContourSegmentation');
|
|
9
11
|
function handleContourSegmentation(viewport, geometryIds, annotationUIDsMap, contourRepresentation) {
|
|
10
12
|
if (annotationUIDsMap.size) {
|
|
11
13
|
viewport.render();
|
|
@@ -20,7 +22,7 @@ function addContourSetsToElement(viewport, geometryIds, contourRepresentation) {
|
|
|
20
22
|
geometryIds.forEach((geometryId) => {
|
|
21
23
|
const geometry = cache.getGeometry(geometryId);
|
|
22
24
|
if (!geometry) {
|
|
23
|
-
|
|
25
|
+
cs3dLogger.warn(`No geometry found for geometryId ${geometryId}. Skipping render.`);
|
|
24
26
|
return;
|
|
25
27
|
}
|
|
26
28
|
const segmentIndex = geometry.data.segmentIndex;
|
|
@@ -2,6 +2,8 @@ import { Enums } from '@cornerstonejs/core';
|
|
|
2
2
|
import vtkCellArray from '@kitware/vtk.js/Common/Core/CellArray.js';
|
|
3
3
|
import vtkPoints from '@kitware/vtk.js/Common/Core/Points.js';
|
|
4
4
|
import vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData.js';
|
|
5
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
6
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.displayTools.Contour.contourHandler.utils');
|
|
5
7
|
export function validateGeometry(geometry) {
|
|
6
8
|
if (!geometry) {
|
|
7
9
|
throw new Error(`No contours found for geometryId ${geometry.id}`);
|
|
@@ -11,7 +13,7 @@ export function validateGeometry(geometry) {
|
|
|
11
13
|
throw new Error(`Geometry type ${geometry.type} not supported for rendering.`);
|
|
12
14
|
}
|
|
13
15
|
if (!geometry.data) {
|
|
14
|
-
|
|
16
|
+
cs3dLogger.warn(`No contours found for geometryId ${geometryId}. Skipping render.`);
|
|
15
17
|
return;
|
|
16
18
|
}
|
|
17
19
|
}
|
|
@@ -8,6 +8,8 @@ import { triggerSegmentationDataModified } from '../../../stateManagement/segmen
|
|
|
8
8
|
import { defaultSegmentationStateManager } from '../../../stateManagement/segmentation/SegmentationStateManager.js';
|
|
9
9
|
import { removeLabelmapRepresentationFromViewport, resolveLabelmapRenderPlan, } from './labelmapRenderPlan.js';
|
|
10
10
|
import { MAX_NUMBER_COLORS, setLabelmapColorAndOpacity, } from './labelmapActorStyle.js';
|
|
11
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
12
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.displayTools.Labelmap.labelmapDisplay');
|
|
11
13
|
export { MAX_NUMBER_COLORS };
|
|
12
14
|
const unsupportedImageMapperStates = new Map();
|
|
13
15
|
let polySegConversionInProgress = false;
|
|
@@ -28,7 +30,7 @@ async function render(viewport, representation) {
|
|
|
28
30
|
const { segmentationId } = representation;
|
|
29
31
|
const segmentation = getSegmentation(segmentationId);
|
|
30
32
|
if (!segmentation) {
|
|
31
|
-
|
|
33
|
+
cs3dLogger.warn('No segmentation found for segmentationId: ', segmentationId);
|
|
32
34
|
return;
|
|
33
35
|
}
|
|
34
36
|
let labelmapData = segmentation.representationData[SegmentationRepresentations.Labelmap];
|
|
@@ -52,7 +54,7 @@ async function render(viewport, representation) {
|
|
|
52
54
|
polySegConversionInProgress = false;
|
|
53
55
|
}
|
|
54
56
|
else if (!labelmapData && !getPolySeg()) {
|
|
55
|
-
|
|
57
|
+
cs3dLogger.debug(`No labelmap data found for segmentationId ${segmentationId} and PolySeg add-on is not configured. Unable to convert from other representations to labelmap. Please register PolySeg using cornerstoneTools.init({ addons: { polySeg } }) to enable automatic conversion.`);
|
|
56
58
|
}
|
|
57
59
|
if (!labelmapData) {
|
|
58
60
|
return;
|
|
@@ -5,6 +5,8 @@ import { addVolumesAsIndependentComponents } from '../addVolumesAsIndependentCom
|
|
|
5
5
|
import { createLabelmapRepresentationUID } from '../labelmapRepresentationUID.js';
|
|
6
6
|
import { createLabelmapRenderPlan, getActorEntryRenderMode, } from './createLabelmapRenderPlan.js';
|
|
7
7
|
import { addLabelmapToPlanarGenericViewport, isPlanarNextVolumeViewport, } from './planarGenericVolumeLabelmap.js';
|
|
8
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
9
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.displayTools.Labelmap.labelmapRenderPlan.legacyVolumePlan');
|
|
8
10
|
const { uuidv4 } = utilities;
|
|
9
11
|
function createLegacyVolumeLabelmapPlan({ config, isVolumeImageMapper, renderMode, segmentation, segmentationId, useSliceRendering, viewport, }) {
|
|
10
12
|
return createLabelmapRenderPlan({
|
|
@@ -72,7 +74,7 @@ async function mountLegacyVolumeLabelmap({ config, labelMapData, segmentation, s
|
|
|
72
74
|
if (!baseVolume || !segVolume) {
|
|
73
75
|
useIndependentComponents = false;
|
|
74
76
|
blendMode = Enums.BlendModes.MAXIMUM_INTENSITY_BLEND;
|
|
75
|
-
|
|
77
|
+
cs3dLogger.debug('Independent components unavailable (missing reference or segmentation volume) - falling back to regular volume addition');
|
|
76
78
|
}
|
|
77
79
|
else {
|
|
78
80
|
const segDims = segVolume.dimensions;
|
|
@@ -82,7 +84,7 @@ async function mountLegacyVolumeLabelmap({ config, labelMapData, segmentation, s
|
|
|
82
84
|
segDims[2] !== refDims[2]) {
|
|
83
85
|
useIndependentComponents = false;
|
|
84
86
|
blendMode = Enums.BlendModes.MAXIMUM_INTENSITY_BLEND;
|
|
85
|
-
|
|
87
|
+
cs3dLogger.debug('Dimensions mismatch - falling back to regular volume addition');
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
}
|
|
@@ -11,6 +11,8 @@ import { getLabelmapActorEntries } from '../../../stateManagement/segmentation/h
|
|
|
11
11
|
import getViewportLabelmapRenderMode from '../../../stateManagement/segmentation/helpers/getViewportLabelmapRenderMode.js';
|
|
12
12
|
import { createLabelmapRepresentationUID } from './labelmapRepresentationUID.js';
|
|
13
13
|
import removeLabelmapRepresentationData from './removeLabelmapRepresentationData.js';
|
|
14
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
15
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.displayTools.Labelmap.syncStackLabelmapActors');
|
|
14
16
|
export function syncStackLabelmapActors(viewport, segmentationId) {
|
|
15
17
|
if (typeof viewport
|
|
16
18
|
.getCurrentImageId !== 'function') {
|
|
@@ -55,7 +57,7 @@ export function syncStackLabelmapActors(viewport, segmentationId) {
|
|
|
55
57
|
derivedImageIds.forEach((derivedImageId) => {
|
|
56
58
|
const derivedImage = cache.getImage(derivedImageId);
|
|
57
59
|
if (!derivedImage) {
|
|
58
|
-
|
|
60
|
+
cs3dLogger.warn('No derived image found in the cache for segmentation representation', { segmentationId, derivedImageId });
|
|
59
61
|
return;
|
|
60
62
|
}
|
|
61
63
|
const segmentationActorEntry = getLabelmapActorEntries(viewport.id, segmentationId)?.find((actorEntry) => actorEntry.referencedId === derivedImageId);
|
|
@@ -7,6 +7,8 @@ import { getColorLUT } from '../../../stateManagement/segmentation/getColorLUT.j
|
|
|
7
7
|
import { getPolySeg } from '../../../config.js';
|
|
8
8
|
import { computeAndAddRepresentation } from '../../../utilities/segmentation/computeAndAddRepresentation.js';
|
|
9
9
|
import { internalGetHiddenSegmentIndices } from '../../../stateManagement/segmentation/helpers/internalGetHiddenSegmentIndices.js';
|
|
10
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
11
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.displayTools.Surface.surfaceDisplay');
|
|
10
12
|
function removeRepresentation(viewportId, segmentationId, renderImmediate = false) {
|
|
11
13
|
const enabledElement = getEnabledElementByViewportId(viewportId);
|
|
12
14
|
if (!enabledElement) {
|
|
@@ -35,15 +37,15 @@ async function render(viewport, representation) {
|
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
else if (!SurfaceData && !getPolySeg()) {
|
|
38
|
-
|
|
40
|
+
cs3dLogger.debug(`No surface data found for segmentationId ${segmentationId} and PolySeg add-on is not configured. Unable to convert from other representations to surface. Please register PolySeg using cornerstoneTools.init({ addons: { polySeg } }) to enable automatic conversion.`);
|
|
39
41
|
}
|
|
40
42
|
if (!SurfaceData) {
|
|
41
|
-
|
|
43
|
+
cs3dLogger.warn(`No Surface data found for segmentationId ${segmentationId}. Skipping render.`);
|
|
42
44
|
return;
|
|
43
45
|
}
|
|
44
46
|
const { geometryIds } = SurfaceData;
|
|
45
47
|
if (!geometryIds?.size) {
|
|
46
|
-
|
|
48
|
+
cs3dLogger.warn(`No Surfaces found for segmentationId ${segmentationId}. Skipping render.`);
|
|
47
49
|
}
|
|
48
50
|
const { colorLUTIndex } = representation;
|
|
49
51
|
const colorLUT = getColorLUT(colorLUTIndex);
|
|
@@ -51,7 +53,7 @@ async function render(viewport, representation) {
|
|
|
51
53
|
geometryIds.forEach((geometryId) => {
|
|
52
54
|
const geometry = cache.getGeometry(geometryId);
|
|
53
55
|
if (!geometry?.data) {
|
|
54
|
-
|
|
56
|
+
cs3dLogger.warn(`No Surfaces found for geometryId ${geometryId}. Skipping render.`);
|
|
55
57
|
return;
|
|
56
58
|
}
|
|
57
59
|
const { segmentIndex } = geometry.data;
|
|
@@ -19,6 +19,8 @@ import { pointInEllipse } from '../../utilities/math/ellipse/index.js';
|
|
|
19
19
|
import { BasicStatsCalculator } from '../../utilities/math/basic/index.js';
|
|
20
20
|
import { filterAnnotationsWithinSamePlane } from '../../utilities/planar/index.js';
|
|
21
21
|
import { getPixelValueUnits } from '../../utilities/getPixelValueUnits.js';
|
|
22
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
23
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.segmentation.CircleROIStartEndThresholdTool');
|
|
22
24
|
const { transformWorldToIndex } = csUtils;
|
|
23
25
|
class CircleROIStartEndThresholdTool extends CircleROITool {
|
|
24
26
|
constructor(toolProps = {}, defaultToolProps = {
|
|
@@ -227,7 +229,7 @@ class CircleROIStartEndThresholdTool extends CircleROITool {
|
|
|
227
229
|
}
|
|
228
230
|
}
|
|
229
231
|
if (!viewport.getRenderingEngine()) {
|
|
230
|
-
|
|
232
|
+
cs3dLogger.warn('Rendering Engine has been destroyed');
|
|
231
233
|
return renderStatus;
|
|
232
234
|
}
|
|
233
235
|
let activeHandleCanvasCoords;
|
|
@@ -14,6 +14,8 @@ import LabelmapBaseTool from './LabelmapBaseTool.js';
|
|
|
14
14
|
import { getOrCreateLabelmapVolume, resolveLabelmapForSegment, } from '../../stateManagement/segmentation/helpers/labelmapSegmentationState.js';
|
|
15
15
|
import getEllipseWorldCoordinates from '../../utilities/getEllipseWorldCoordinates.js';
|
|
16
16
|
import getCenterAndRadiusInCanvas from '../../utilities/getCenterAndRadiusInCanvas.js';
|
|
17
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
18
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.segmentation.CircleScissorsTool');
|
|
17
19
|
class CircleScissorsTool extends LabelmapBaseTool {
|
|
18
20
|
constructor(toolProps = {}, defaultToolProps = {
|
|
19
21
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -206,7 +208,7 @@ class CircleScissorsTool extends LabelmapBaseTool {
|
|
|
206
208
|
const { center, radius } = getCenterAndRadiusInCanvas(points, viewport);
|
|
207
209
|
const color = `rgb(${toolMetadata.segmentColor.slice(0, 3)})`;
|
|
208
210
|
if (!viewport.getRenderingEngine()) {
|
|
209
|
-
|
|
211
|
+
cs3dLogger.warn('Rendering Engine has been destroyed');
|
|
210
212
|
return renderStatus;
|
|
211
213
|
}
|
|
212
214
|
const circleUID = '0';
|
|
@@ -4,6 +4,8 @@ import PlanarFreehandContourSegmentationTool from '../annotation/PlanarFreehandC
|
|
|
4
4
|
import BrushTool from './BrushTool.js';
|
|
5
5
|
import * as segmentation from '../../stateManagement/segmentation/index.js';
|
|
6
6
|
import { getSegmentationRepresentationsBySegmentationId } from '../../stateManagement/segmentation/getSegmentationRepresentation.js';
|
|
7
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
8
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.segmentation.LabelmapEditWithContour');
|
|
7
9
|
class LabelMapEditWithContourTool extends PlanarFreehandContourSegmentationTool {
|
|
8
10
|
constructor(toolProps = {}) {
|
|
9
11
|
const initialProps = utilities.deepMerge({
|
|
@@ -41,7 +43,7 @@ class LabelMapEditWithContourTool extends PlanarFreehandContourSegmentationTool
|
|
|
41
43
|
}
|
|
42
44
|
const activeSeg = segmentation.getActiveSegmentation(viewportId);
|
|
43
45
|
if (!activeSeg) {
|
|
44
|
-
|
|
46
|
+
cs3dLogger.info('No active segmentation detected');
|
|
45
47
|
return false;
|
|
46
48
|
}
|
|
47
49
|
const segmentationId = activeSeg.segmentationId;
|
|
@@ -7,6 +7,8 @@ import floodFill from '../../utilities/segmentation/floodFill.js';
|
|
|
7
7
|
import { getCurrentLabelmapImageIdForViewport, getSegmentation, } from '../../stateManagement/segmentation/segmentationState.js';
|
|
8
8
|
import getViewportLabelmapRenderMode from '../../stateManagement/segmentation/helpers/getViewportLabelmapRenderMode.js';
|
|
9
9
|
import { getOrCreateLabelmapVolume, resolveLabelmapForSegment, } from '../../stateManagement/segmentation/helpers/labelmapSegmentationState.js';
|
|
10
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
11
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.segmentation.PaintFillTool');
|
|
10
12
|
const { transformWorldToIndex, isEqual } = csUtils;
|
|
11
13
|
class PaintFillTool extends BaseTool {
|
|
12
14
|
constructor(toolProps = {}, defaultToolProps = {
|
|
@@ -60,7 +62,7 @@ class PaintFillTool extends BaseTool {
|
|
|
60
62
|
}
|
|
61
63
|
const fixedDimension = this.getFixedDimension(viewPlaneNormal, direction);
|
|
62
64
|
if (fixedDimension === undefined) {
|
|
63
|
-
|
|
65
|
+
cs3dLogger.warn('Oblique paint fill not yet supported');
|
|
64
66
|
return;
|
|
65
67
|
}
|
|
66
68
|
const { floodFillGetter, getLabelValue, getScalarDataPositionFromPlane, inPlaneSeedPoint, fixedDimensionValue, } = this.generateHelpers(voxelManager, dimensions, index, fixedDimension);
|
|
@@ -17,6 +17,8 @@ import { isViewportPreScaled } from '../../utilities/viewport/isViewportPreScale
|
|
|
17
17
|
import { BasicStatsCalculator } from '../../utilities/math/basic/index.js';
|
|
18
18
|
import { filterAnnotationsWithinSamePlane } from '../../utilities/planar/index.js';
|
|
19
19
|
import { getPixelValueUnits } from '../../utilities/getPixelValueUnits.js';
|
|
20
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
21
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.segmentation.RectangleROIStartEndThresholdTool');
|
|
20
22
|
const { transformWorldToIndex } = csUtils;
|
|
21
23
|
class RectangleROIStartEndThresholdTool extends RectangleROITool {
|
|
22
24
|
constructor(toolProps = {}, defaultToolProps = {
|
|
@@ -206,7 +208,7 @@ class RectangleROIStartEndThresholdTool extends RectangleROITool {
|
|
|
206
208
|
firstOrLastSlice = true;
|
|
207
209
|
}
|
|
208
210
|
if (!viewport.getRenderingEngine()) {
|
|
209
|
-
|
|
211
|
+
cs3dLogger.warn('Rendering Engine has been destroyed');
|
|
210
212
|
return renderStatus;
|
|
211
213
|
}
|
|
212
214
|
let activeHandleCanvasCoords;
|
|
@@ -8,6 +8,8 @@ import triggerAnnotationRenderForViewportIds from '../../utilities/triggerAnnota
|
|
|
8
8
|
import { isAnnotationVisible } from '../../stateManagement/annotation/annotationVisibility.js';
|
|
9
9
|
import { triggerAnnotationModified } from '../../stateManagement/annotation/helpers/state.js';
|
|
10
10
|
import RectangleROITool from '../annotation/RectangleROITool.js';
|
|
11
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
12
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.segmentation.RectangleROIThresholdTool');
|
|
11
13
|
class RectangleROIThresholdTool extends RectangleROITool {
|
|
12
14
|
constructor(toolProps = {}, defaultToolProps = {
|
|
13
15
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -110,7 +112,7 @@ class RectangleROIThresholdTool extends RectangleROITool {
|
|
|
110
112
|
const lineDash = this.getStyle('lineDash', styleSpecifier, annotation);
|
|
111
113
|
const color = this.getStyle('color', styleSpecifier, annotation);
|
|
112
114
|
if (!viewport.getRenderingEngine()) {
|
|
113
|
-
|
|
115
|
+
cs3dLogger.warn('Rendering Engine has been destroyed');
|
|
114
116
|
return renderStatus;
|
|
115
117
|
}
|
|
116
118
|
triggerAnnotationModified(annotation, element);
|
|
@@ -13,6 +13,8 @@ import { getCurrentLabelmapImageIdForViewport, getSegmentation, } from '../../st
|
|
|
13
13
|
import getViewportLabelmapRenderMode from '../../stateManagement/segmentation/helpers/getViewportLabelmapRenderMode.js';
|
|
14
14
|
import LabelmapBaseTool from './LabelmapBaseTool.js';
|
|
15
15
|
import { getOrCreateLabelmapVolume, resolveLabelmapForSegment, } from '../../stateManagement/segmentation/helpers/labelmapSegmentationState.js';
|
|
16
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
17
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.segmentation.RectangleScissorsTool');
|
|
16
18
|
class RectangleScissorsTool extends LabelmapBaseTool {
|
|
17
19
|
constructor(toolProps = {}, defaultToolProps = {
|
|
18
20
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -224,7 +226,7 @@ class RectangleScissorsTool extends LabelmapBaseTool {
|
|
|
224
226
|
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
|
|
225
227
|
const color = `rgb(${toolMetadata.segmentColor.slice(0, 3)})`;
|
|
226
228
|
if (!viewport.getRenderingEngine()) {
|
|
227
|
-
|
|
229
|
+
cs3dLogger.warn('Rendering Engine has been destroyed');
|
|
228
230
|
return renderStatus;
|
|
229
231
|
}
|
|
230
232
|
const rectangleUID = '0';
|
|
@@ -10,6 +10,8 @@ import triggerAnnotationRenderForViewportIds from '../../utilities/triggerAnnota
|
|
|
10
10
|
import getViewportICamera from '../../utilities/getViewportICamera.js';
|
|
11
11
|
import BidirectionalTool from '../annotation/BidirectionalTool.js';
|
|
12
12
|
import { getSegmentIndexColor } from '../../stateManagement/segmentation/config/segmentationColor.js';
|
|
13
|
+
import { utilities as cornerstoneUtilities } from '@cornerstonejs/core';
|
|
14
|
+
const cs3dLogger = cornerstoneUtilities.logger.toolsLog.getLogger('tools.segmentation.SegmentBidirectionalTool');
|
|
13
15
|
class SegmentBidirectionalTool extends BidirectionalTool {
|
|
14
16
|
constructor(toolProps = {}) {
|
|
15
17
|
super(toolProps);
|
|
@@ -59,7 +61,7 @@ class SegmentBidirectionalTool extends BidirectionalTool {
|
|
|
59
61
|
this._throttledCalculateCachedStats(annotation, renderingEngine, enabledElement);
|
|
60
62
|
}
|
|
61
63
|
if (!viewport.getRenderingEngine()) {
|
|
62
|
-
|
|
64
|
+
cs3dLogger.warn('Rendering Engine has been destroyed');
|
|
63
65
|
return renderStatus;
|
|
64
66
|
}
|
|
65
67
|
let activeHandleCanvasCoords;
|
|
@@ -5,14 +5,19 @@ import type { Segmentation } from '../../types/SegmentationStateTypes.js';
|
|
|
5
5
|
declare class SegmentSelectTool extends BaseTool {
|
|
6
6
|
static toolName: any;
|
|
7
7
|
private hoverTimer;
|
|
8
|
+
private hoverElement;
|
|
8
9
|
static SelectMode: {
|
|
9
10
|
Inside: string;
|
|
10
11
|
Border: string;
|
|
11
12
|
};
|
|
12
13
|
constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
|
|
13
14
|
mouseMoveCallback: (evt: EventTypes.InteractionEventType) => boolean;
|
|
14
|
-
|
|
15
|
+
private _cancelPendingHover;
|
|
16
|
+
private _detachHoverLeaveListener;
|
|
17
|
+
private _releaseHover;
|
|
15
18
|
onSetToolActive: () => void;
|
|
19
|
+
onSetToolEnabled: () => void;
|
|
20
|
+
onSetToolPassive: () => void;
|
|
16
21
|
onSetToolDisabled: () => void;
|
|
17
22
|
_setActiveSegment(evt?: EventTypes.InteractionEventType): void;
|
|
18
23
|
_setActiveSegmentForType(activeSegmentation: Segmentation, worldPoint: Types.Point3, viewport: Types.IStackViewport | Types.IVolumeViewport): void;
|