@cornerstonejs/tools 2.18.0 → 2.18.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.
Files changed (46) hide show
  1. package/dist/esm/tools/annotation/AngleTool.d.ts +1 -1
  2. package/dist/esm/tools/annotation/AngleTool.js +1 -1
  3. package/dist/esm/tools/annotation/ArrowAnnotateTool.d.ts +1 -1
  4. package/dist/esm/tools/annotation/ArrowAnnotateTool.js +1 -1
  5. package/dist/esm/tools/annotation/BidirectionalTool.d.ts +1 -1
  6. package/dist/esm/tools/annotation/BidirectionalTool.js +1 -1
  7. package/dist/esm/tools/annotation/CircleROITool.d.ts +1 -1
  8. package/dist/esm/tools/annotation/CircleROITool.js +1 -1
  9. package/dist/esm/tools/annotation/CobbAngleTool.d.ts +1 -1
  10. package/dist/esm/tools/annotation/CobbAngleTool.js +1 -1
  11. package/dist/esm/tools/annotation/DragProbeTool.d.ts +1 -1
  12. package/dist/esm/tools/annotation/DragProbeTool.js +1 -2
  13. package/dist/esm/tools/annotation/ETDRSGridTool.d.ts +1 -1
  14. package/dist/esm/tools/annotation/ETDRSGridTool.js +1 -1
  15. package/dist/esm/tools/annotation/EllipticalROITool.d.ts +1 -1
  16. package/dist/esm/tools/annotation/EllipticalROITool.js +1 -1
  17. package/dist/esm/tools/annotation/HeightTool.d.ts +1 -1
  18. package/dist/esm/tools/annotation/HeightTool.js +1 -1
  19. package/dist/esm/tools/annotation/KeyImageTool.d.ts +1 -1
  20. package/dist/esm/tools/annotation/KeyImageTool.js +2 -2
  21. package/dist/esm/tools/annotation/LengthTool.d.ts +1 -1
  22. package/dist/esm/tools/annotation/LengthTool.js +1 -1
  23. package/dist/esm/tools/annotation/LivewireContourSegmentationTool.d.ts +1 -1
  24. package/dist/esm/tools/annotation/LivewireContourSegmentationTool.js +1 -1
  25. package/dist/esm/tools/annotation/LivewireContourTool.js +1 -1
  26. package/dist/esm/tools/annotation/PlanarFreehandContourSegmentationTool.d.ts +1 -1
  27. package/dist/esm/tools/annotation/PlanarFreehandContourSegmentationTool.js +1 -2
  28. package/dist/esm/tools/annotation/PlanarFreehandROITool.d.ts +1 -1
  29. package/dist/esm/tools/annotation/PlanarFreehandROITool.js +1 -1
  30. package/dist/esm/tools/annotation/ProbeTool.d.ts +1 -1
  31. package/dist/esm/tools/annotation/ProbeTool.js +2 -2
  32. package/dist/esm/tools/annotation/RectangleROITool.d.ts +1 -1
  33. package/dist/esm/tools/annotation/RectangleROITool.js +2 -2
  34. package/dist/esm/tools/annotation/RegionSegmentPlusTool.d.ts +1 -1
  35. package/dist/esm/tools/annotation/RegionSegmentPlusTool.js +1 -1
  36. package/dist/esm/tools/annotation/RegionSegmentTool.d.ts +1 -1
  37. package/dist/esm/tools/annotation/RegionSegmentTool.js +1 -1
  38. package/dist/esm/tools/annotation/SplineContourSegmentationTool.d.ts +1 -1
  39. package/dist/esm/tools/annotation/SplineContourSegmentationTool.js +1 -1
  40. package/dist/esm/tools/annotation/SplineROITool.d.ts +1 -1
  41. package/dist/esm/tools/annotation/SplineROITool.js +1 -1
  42. package/dist/esm/tools/annotation/UltrasoundDirectionalTool.d.ts +1 -1
  43. package/dist/esm/tools/annotation/UltrasoundDirectionalTool.js +1 -1
  44. package/dist/esm/tools/annotation/VideoRedactionTool.d.ts +1 -0
  45. package/dist/esm/tools/annotation/VideoRedactionTool.js +2 -2
  46. package/package.json +3 -3
@@ -3,7 +3,7 @@ import { AnnotationTool } from '../base';
3
3
  import type { EventTypes, ToolHandle, PublicToolProps, ToolProps, SVGDrawingHelper, Annotation } from '../../types';
4
4
  import type { AngleAnnotation } from '../../types/ToolSpecificAnnotationTypes';
5
5
  declare class AngleTool extends AnnotationTool {
6
- static toolName: any;
6
+ static toolName: string;
7
7
  angleStartedNotYetCompleted: boolean;
8
8
  _throttledCalculateCachedStats: Function;
9
9
  editData: {
@@ -14,6 +14,7 @@ import { triggerAnnotationCompleted, triggerAnnotationModified, } from '../../st
14
14
  import { resetElementCursor, hideElementCursor, } from '../../cursors/elementCursor';
15
15
  import { isAnnotationVisible } from '../../stateManagement/annotation/annotationVisibility';
16
16
  class AngleTool extends AnnotationTool {
17
+ static { this.toolName = 'Angle'; }
17
18
  constructor(toolProps = {}, defaultToolProps = {
18
19
  supportedInteractionTypes: ['Mouse', 'Touch'],
19
20
  configuration: {
@@ -482,5 +483,4 @@ function defaultGetTextLines(data, targetId) {
482
483
  ];
483
484
  return textLines;
484
485
  }
485
- AngleTool.toolName = 'Angle';
486
486
  export default AngleTool;
@@ -3,7 +3,7 @@ import { AnnotationTool } from '../base';
3
3
  import type { EventTypes, ToolHandle, PublicToolProps, ToolProps, SVGDrawingHelper, Annotation } from '../../types';
4
4
  import type { ArrowAnnotation } from '../../types/ToolSpecificAnnotationTypes';
5
5
  declare class ArrowAnnotateTool extends AnnotationTool {
6
- static toolName: any;
6
+ static toolName: string;
7
7
  _throttledCalculateCachedStats: Function;
8
8
  editData: {
9
9
  annotation: Annotation;
@@ -12,6 +12,7 @@ import { triggerAnnotationCompleted, triggerAnnotationModified, } from '../../st
12
12
  import { resetElementCursor, hideElementCursor, } from '../../cursors/elementCursor';
13
13
  import { isAnnotationVisible } from '../../stateManagement/annotation/annotationVisibility';
14
14
  class ArrowAnnotateTool extends AnnotationTool {
15
+ static { this.toolName = 'ArrowAnnotate'; }
15
16
  constructor(toolProps = {}, defaultToolProps = {
16
17
  supportedInteractionTypes: ['Mouse', 'Touch'],
17
18
  configuration: {
@@ -463,5 +464,4 @@ function getTextCallback(doneChangingTextCallback) {
463
464
  function changeTextCallback(data, eventData, doneChangingTextCallback) {
464
465
  return doneChangingTextCallback(prompt('Enter your annotation:'));
465
466
  }
466
- ArrowAnnotateTool.toolName = 'ArrowAnnotate';
467
467
  export default ArrowAnnotateTool;
@@ -3,7 +3,7 @@ import { AnnotationTool } from '../base';
3
3
  import type { EventTypes, ToolHandle, PublicToolProps, ToolProps, SVGDrawingHelper, Annotation } from '../../types';
4
4
  import type { BidirectionalAnnotation } from '../../types/ToolSpecificAnnotationTypes';
5
5
  declare class BidirectionalTool extends AnnotationTool {
6
- static toolName: any;
6
+ static toolName: string;
7
7
  _throttledCalculateCachedStats: Function;
8
8
  editData: {
9
9
  annotation: Annotation;
@@ -17,6 +17,7 @@ import { resetElementCursor, hideElementCursor, } from '../../cursors/elementCur
17
17
  import triggerAnnotationRenderForViewportIds from '../../utilities/triggerAnnotationRenderForViewportIds';
18
18
  const { transformWorldToIndex } = csUtils;
19
19
  class BidirectionalTool extends AnnotationTool {
20
+ static { this.toolName = 'Bidirectional'; }
20
21
  constructor(toolProps = {}, defaultToolProps = {
21
22
  supportedInteractionTypes: ['Mouse', 'Touch'],
22
23
  configuration: {
@@ -724,5 +725,4 @@ function defaultGetTextLines(data, targetId) {
724
725
  textLines.push(`L: ${csUtils.roundNumber(length)} ${unit || unit}`, `W: ${csUtils.roundNumber(width)} ${unit}`);
725
726
  return textLines;
726
727
  }
727
- BidirectionalTool.toolName = 'Bidirectional';
728
728
  export default BidirectionalTool;
@@ -3,7 +3,7 @@ import type { Types } from '@cornerstonejs/core';
3
3
  import type { EventTypes, ToolHandle, PublicToolProps, ToolProps, SVGDrawingHelper, Annotation } from '../../types';
4
4
  import type { CircleROIAnnotation } from '../../types/ToolSpecificAnnotationTypes';
5
5
  declare class CircleROITool extends AnnotationTool {
6
- static toolName: any;
6
+ static toolName: string;
7
7
  _throttledCalculateCachedStats: Function;
8
8
  editData: {
9
9
  annotation: Annotation;
@@ -21,6 +21,7 @@ import { pointInEllipse } from '../../utilities/math/ellipse';
21
21
  import { BasicStatsCalculator } from '../../utilities/math/basic';
22
22
  const { transformWorldToIndex } = csUtils;
23
23
  class CircleROITool extends AnnotationTool {
24
+ static { this.toolName = 'CircleROI'; }
24
25
  constructor(toolProps = {}, defaultToolProps = {
25
26
  supportedInteractionTypes: ['Mouse', 'Touch'],
26
27
  configuration: {
@@ -634,5 +635,4 @@ function defaultGetTextLines(data, targetId) {
634
635
  }
635
636
  return textLines;
636
637
  }
637
- CircleROITool.toolName = 'CircleROI';
638
638
  export default CircleROITool;
@@ -3,7 +3,7 @@ import { AnnotationTool } from '../base';
3
3
  import type { EventTypes, ToolHandle, PublicToolProps, ToolProps, InteractionTypes, SVGDrawingHelper, Annotation } from '../../types';
4
4
  import type { CobbAngleAnnotation } from '../../types/ToolSpecificAnnotationTypes';
5
5
  declare class CobbAngleTool extends AnnotationTool {
6
- static toolName: any;
6
+ static toolName: string;
7
7
  angleStartedNotYetCompleted: boolean;
8
8
  _throttledCalculateCachedStats: Function;
9
9
  editData: {
@@ -17,6 +17,7 @@ import triggerAnnotationRenderForViewportIds from '../../utilities/triggerAnnota
17
17
  import { resetElementCursor, hideElementCursor, } from '../../cursors/elementCursor';
18
18
  import { isAnnotationVisible } from '../../stateManagement/annotation/annotationVisibility';
19
19
  class CobbAngleTool extends AnnotationTool {
20
+ static { this.toolName = 'CobbAngle'; }
20
21
  constructor(toolProps = {}, defaultToolProps = {
21
22
  supportedInteractionTypes: ['Mouse', 'Touch'],
22
23
  configuration: {
@@ -684,5 +685,4 @@ function defaultGetTextLines(data, targetId) {
684
685
  const textLines = [`${angle.toFixed(2)} ${String.fromCharCode(176)}`];
685
686
  return textLines;
686
687
  }
687
- CobbAngleTool.toolName = 'CobbAngle';
688
688
  export default CobbAngleTool;
@@ -3,7 +3,7 @@ import type { Annotation, EventTypes, PublicToolProps, SVGDrawingHelper, ToolPro
3
3
  import ProbeTool from './ProbeTool';
4
4
  import type { ProbeAnnotation } from '../../types/ToolSpecificAnnotationTypes';
5
5
  declare class DragProbeTool extends ProbeTool {
6
- static toolName: any;
6
+ static toolName: string;
7
7
  editData: {
8
8
  annotation: Annotation;
9
9
  viewportIdsToRender: string[];
@@ -2,10 +2,10 @@ import { getEnabledElement } from '@cornerstonejs/core';
2
2
  import { drawHandles as drawHandlesSvg, drawTextBox as drawTextBoxSvg, } from '../../drawingSvg';
3
3
  import { getViewportIdsWithToolToRender } from '../../utilities/viewportFilters';
4
4
  import { hideElementCursor } from '../../cursors/elementCursor';
5
- import { ChangeTypes, Events } from '../../enums';
6
5
  import triggerAnnotationRenderForViewportIds from '../../utilities/triggerAnnotationRenderForViewportIds';
7
6
  import ProbeTool from './ProbeTool';
8
7
  class DragProbeTool extends ProbeTool {
8
+ static { this.toolName = 'DragProbe'; }
9
9
  constructor(toolProps = {}, defaultToolProps = {
10
10
  supportedInteractionTypes: ['Mouse', 'Touch'],
11
11
  configuration: {
@@ -127,5 +127,4 @@ function defaultGetTextLines(data, targetId) {
127
127
  textLines.push(`${value.toFixed(2)} ${modalityUnit}`);
128
128
  return textLines;
129
129
  }
130
- DragProbeTool.toolName = 'DragProbe';
131
130
  export default DragProbeTool;
@@ -10,7 +10,7 @@ export interface ETDRSGridAnnotation extends Annotation {
10
10
  };
11
11
  }
12
12
  declare class ETDRSGridTool extends AnnotationTool {
13
- static toolName: any;
13
+ static toolName: string;
14
14
  touchDragCallback: unknown;
15
15
  mouseDragCallback: unknown;
16
16
  editData: {
@@ -13,6 +13,7 @@ import { getCanvasCircleRadius } from '../../utilities/math/circle';
13
13
  import { vec3 } from 'gl-matrix';
14
14
  const CROSSHAIR_SIZE = 5;
15
15
  class ETDRSGridTool extends AnnotationTool {
16
+ static { this.toolName = 'ETDRSGrid'; }
16
17
  constructor(toolProps = {}, defaultToolProps = {
17
18
  supportedInteractionTypes: ['Mouse', 'Touch'],
18
19
  configuration: {
@@ -350,5 +351,4 @@ class ETDRSGridTool extends AnnotationTool {
350
351
  return distance;
351
352
  }
352
353
  }
353
- ETDRSGridTool.toolName = 'ETDRSGrid';
354
354
  export default ETDRSGridTool;
@@ -3,7 +3,7 @@ import type { Types } from '@cornerstonejs/core';
3
3
  import type { EventTypes, ToolHandle, PublicToolProps, ToolProps, SVGDrawingHelper, Annotation } from '../../types';
4
4
  import type { EllipticalROIAnnotation } from '../../types/ToolSpecificAnnotationTypes';
5
5
  declare class EllipticalROITool extends AnnotationTool {
6
- static toolName: any;
6
+ static toolName: string;
7
7
  _throttledCalculateCachedStats: Function;
8
8
  editData: {
9
9
  annotation: Annotation;
@@ -20,6 +20,7 @@ import { isViewportPreScaled } from '../../utilities/viewport/isViewportPreScale
20
20
  import { BasicStatsCalculator } from '../../utilities/math/basic';
21
21
  const { transformWorldToIndex } = csUtils;
22
22
  class EllipticalROITool extends AnnotationTool {
23
+ static { this.toolName = 'EllipticalROI'; }
23
24
  constructor(toolProps = {}, defaultToolProps = {
24
25
  supportedInteractionTypes: ['Mouse', 'Touch'],
25
26
  configuration: {
@@ -706,5 +707,4 @@ function defaultGetTextLines(data, targetId) {
706
707
  }
707
708
  return textLines;
708
709
  }
709
- EllipticalROITool.toolName = 'EllipticalROI';
710
710
  export default EllipticalROITool;
@@ -3,7 +3,7 @@ import { AnnotationTool } from '../base';
3
3
  import type { EventTypes, ToolHandle, PublicToolProps, ToolProps, SVGDrawingHelper, Annotation } from '../../types';
4
4
  import type { LengthAnnotation } from '../../types/ToolSpecificAnnotationTypes';
5
5
  declare class HeightTool extends AnnotationTool {
6
- static toolName: any;
6
+ static toolName: string;
7
7
  _throttledCalculateCachedStats: Function;
8
8
  editData: {
9
9
  annotation: Annotation;
@@ -16,6 +16,7 @@ import triggerAnnotationRenderForViewportIds from '../../utilities/triggerAnnota
16
16
  import { resetElementCursor, hideElementCursor, } from '../../cursors/elementCursor';
17
17
  const { transformWorldToIndex } = csUtils;
18
18
  class HeightTool extends AnnotationTool {
19
+ static { this.toolName = 'Height'; }
19
20
  constructor(toolProps = {}, defaultToolProps = {
20
21
  supportedInteractionTypes: ['Mouse', 'Touch'],
21
22
  configuration: {
@@ -430,5 +431,4 @@ function defaultGetTextLines(data, targetId) {
430
431
  const textLines = [`${csUtils.roundNumber(height)} ${unit}`];
431
432
  return textLines;
432
433
  }
433
- HeightTool.toolName = 'Height';
434
434
  export default HeightTool;
@@ -2,7 +2,7 @@ import type { Types } from '@cornerstonejs/core';
2
2
  import { AnnotationTool } from '../base';
3
3
  import type { EventTypes, ToolHandle, PublicToolProps, ToolProps, SVGDrawingHelper, Annotation } from '../../types';
4
4
  declare class KeyImageTool extends AnnotationTool {
5
- static toolName: any;
5
+ static toolName: string;
6
6
  _throttledCalculateCachedStats: Function;
7
7
  editData: {
8
8
  annotation: Annotation;
@@ -9,6 +9,7 @@ import { getViewportIdsWithToolToRender } from '../../utilities/viewportFilters'
9
9
  import triggerAnnotationRenderForViewportIds from '../../utilities/triggerAnnotationRenderForViewportIds';
10
10
  import { resetElementCursor } from '../../cursors/elementCursor';
11
11
  class KeyImageTool extends AnnotationTool {
12
+ static { this.toolName = 'KeyImage'; }
12
13
  constructor(toolProps = {}, defaultToolProps = {
13
14
  supportedInteractionTypes: ['Mouse', 'Touch'],
14
15
  configuration: {
@@ -24,7 +25,7 @@ class KeyImageTool extends AnnotationTool {
24
25
  const { element } = eventDetail;
25
26
  const enabledElement = getEnabledElement(element);
26
27
  const { viewport } = enabledElement;
27
- const annotation = KeyImageTool.createAnnotationForViewport(viewport);
28
+ const annotation = (this.constructor).createAnnotationForViewport(viewport);
28
29
  addAnnotation(annotation, element);
29
30
  const viewportIdsToRender = getViewportIdsWithToolToRender(element, this.getToolName());
30
31
  evt.preventDefault();
@@ -169,5 +170,4 @@ function getTextCallback(doneChangingTextCallback) {
169
170
  function changeTextCallback(data, eventData, doneChangingTextCallback) {
170
171
  return doneChangingTextCallback(prompt('Enter your annotation:'));
171
172
  }
172
- KeyImageTool.toolName = 'KeyImage';
173
173
  export default KeyImageTool;
@@ -3,7 +3,7 @@ import { AnnotationTool } from '../base';
3
3
  import type { EventTypes, ToolHandle, PublicToolProps, ToolProps, SVGDrawingHelper, Annotation } from '../../types';
4
4
  import type { LengthAnnotation } from '../../types/ToolSpecificAnnotationTypes';
5
5
  declare class LengthTool extends AnnotationTool {
6
- static toolName: any;
6
+ static toolName: string;
7
7
  _throttledCalculateCachedStats: Function;
8
8
  editData: {
9
9
  annotation: Annotation;
@@ -16,6 +16,7 @@ import triggerAnnotationRenderForViewportIds from '../../utilities/triggerAnnota
16
16
  import { resetElementCursor, hideElementCursor, } from '../../cursors/elementCursor';
17
17
  const { transformWorldToIndex } = csUtils;
18
18
  class LengthTool extends AnnotationTool {
19
+ static { this.toolName = 'Length'; }
19
20
  constructor(toolProps = {}, defaultToolProps = {
20
21
  supportedInteractionTypes: ['Mouse', 'Touch'],
21
22
  configuration: {
@@ -464,5 +465,4 @@ function defaultGetTextLines(data, targetId) {
464
465
  const textLines = [`${csUtils.roundNumber(length)} ${unit}`];
465
466
  return textLines;
466
467
  }
467
- LengthTool.toolName = 'Length';
468
468
  export default LengthTool;
@@ -2,7 +2,7 @@ import type { Types } from '@cornerstonejs/core';
2
2
  import LivewireContourTool from './LivewireContourTool';
3
3
  import type { ContourSegmentationAnnotation } from '../../types';
4
4
  declare class LivewireContourSegmentationTool extends LivewireContourTool {
5
- static toolName: any;
5
+ static toolName: string;
6
6
  updateInterpolatedAnnotation(annotation: ContourSegmentationAnnotation, enabledElement: Types.IEnabledElement): void;
7
7
  protected renderAnnotationInstance(renderContext: any): boolean;
8
8
  protected isContourSegmentationTool(): boolean;
@@ -5,6 +5,7 @@ import { triggerAnnotationModified } from '../../stateManagement/annotation/help
5
5
  import { ChangeTypes } from '../../enums';
6
6
  import { drawPolyline as drawPolylineSvg } from '../../drawingSvg';
7
7
  class LivewireContourSegmentationTool extends LivewireContourTool {
8
+ static { this.toolName = 'LivewireContourSegmentationTool'; }
8
9
  updateInterpolatedAnnotation(annotation, enabledElement) {
9
10
  if (this.editData ||
10
11
  !annotation.invalidated ||
@@ -85,5 +86,4 @@ class LivewireContourSegmentationTool extends LivewireContourTool {
85
86
  return true;
86
87
  }
87
88
  }
88
- LivewireContourSegmentationTool.toolName = 'LivewireContourSegmentationTool';
89
89
  export default LivewireContourSegmentationTool;
@@ -19,6 +19,7 @@ import { getTextBoxCoordsCanvas } from '../../utilities/drawing';
19
19
  import { getCalibratedLengthUnitsAndScale, throttle } from '../../utilities';
20
20
  const CLICK_CLOSE_CURVE_SQR_DIST = 10 ** 2;
21
21
  class LivewireContourTool extends ContourSegmentationBaseTool {
22
+ static { this.toolName = 'LivewireContour'; }
22
23
  constructor(toolProps = {}, defaultToolProps = {
23
24
  supportedInteractionTypes: ['Mouse', 'Touch'],
24
25
  configuration: {
@@ -643,7 +644,6 @@ class LivewireContourTool extends ContourSegmentationBaseTool {
643
644
  });
644
645
  }
645
646
  }
646
- LivewireContourTool.toolName = 'LivewireContour';
647
647
  export default LivewireContourTool;
648
648
  function defaultGetTextLines(data, targetId) {
649
649
  const cachedVolumeStats = data.cachedStats[targetId];
@@ -1,7 +1,7 @@
1
1
  import type { AnnotationRenderContext, PublicToolProps } from '../../types';
2
2
  import PlanarFreehandROITool from './PlanarFreehandROITool';
3
3
  declare class PlanarFreehandContourSegmentationTool extends PlanarFreehandROITool {
4
- static toolName: any;
4
+ static toolName: string;
5
5
  constructor(toolProps: PublicToolProps);
6
6
  protected isContourSegmentationTool(): boolean;
7
7
  protected renderAnnotationInstance(renderContext: AnnotationRenderContext): boolean;
@@ -2,6 +2,7 @@ import { utilities } from '@cornerstonejs/core';
2
2
  import { triggerSegmentationDataModified } from '../../stateManagement/segmentation/triggerSegmentationEvents';
3
3
  import PlanarFreehandROITool from './PlanarFreehandROITool';
4
4
  class PlanarFreehandContourSegmentationTool extends PlanarFreehandROITool {
5
+ static { this.toolName = 'PlanarFreehandContourSegmentationTool'; }
5
6
  constructor(toolProps) {
6
7
  const initialProps = utilities.deepMerge({
7
8
  configuration: {
@@ -25,6 +26,4 @@ class PlanarFreehandContourSegmentationTool extends PlanarFreehandROITool {
25
26
  return renderResult;
26
27
  }
27
28
  }
28
- PlanarFreehandContourSegmentationTool.toolName =
29
- 'PlanarFreehandContourSegmentationTool';
30
29
  export default PlanarFreehandContourSegmentationTool;
@@ -3,7 +3,7 @@ import type { EventTypes, ToolHandle, Annotations, PublicToolProps, ToolProps, A
3
3
  import type { ContourAnnotation, PlanarFreehandROIAnnotation } from '../../types/ToolSpecificAnnotationTypes';
4
4
  import ContourSegmentationBaseTool from '../base/ContourSegmentationBaseTool';
5
5
  declare class PlanarFreehandROITool extends ContourSegmentationBaseTool {
6
- static toolName: any;
6
+ static toolName: string;
7
7
  _throttledCalculateCachedStats: Function;
8
8
  private commonData?;
9
9
  isDrawing: boolean;
@@ -27,6 +27,7 @@ const { pointCanProjectOnLine } = polyline;
27
27
  const { EPSILON } = CONSTANTS;
28
28
  const PARALLEL_THRESHOLD = 1 - EPSILON;
29
29
  class PlanarFreehandROITool extends ContourSegmentationBaseTool {
30
+ static { this.toolName = 'PlanarFreehandROI'; }
30
31
  constructor(toolProps = {}, defaultToolProps = {
31
32
  supportedInteractionTypes: ['Mouse', 'Touch'],
32
33
  configuration: {
@@ -526,5 +527,4 @@ function defaultGetTextLines(data, targetId) {
526
527
  }
527
528
  return textLines;
528
529
  }
529
- PlanarFreehandROITool.toolName = 'PlanarFreehandROI';
530
530
  export default PlanarFreehandROITool;
@@ -4,7 +4,7 @@ import { ChangeTypes } from '../../enums';
4
4
  import type { EventTypes, ToolHandle, PublicToolProps, SVGDrawingHelper, Annotation } from '../../types';
5
5
  import type { ProbeAnnotation } from '../../types/ToolSpecificAnnotationTypes';
6
6
  declare class ProbeTool extends AnnotationTool {
7
- static toolName: any;
7
+ static toolName: string;
8
8
  editData: {
9
9
  annotation: Annotation;
10
10
  viewportIdsToRender: string[];
@@ -14,6 +14,7 @@ import { getPixelValueUnits } from '../../utilities/getPixelValueUnits';
14
14
  import { isViewportPreScaled } from '../../utilities/viewport/isViewportPreScaled';
15
15
  const { transformWorldToIndex } = csUtils;
16
16
  class ProbeTool extends AnnotationTool {
17
+ static { this.toolName = 'Probe'; }
17
18
  static { this.probeDefaults = {
18
19
  supportedInteractionTypes: ['Mouse', 'Touch'],
19
20
  configuration: {
@@ -32,7 +33,7 @@ class ProbeTool extends AnnotationTool {
32
33
  const enabledElement = getEnabledElement(element);
33
34
  const { viewport } = enabledElement;
34
35
  this.isDrawing = true;
35
- const annotation = ProbeTool.createAnnotationForViewport(viewport, {
36
+ const annotation = (this.constructor).createAnnotationForViewport(viewport, {
36
37
  data: {
37
38
  handles: { points: [[...worldPos]] },
38
39
  },
@@ -359,5 +360,4 @@ function defaultGetTextLines(data, targetId) {
359
360
  }
360
361
  return textLines;
361
362
  }
362
- ProbeTool.toolName = 'Probe';
363
363
  export default ProbeTool;
@@ -3,7 +3,7 @@ import type { Types } from '@cornerstonejs/core';
3
3
  import type { EventTypes, ToolHandle, ToolProps, PublicToolProps, SVGDrawingHelper, Annotation } from '../../types';
4
4
  import type { RectangleROIAnnotation } from '../../types/ToolSpecificAnnotationTypes';
5
5
  declare class RectangleROITool extends AnnotationTool {
6
- static toolName: any;
6
+ static toolName: string;
7
7
  _throttledCalculateCachedStats: Function;
8
8
  editData: {
9
9
  annotation: Annotation;
@@ -20,6 +20,7 @@ import { isViewportPreScaled } from '../../utilities/viewport/isViewportPreScale
20
20
  import { BasicStatsCalculator } from '../../utilities/math/basic';
21
21
  const { transformWorldToIndex } = csUtils;
22
22
  class RectangleROITool extends AnnotationTool {
23
+ static { this.toolName = 'RectangleROI'; }
23
24
  constructor(toolProps = {}, defaultToolProps = {
24
25
  supportedInteractionTypes: ['Mouse', 'Touch'],
25
26
  configuration: {
@@ -38,7 +39,7 @@ class RectangleROITool extends AnnotationTool {
38
39
  const enabledElement = getEnabledElement(element);
39
40
  const { viewport } = enabledElement;
40
41
  this.isDrawing = true;
41
- const annotation = RectangleROITool.createAnnotationForViewport(viewport, {
42
+ const annotation = (this.constructor).createAnnotationForViewport(viewport, {
42
43
  data: {
43
44
  handles: {
44
45
  points: [
@@ -562,5 +563,4 @@ function defaultGetTextLines(data, targetId) {
562
563
  textLines.push(`Std Dev: ${csUtils.roundNumber(stdDev)} ${modalityUnit}`);
563
564
  return textLines;
564
565
  }
565
- RectangleROITool.toolName = 'RectangleROI';
566
566
  export default RectangleROITool;
@@ -6,7 +6,7 @@ type RegionSegmentPlusToolData = GrowCutToolData & {
6
6
  worldPoint: Types.Point3;
7
7
  };
8
8
  declare class RegionSegmentPlusTool extends GrowCutBaseTool {
9
- static toolName: any;
9
+ static toolName: string;
10
10
  protected growCutData: RegionSegmentPlusToolData | null;
11
11
  constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
12
12
  preMouseDownCallback(evt: EventTypes.MouseDownActivateEventType): Promise<boolean>;
@@ -2,6 +2,7 @@ import { getRenderingEngine, utilities as csUtils } from '@cornerstonejs/core';
2
2
  import { growCut } from '../../utilities/segmentation';
3
3
  import GrowCutBaseTool from '../base/GrowCutBaseTool';
4
4
  class RegionSegmentPlusTool extends GrowCutBaseTool {
5
+ static { this.toolName = 'RegionSegmentPlus'; }
5
6
  constructor(toolProps = {}, defaultToolProps = {
6
7
  supportedInteractionTypes: ['Mouse', 'Touch'],
7
8
  configuration: {
@@ -51,5 +52,4 @@ class RegionSegmentPlusTool extends GrowCutBaseTool {
51
52
  return growCut.runOneClickGrowCut(referencedVolumeId, worldPoint, viewport, mergedOptions);
52
53
  }
53
54
  }
54
- RegionSegmentPlusTool.toolName = 'RegionSegmentPlus';
55
55
  export default RegionSegmentPlusTool;
@@ -7,7 +7,7 @@ type RegionSegmentToolData = GrowCutToolData & {
7
7
  circleBorderPoint: Types.Point3;
8
8
  };
9
9
  declare class RegionSegmentTool extends GrowCutBaseTool {
10
- static toolName: any;
10
+ static toolName: string;
11
11
  protected growCutData: RegionSegmentToolData | null;
12
12
  constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
13
13
  preMouseDownCallback(evt: EventTypes.MouseDownActivateEventType): Promise<boolean>;
@@ -7,6 +7,7 @@ import triggerAnnotationRenderForViewportUIDs from '../../utilities/triggerAnnot
7
7
  import { growCut } from '../../utilities/segmentation';
8
8
  import GrowCutBaseTool from '../base/GrowCutBaseTool';
9
9
  class RegionSegmentTool extends GrowCutBaseTool {
10
+ static { this.toolName = 'RegionSegment'; }
10
11
  constructor(toolProps = {}, defaultToolProps = {
11
12
  supportedInteractionTypes: ['Mouse', 'Touch'],
12
13
  configuration: {
@@ -98,5 +99,4 @@ class RegionSegmentTool extends GrowCutBaseTool {
98
99
  });
99
100
  }
100
101
  }
101
- RegionSegmentTool.toolName = 'RegionSegment';
102
102
  export default RegionSegmentTool;
@@ -1,7 +1,7 @@
1
1
  import type { PublicToolProps } from '../../types';
2
2
  import SplineROITool from './SplineROITool';
3
3
  declare class SplineContourSegmentationTool extends SplineROITool {
4
- static toolName: any;
4
+ static toolName: string;
5
5
  constructor(toolProps: PublicToolProps);
6
6
  protected isContourSegmentationTool(): boolean;
7
7
  }
@@ -1,6 +1,7 @@
1
1
  import { utilities } from '@cornerstonejs/core';
2
2
  import SplineROITool from './SplineROITool';
3
3
  class SplineContourSegmentationTool extends SplineROITool {
4
+ static { this.toolName = 'SplineContourSegmentationTool'; }
4
5
  constructor(toolProps) {
5
6
  const initialProps = utilities.deepMerge({
6
7
  configuration: {
@@ -13,5 +14,4 @@ class SplineContourSegmentationTool extends SplineROITool {
13
14
  return true;
14
15
  }
15
16
  }
16
- SplineContourSegmentationTool.toolName = 'SplineContourSegmentationTool';
17
17
  export default SplineContourSegmentationTool;
@@ -14,7 +14,7 @@ declare enum SplineToolActions {
14
14
  DeleteControlPoint = "deleteControlPoint"
15
15
  }
16
16
  declare class SplineROITool extends ContourSegmentationBaseTool {
17
- static toolName: any;
17
+ static toolName: string;
18
18
  static SplineTypes: typeof SplineTypesEnum;
19
19
  static Actions: typeof SplineToolActions;
20
20
  _throttledCalculateCachedStats: Function;
@@ -41,6 +41,7 @@ var SplineToolActions;
41
41
  SplineToolActions["DeleteControlPoint"] = "deleteControlPoint";
42
42
  })(SplineToolActions || (SplineToolActions = {}));
43
43
  class SplineROITool extends ContourSegmentationBaseTool {
44
+ static { this.toolName = 'SplineROI'; }
44
45
  static { this.SplineTypes = SplineTypesEnum; }
45
46
  static { this.Actions = SplineToolActions; }
46
47
  constructor(toolProps = {}, defaultToolProps = {
@@ -784,5 +785,4 @@ function defaultGetTextLines(data, targetId) {
784
785
  }
785
786
  return textLines;
786
787
  }
787
- SplineROITool.toolName = 'SplineROI';
788
788
  export default SplineROITool;
@@ -3,7 +3,7 @@ import { AnnotationTool } from '../base';
3
3
  import type { UltrasoundDirectionalAnnotation } from '../../types/ToolSpecificAnnotationTypes';
4
4
  import type { EventTypes, ToolHandle, PublicToolProps, ToolProps, SVGDrawingHelper, Annotation, InteractionTypes } from '../../types';
5
5
  declare class UltrasoundDirectionalTool extends AnnotationTool {
6
- static toolName: any;
6
+ static toolName: string;
7
7
  startedDrawing: boolean;
8
8
  _throttledCalculateCachedStats: Function;
9
9
  editData: {
@@ -13,6 +13,7 @@ import { resetElementCursor, hideElementCursor, } from '../../cursors/elementCur
13
13
  import { getCalibratedProbeUnitsAndValue } from '../../utilities/getCalibratedUnits';
14
14
  const { transformWorldToIndex } = csUtils;
15
15
  class UltrasoundDirectionalTool extends AnnotationTool {
16
+ static { this.toolName = 'UltrasoundDirectionalTool'; }
16
17
  constructor(toolProps = {}, defaultToolProps = {
17
18
  supportedInteractionTypes: ['Mouse', 'Touch'],
18
19
  configuration: {
@@ -457,5 +458,4 @@ function defaultGetTextLines(data, targetId, configuration) {
457
458
  return [`${csUtils.roundNumber(dist)} ${units[1]}`];
458
459
  }
459
460
  }
460
- UltrasoundDirectionalTool.toolName = 'UltrasoundDirectionalTool';
461
461
  export default UltrasoundDirectionalTool;
@@ -3,6 +3,7 @@ import { AnnotationTool } from '../base';
3
3
  import type { Annotation, EventTypes, SVGDrawingHelper } from '../../types';
4
4
  import type { VideoRedactionAnnotation } from '../../types/ToolSpecificAnnotationTypes';
5
5
  declare class VideoRedactionTool extends AnnotationTool {
6
+ static toolName: string;
6
7
  _throttledCalculateCachedStats: Function;
7
8
  editData: {
8
9
  annotation: Annotation;
@@ -12,6 +12,7 @@ import { resetElementCursor, hideElementCursor, } from '../../cursors/elementCur
12
12
  import triggerAnnotationRenderForViewportIds from '../../utilities/triggerAnnotationRenderForViewportIds';
13
13
  import getWorldWidthAndHeightFromTwoPoints from '../../utilities/planar/getWorldWidthAndHeightFromTwoPoints';
14
14
  class VideoRedactionTool extends AnnotationTool {
15
+ static { this.toolName = 'VideoRedaction'; }
15
16
  constructor(toolConfiguration = {}) {
16
17
  super(toolConfiguration, {
17
18
  supportedInteractionTypes: ['Mouse', 'Touch'],
@@ -24,7 +25,7 @@ class VideoRedactionTool extends AnnotationTool {
24
25
  const enabledElement = getEnabledElement(element);
25
26
  const { viewport } = enabledElement;
26
27
  this.isDrawing = true;
27
- const annotation = VideoRedactionTool.createAnnotationForViewport(viewport, {
28
+ const annotation = (this.constructor).createAnnotationForViewport(viewport, {
28
29
  data: {
29
30
  handles: {
30
31
  points: [
@@ -438,5 +439,4 @@ class VideoRedactionTool extends AnnotationTool {
438
439
  return `stackTarget:${viewport.uid}`;
439
440
  }
440
441
  }
441
- VideoRedactionTool.toolName = 'VideoRedaction';
442
442
  export default VideoRedactionTool;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/tools",
3
- "version": "2.18.0",
3
+ "version": "2.18.2",
4
4
  "description": "Cornerstone3D Tools",
5
5
  "types": "./dist/esm/index.d.ts",
6
6
  "module": "./dist/esm/index.js",
@@ -104,7 +104,7 @@
104
104
  "canvas": "^2.11.2"
105
105
  },
106
106
  "peerDependencies": {
107
- "@cornerstonejs/core": "^2.18.0",
107
+ "@cornerstonejs/core": "^2.18.2",
108
108
  "@kitware/vtk.js": "32.9.0",
109
109
  "@types/d3-array": "^3.0.4",
110
110
  "@types/d3-interpolate": "^3.0.1",
@@ -123,5 +123,5 @@
123
123
  "type": "individual",
124
124
  "url": "https://ohif.org/donate"
125
125
  },
126
- "gitHead": "840f20730a281b4a044cc2b059c16371a80c80bc"
126
+ "gitHead": "c6d2ca65ddc3514c22b49c6c2549f4871e8ae9b1"
127
127
  }