@cornerstonejs/tools 2.0.0-beta.20 → 2.0.0-beta.21

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 (485) hide show
  1. package/dist/esm/cursors/SVGCursorDescriptor.d.ts +1 -1
  2. package/dist/esm/cursors/SVGCursorDescriptor.js +7 -0
  3. package/dist/esm/cursors/SVGMouseCursor.d.ts +1 -1
  4. package/dist/esm/drawingSvg/draw.d.ts +2 -1
  5. package/dist/esm/drawingSvg/drawArrow.d.ts +1 -1
  6. package/dist/esm/drawingSvg/drawCircle.d.ts +1 -1
  7. package/dist/esm/drawingSvg/drawEllipse.d.ts +1 -1
  8. package/dist/esm/drawingSvg/drawEllipse.js +1 -0
  9. package/dist/esm/drawingSvg/drawEllipseByCoordinates.d.ts +1 -1
  10. package/dist/esm/drawingSvg/drawHandle.d.ts +1 -1
  11. package/dist/esm/drawingSvg/drawHandles.d.ts +1 -1
  12. package/dist/esm/drawingSvg/drawHeight.d.ts +3 -0
  13. package/dist/esm/drawingSvg/drawHeight.js +42 -0
  14. package/dist/esm/drawingSvg/drawLine.d.ts +1 -1
  15. package/dist/esm/drawingSvg/drawLink.d.ts +1 -1
  16. package/dist/esm/drawingSvg/drawLinkedTextBox.d.ts +1 -1
  17. package/dist/esm/drawingSvg/drawPath.d.ts +1 -1
  18. package/dist/esm/drawingSvg/drawPolyline.d.ts +1 -1
  19. package/dist/esm/drawingSvg/drawRect.d.ts +1 -1
  20. package/dist/esm/drawingSvg/drawRect.js +1 -0
  21. package/dist/esm/drawingSvg/drawRectByCoordinates.d.ts +1 -1
  22. package/dist/esm/drawingSvg/drawRedactionRect.d.ts +3 -1
  23. package/dist/esm/drawingSvg/drawTextBox.d.ts +1 -1
  24. package/dist/esm/drawingSvg/getSvgDrawingHelper.d.ts +1 -1
  25. package/dist/esm/drawingSvg/getSvgDrawingHelper.js +1 -1
  26. package/dist/esm/drawingSvg/index.d.ts +2 -1
  27. package/dist/esm/drawingSvg/index.js +2 -1
  28. package/dist/esm/enums/ToolBindings.d.ts +3 -1
  29. package/dist/esm/enums/ToolBindings.js +2 -0
  30. package/dist/esm/eventDispatchers/keyboardEventHandlers/keyDown.d.ts +1 -1
  31. package/dist/esm/eventDispatchers/keyboardEventHandlers/keyUp.d.ts +1 -1
  32. package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDown.d.ts +1 -1
  33. package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownActivate.d.ts +1 -1
  34. package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownAnnotationAction.d.ts +1 -1
  35. package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDrag.d.ts +1 -1
  36. package/dist/esm/eventDispatchers/mouseEventHandlers/mouseMove.d.ts +1 -1
  37. package/dist/esm/eventDispatchers/mouseEventHandlers/mouseWheel.d.ts +2 -1
  38. package/dist/esm/eventDispatchers/mouseEventHandlers/mouseWheel.js +15 -2
  39. package/dist/esm/eventDispatchers/shared/getActiveToolForKeyboardEvent.d.ts +1 -1
  40. package/dist/esm/eventDispatchers/shared/getActiveToolForMouseEvent.d.ts +1 -1
  41. package/dist/esm/eventDispatchers/shared/getActiveToolForMouseEvent.js +3 -4
  42. package/dist/esm/eventDispatchers/shared/getActiveToolForTouchEvent.d.ts +1 -1
  43. package/dist/esm/eventDispatchers/shared/getActiveToolForTouchEvent.js +1 -1
  44. package/dist/esm/eventDispatchers/shared/getToolsWithActionsForKeyboardEvents.d.ts +2 -2
  45. package/dist/esm/eventDispatchers/shared/getToolsWithActionsForMouseEvent.d.ts +4 -3
  46. package/dist/esm/eventDispatchers/shared/getToolsWithModesForMouseEvent.d.ts +3 -3
  47. package/dist/esm/eventDispatchers/shared/getToolsWithModesForTouchEvent.d.ts +2 -2
  48. package/dist/esm/eventDispatchers/touchEventHandlers/touchDrag.d.ts +1 -1
  49. package/dist/esm/eventDispatchers/touchEventHandlers/touchStart.d.ts +1 -1
  50. package/dist/esm/eventDispatchers/touchEventHandlers/touchStartActivate.d.ts +1 -1
  51. package/dist/esm/eventListeners/annotations/annotationCompletedListener.d.ts +1 -1
  52. package/dist/esm/eventListeners/annotations/annotationRemovedListener.d.ts +1 -1
  53. package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.d.ts +3 -3
  54. package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js +1 -1
  55. package/dist/esm/eventListeners/mouse/getMouseEventPoints.d.ts +1 -1
  56. package/dist/esm/eventListeners/mouse/getMouseEventPoints.js +4 -1
  57. package/dist/esm/eventListeners/mouse/mouseDownListener.js +9 -1
  58. package/dist/esm/eventListeners/segmentation/imageChangeEventListener.js +6 -6
  59. package/dist/esm/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.d.ts +1 -1
  60. package/dist/esm/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js +3 -3
  61. package/dist/esm/eventListeners/segmentation/segmentationDataModifiedEventListener.d.ts +1 -1
  62. package/dist/esm/eventListeners/segmentation/segmentationDataModifiedEventListener.js +2 -2
  63. package/dist/esm/eventListeners/segmentation/segmentationModifiedEventListener.d.ts +1 -1
  64. package/dist/esm/eventListeners/segmentation/segmentationModifiedEventListener.js +3 -2
  65. package/dist/esm/eventListeners/segmentation/segmentationRepresentationModifiedEventListener.d.ts +1 -1
  66. package/dist/esm/eventListeners/segmentation/segmentationRepresentationModifiedEventListener.js +5 -5
  67. package/dist/esm/eventListeners/segmentation/segmentationRepresentationRemovedEventListener.d.ts +1 -1
  68. package/dist/esm/eventListeners/segmentation/segmentationRepresentationRemovedEventListener.js +4 -2
  69. package/dist/esm/eventListeners/touch/getTouchEventPoints.d.ts +1 -1
  70. package/dist/esm/index.d.ts +2 -2
  71. package/dist/esm/index.js +2 -2
  72. package/dist/esm/stateManagement/annotation/AnnotationRenderingEngine.d.ts +20 -0
  73. package/dist/esm/stateManagement/annotation/AnnotationRenderingEngine.js +112 -0
  74. package/dist/esm/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.d.ts +3 -3
  75. package/dist/esm/stateManagement/annotation/annotationLocking.d.ts +1 -1
  76. package/dist/esm/stateManagement/annotation/annotationState.d.ts +2 -2
  77. package/dist/esm/stateManagement/annotation/annotationVisibility.d.ts +1 -1
  78. package/dist/esm/stateManagement/annotation/config/ToolStyle.d.ts +1 -1
  79. package/dist/esm/stateManagement/annotation/config/getFont.d.ts +2 -2
  80. package/dist/esm/stateManagement/annotation/config/getState.d.ts +1 -1
  81. package/dist/esm/stateManagement/annotation/config/helpers.d.ts +2 -2
  82. package/dist/esm/stateManagement/annotation/helpers/state.d.ts +2 -2
  83. package/dist/esm/stateManagement/annotation/utilities/defineProperties.d.ts +1 -1
  84. package/dist/esm/stateManagement/index.d.ts +3 -3
  85. package/dist/esm/stateManagement/index.js +2 -2
  86. package/dist/esm/{tools/displayTools → stateManagement/segmentation}/SegmentationRenderingEngine.d.ts +3 -3
  87. package/dist/esm/{tools/displayTools → stateManagement/segmentation}/SegmentationRenderingEngine.js +14 -17
  88. package/dist/esm/stateManagement/segmentation/SegmentationStateManager.d.ts +12 -12
  89. package/dist/esm/stateManagement/segmentation/SegmentationStateManager.js +27 -19
  90. package/dist/esm/stateManagement/segmentation/activeSegmentation.d.ts +5 -4
  91. package/dist/esm/stateManagement/segmentation/activeSegmentation.js +12 -5
  92. package/dist/esm/stateManagement/segmentation/addRepresentationData.d.ts +3 -3
  93. package/dist/esm/stateManagement/segmentation/addSegmentationRepresentation.d.ts +3 -0
  94. package/dist/esm/stateManagement/segmentation/{addRepresentation.js → addSegmentationRepresentation.js} +6 -6
  95. package/dist/esm/stateManagement/segmentation/addSegmentationRepresentations.d.ts +3 -0
  96. package/dist/esm/stateManagement/segmentation/addSegmentationRepresentations.js +9 -0
  97. package/dist/esm/stateManagement/segmentation/addSegmentations.d.ts +1 -1
  98. package/dist/esm/stateManagement/segmentation/config/index.d.ts +2 -2
  99. package/dist/esm/stateManagement/segmentation/config/index.js +2 -2
  100. package/dist/esm/stateManagement/segmentation/config/segmentationColor.js +2 -2
  101. package/dist/esm/stateManagement/segmentation/config/segmentationConfig.d.ts +5 -5
  102. package/dist/esm/stateManagement/segmentation/config/segmentationConfig.js +5 -5
  103. package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.d.ts +5 -5
  104. package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js +12 -12
  105. package/dist/esm/stateManagement/segmentation/convertStackToVolumeSegmentation.js +3 -7
  106. package/dist/esm/stateManagement/segmentation/convertVolumeToStackSegmentation.js +8 -53
  107. package/dist/esm/stateManagement/segmentation/helpers/clipAndCacheSurfacesForViewport.d.ts +1 -1
  108. package/dist/esm/stateManagement/segmentation/helpers/getSegmentationRepresentationRenderingConfig.d.ts +2 -0
  109. package/dist/esm/stateManagement/segmentation/helpers/{getRepresentationRenderingConfig.js → getSegmentationRepresentationRenderingConfig.js} +2 -2
  110. package/dist/esm/stateManagement/segmentation/helpers/normalizeSegmentationInput.d.ts +1 -1
  111. package/dist/esm/stateManagement/segmentation/helpers/validateSegmentationInput.d.ts +1 -1
  112. package/dist/esm/stateManagement/segmentation/index.d.ts +3 -3
  113. package/dist/esm/stateManagement/segmentation/index.js +3 -3
  114. package/dist/esm/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts +1 -1
  115. package/dist/esm/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.d.ts +2 -2
  116. package/dist/esm/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.js +3 -3
  117. package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.d.ts +1 -1
  118. package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/extractContourData.d.ts +2 -2
  119. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.d.ts +1 -1
  120. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.d.ts +1 -1
  121. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js +12 -21
  122. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.d.ts +2 -2
  123. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js +2 -6
  124. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.d.ts +2 -2
  125. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js +8 -13
  126. package/dist/esm/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.d.ts +1 -1
  127. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.d.ts +2 -2
  128. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js +2 -1
  129. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.d.ts +2 -2
  130. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js +2 -2
  131. package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.d.ts +2 -2
  132. package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js +2 -2
  133. package/dist/esm/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.d.ts +1 -1
  134. package/dist/esm/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js +4 -3
  135. package/dist/esm/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js +2 -2
  136. package/dist/esm/stateManagement/segmentation/polySeg/computeAndAddRepresentation.d.ts +1 -1
  137. package/dist/esm/stateManagement/segmentation/removeSegmentationRepresentations.d.ts +2 -0
  138. package/dist/esm/stateManagement/segmentation/{removeRepresentationsFromViewport.js → removeSegmentationRepresentations.js} +9 -6
  139. package/dist/esm/stateManagement/segmentation/segmentIndex.js +2 -2
  140. package/dist/esm/stateManagement/segmentation/segmentLocking.d.ts +2 -2
  141. package/dist/esm/stateManagement/segmentation/segmentLocking.js +2 -2
  142. package/dist/esm/stateManagement/segmentation/segmentationState.d.ts +16 -16
  143. package/dist/esm/stateManagement/segmentation/segmentationState.js +30 -30
  144. package/dist/esm/store/SynchronizerManager/Synchronizer.d.ts +7 -3
  145. package/dist/esm/store/SynchronizerManager/Synchronizer.js +2 -1
  146. package/dist/esm/store/SynchronizerManager/createSynchronizer.d.ts +3 -3
  147. package/dist/esm/store/SynchronizerManager/createSynchronizer.js +1 -1
  148. package/dist/esm/store/SynchronizerManager/getAllSynchronizers.d.ts +1 -1
  149. package/dist/esm/store/SynchronizerManager/getSynchronizer.d.ts +1 -1
  150. package/dist/esm/store/SynchronizerManager/getSynchronizersForViewport.d.ts +1 -1
  151. package/dist/esm/store/ToolGroupManager/ToolGroup.d.ts +3 -3
  152. package/dist/esm/store/ToolGroupManager/ToolGroup.js +5 -2
  153. package/dist/esm/store/ToolGroupManager/createToolGroup.d.ts +1 -1
  154. package/dist/esm/store/ToolGroupManager/destroyToolGroup.js +1 -0
  155. package/dist/esm/store/ToolGroupManager/getAllToolGroups.d.ts +1 -1
  156. package/dist/esm/store/ToolGroupManager/getToolGroup.d.ts +1 -1
  157. package/dist/esm/store/ToolGroupManager/getToolGroupForViewport.d.ts +1 -1
  158. package/dist/esm/store/ToolGroupManager/getToolGroupsWithToolName.d.ts +1 -1
  159. package/dist/esm/store/addEnabledElement.d.ts +1 -1
  160. package/dist/esm/store/addEnabledElement.js +1 -1
  161. package/dist/esm/store/addTool.js +0 -3
  162. package/dist/esm/store/filterMoveableAnnotationTools.d.ts +1 -1
  163. package/dist/esm/store/filterToolsWithAnnotationsForElement.d.ts +1 -1
  164. package/dist/esm/store/filterToolsWithMoveableHandles.d.ts +1 -1
  165. package/dist/esm/store/removeEnabledElement.d.ts +1 -1
  166. package/dist/esm/store/removeEnabledElement.js +1 -1
  167. package/dist/esm/store/state.d.ts +4 -3
  168. package/dist/esm/store/state.js +1 -1
  169. package/dist/esm/synchronizers/callbacks/areViewportsCoplanar .d.ts +1 -1
  170. package/dist/esm/synchronizers/callbacks/cameraSyncCallback.d.ts +2 -2
  171. package/dist/esm/synchronizers/callbacks/imageSliceSyncCallback.d.ts +2 -2
  172. package/dist/esm/synchronizers/callbacks/presentationViewSyncCallback.d.ts +1 -1
  173. package/dist/esm/synchronizers/callbacks/slabThicknessSyncCallback.d.ts +1 -1
  174. package/dist/esm/synchronizers/callbacks/voiSyncCallback.d.ts +5 -2
  175. package/dist/esm/synchronizers/callbacks/zoomPanSyncCallback.d.ts +2 -2
  176. package/dist/esm/synchronizers/synchronizers/createCameraPositionSynchronizer.d.ts +1 -1
  177. package/dist/esm/synchronizers/synchronizers/createImageSliceSynchronizer.d.ts +1 -1
  178. package/dist/esm/synchronizers/synchronizers/createPresentationViewSynchronizer.d.ts +2 -2
  179. package/dist/esm/synchronizers/synchronizers/createPresentationViewSynchronizer.js +1 -1
  180. package/dist/esm/synchronizers/synchronizers/createSlabThicknessSynchronizer.d.ts +1 -1
  181. package/dist/esm/synchronizers/synchronizers/createVOISynchronizer.d.ts +1 -1
  182. package/dist/esm/synchronizers/synchronizers/createZoomPanSynchronizer.d.ts +1 -1
  183. package/dist/esm/tools/AdvancedMagnifyTool.d.ts +4 -6
  184. package/dist/esm/tools/AdvancedMagnifyViewport.js +1 -1
  185. package/dist/esm/tools/AdvancedMagnifyViewportManager.d.ts +3 -2
  186. package/dist/esm/tools/AdvancedMagnifyViewportManager.js +1 -1
  187. package/dist/esm/tools/AnnotationEraserTool.d.ts +1 -1
  188. package/dist/esm/tools/CrosshairsTool.d.ts +5 -5
  189. package/dist/esm/tools/CrosshairsTool.js +4 -3
  190. package/dist/esm/tools/MIPJumpToClickTool.d.ts +1 -2
  191. package/dist/esm/tools/MIPJumpToClickTool.js +2 -3
  192. package/dist/esm/tools/MagnifyTool.d.ts +2 -3
  193. package/dist/esm/tools/OrientationMarkerTool.d.ts +41 -58
  194. package/dist/esm/tools/OrientationMarkerTool.js +8 -7
  195. package/dist/esm/tools/OverlayGridTool.d.ts +2 -4
  196. package/dist/esm/tools/OverlayGridTool.js +1 -1
  197. package/dist/esm/tools/PanTool.d.ts +1 -1
  198. package/dist/esm/tools/PanTool.js +5 -0
  199. package/dist/esm/tools/PlanarRotateTool.d.ts +3 -1
  200. package/dist/esm/tools/PlanarRotateTool.js +18 -4
  201. package/dist/esm/tools/ReferenceCursors.d.ts +2 -5
  202. package/dist/esm/tools/ReferenceLinesTool.d.ts +4 -6
  203. package/dist/esm/tools/ReferenceLinesTool.js +1 -1
  204. package/dist/esm/tools/ScaleOverlayTool.d.ts +7 -9
  205. package/dist/esm/tools/ScaleOverlayTool.js +1 -2
  206. package/dist/esm/tools/SculptorTool/CircleSculptCursor.d.ts +4 -4
  207. package/dist/esm/tools/SculptorTool.d.ts +1 -1
  208. package/dist/esm/tools/SegmentationIntersectionTool.d.ts +2 -2
  209. package/dist/esm/tools/StackScrollTool.d.ts +2 -1
  210. package/dist/esm/tools/StackScrollTool.js +17 -3
  211. package/dist/esm/tools/StackScrollToolMouseWheelTool.d.ts +1 -2
  212. package/dist/esm/tools/StackScrollToolMouseWheelTool.js +1 -2
  213. package/dist/esm/tools/TrackballRotateTool.d.ts +1 -1
  214. package/dist/esm/tools/TrackballRotateTool.js +4 -0
  215. package/dist/esm/tools/VolumeRotateMouseWheelTool.d.ts +2 -3
  216. package/dist/esm/tools/WindowLevelRegionTool.d.ts +3 -3
  217. package/dist/esm/tools/WindowLevelRegionTool.js +1 -3
  218. package/dist/esm/tools/WindowLevelTool.d.ts +1 -1
  219. package/dist/esm/tools/WindowLevelTool.js +12 -7
  220. package/dist/esm/tools/ZoomTool.d.ts +2 -2
  221. package/dist/esm/tools/ZoomTool.js +2 -2
  222. package/dist/esm/tools/annotation/AngleTool.d.ts +5 -7
  223. package/dist/esm/tools/annotation/ArrowAnnotateTool.d.ts +5 -7
  224. package/dist/esm/tools/annotation/BidirectionalTool.d.ts +5 -7
  225. package/dist/esm/tools/annotation/CircleROITool.d.ts +5 -7
  226. package/dist/esm/tools/annotation/CircleROITool.js +8 -5
  227. package/dist/esm/tools/annotation/CobbAngleTool.d.ts +5 -7
  228. package/dist/esm/tools/annotation/DragProbeTool.d.ts +3 -5
  229. package/dist/esm/tools/annotation/DragProbeTool.js +0 -5
  230. package/dist/esm/tools/annotation/EllipticalROITool.d.ts +5 -7
  231. package/dist/esm/tools/annotation/EllipticalROITool.js +8 -3
  232. package/dist/esm/tools/annotation/HeightTool.d.ts +36 -0
  233. package/dist/esm/tools/annotation/HeightTool.js +435 -0
  234. package/dist/esm/tools/annotation/KeyImageTool.d.ts +4 -6
  235. package/dist/esm/tools/annotation/LengthTool.d.ts +5 -7
  236. package/dist/esm/tools/annotation/LengthTool.js +7 -5
  237. package/dist/esm/tools/annotation/LivewireContourTool.d.ts +3 -4
  238. package/dist/esm/tools/annotation/LivewireContourTool.js +2 -1
  239. package/dist/esm/tools/annotation/PlanarFreehandROITool.d.ts +21 -4
  240. package/dist/esm/tools/annotation/PlanarFreehandROITool.js +155 -113
  241. package/dist/esm/tools/annotation/ProbeTool.d.ts +4 -6
  242. package/dist/esm/tools/annotation/ProbeTool.js +14 -29
  243. package/dist/esm/tools/annotation/RectangleROITool.d.ts +5 -5
  244. package/dist/esm/tools/annotation/RectangleROITool.js +7 -3
  245. package/dist/esm/tools/annotation/SplineContourSegmentationTool.d.ts +1 -1
  246. package/dist/esm/tools/annotation/SplineROITool.d.ts +1 -3
  247. package/dist/esm/tools/annotation/SplineROITool.js +2 -2
  248. package/dist/esm/tools/annotation/UltrasoundDirectionalTool.d.ts +5 -7
  249. package/dist/esm/tools/annotation/VideoRedactionTool.d.ts +4 -5
  250. package/dist/esm/tools/annotation/planarFreehandROITool/findOpenUShapedContourVectorToPeak.d.ts +1 -1
  251. package/dist/esm/tools/annotation/splines/CardinalSpline.d.ts +1 -1
  252. package/dist/esm/tools/annotation/splines/CubicSpline.d.ts +1 -1
  253. package/dist/esm/tools/annotation/splines/QuadraticSpline.d.ts +1 -1
  254. package/dist/esm/tools/annotation/splines/Spline.d.ts +1 -1
  255. package/dist/esm/tools/base/AnnotationDisplayTool.d.ts +3 -3
  256. package/dist/esm/tools/base/AnnotationDisplayTool.js +3 -9
  257. package/dist/esm/tools/base/AnnotationTool.d.ts +3 -14
  258. package/dist/esm/tools/base/BaseTool.d.ts +5 -5
  259. package/dist/esm/tools/base/BaseTool.js +1 -1
  260. package/dist/esm/tools/base/ContourBaseTool.d.ts +1 -1
  261. package/dist/esm/tools/base/ContourBaseTool.js +3 -3
  262. package/dist/esm/tools/base/ContourSegmentationBaseTool.js +10 -10
  263. package/dist/esm/tools/displayTools/Contour/contourConfig.d.ts +1 -1
  264. package/dist/esm/tools/displayTools/Contour/contourDisplay.d.ts +2 -2
  265. package/dist/esm/tools/displayTools/Contour/contourDisplay.js +2 -1
  266. package/dist/esm/tools/displayTools/Contour/contourHandler/handleContourSegmentation.d.ts +2 -2
  267. package/dist/esm/tools/displayTools/Contour/contourHandler/handleContourSegmentation.js +4 -4
  268. package/dist/esm/tools/displayTools/Contour/contourHandler/utils.d.ts +1 -1
  269. package/dist/esm/tools/displayTools/Contour/removeContourFromElement.js +2 -2
  270. package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.d.ts +1 -1
  271. package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.js +3 -3
  272. package/dist/esm/tools/displayTools/Labelmap/labelmapConfig.d.ts +1 -1
  273. package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.d.ts +5 -5
  274. package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js +10 -8
  275. package/dist/esm/tools/displayTools/Labelmap/validateLabelmap.d.ts +2 -2
  276. package/dist/esm/tools/displayTools/Surface/surfaceConfig.d.ts +1 -1
  277. package/dist/esm/tools/displayTools/Surface/surfaceDisplay.d.ts +2 -2
  278. package/dist/esm/tools/distancePointToContour.d.ts +1 -1
  279. package/dist/esm/tools/index.d.ts +2 -1
  280. package/dist/esm/tools/index.js +2 -1
  281. package/dist/esm/tools/segmentation/BrushTool.js +5 -5
  282. package/dist/esm/tools/segmentation/CircleROIStartEndThresholdTool.d.ts +20 -15
  283. package/dist/esm/tools/segmentation/CircleROIStartEndThresholdTool.js +199 -67
  284. package/dist/esm/tools/segmentation/CircleScissorsTool.d.ts +3 -3
  285. package/dist/esm/tools/segmentation/CircleScissorsTool.js +10 -3
  286. package/dist/esm/tools/segmentation/PaintFillTool.d.ts +1 -1
  287. package/dist/esm/tools/segmentation/PaintFillTool.js +15 -14
  288. package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.d.ts +20 -10
  289. package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.js +174 -55
  290. package/dist/esm/tools/segmentation/RectangleROIThresholdTool.d.ts +3 -3
  291. package/dist/esm/tools/segmentation/RectangleScissorsTool.d.ts +4 -3
  292. package/dist/esm/tools/segmentation/RectangleScissorsTool.js +8 -5
  293. package/dist/esm/tools/segmentation/SegmentSelectTool.d.ts +2 -2
  294. package/dist/esm/tools/segmentation/SegmentSelectTool.js +2 -2
  295. package/dist/esm/tools/segmentation/SphereScissorsTool.d.ts +3 -2
  296. package/dist/esm/tools/segmentation/SphereScissorsTool.js +12 -4
  297. package/dist/esm/tools/segmentation/strategies/BrushStrategy.d.ts +4 -5
  298. package/dist/esm/tools/segmentation/strategies/BrushStrategy.js +3 -1
  299. package/dist/esm/tools/segmentation/strategies/compositions/determineSegmentIndex.js +6 -3
  300. package/dist/esm/tools/segmentation/strategies/compositions/dynamicThreshold.js +1 -1
  301. package/dist/esm/tools/segmentation/strategies/compositions/islandRemoval.js +1 -1
  302. package/dist/esm/tools/segmentation/strategies/compositions/preview.js +2 -2
  303. package/dist/esm/tools/segmentation/strategies/compositions/regionFill.js +6 -3
  304. package/dist/esm/tools/segmentation/strategies/compositions/setValue.js +1 -1
  305. package/dist/esm/tools/segmentation/strategies/eraseRectangle.d.ts +1 -1
  306. package/dist/esm/tools/segmentation/strategies/fillCircle.js +1 -1
  307. package/dist/esm/tools/segmentation/strategies/fillRectangle.d.ts +1 -1
  308. package/dist/esm/tools/segmentation/strategies/fillRectangle.js +10 -7
  309. package/dist/esm/tools/segmentation/strategies/fillSphere.js +1 -1
  310. package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.d.ts +1 -1
  311. package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.js +7 -24
  312. package/dist/esm/tools/segmentation/strategies/utils/isWithinThreshold.d.ts +9 -2
  313. package/dist/esm/tools/segmentation/strategies/utils/stackVolumeCheck.d.ts +3 -3
  314. package/dist/esm/tools/segmentation/strategies/utils/stackVolumeCheck.js +0 -3
  315. package/dist/esm/types/AnnotationGroupSelector.d.ts +1 -1
  316. package/dist/esm/types/AnnotationRenderContext.d.ts +3 -2
  317. package/dist/esm/types/AnnotationStyle.d.ts +2 -2
  318. package/dist/esm/types/AnnotationTypes.d.ts +3 -3
  319. package/dist/esm/types/BoundsIJK.d.ts +1 -1
  320. package/dist/esm/types/CINETypes.d.ts +1 -0
  321. package/dist/esm/types/CalculatorTypes.d.ts +1 -1
  322. package/dist/esm/types/CardinalSplineProps.d.ts +1 -1
  323. package/dist/esm/types/ClosestPoint.d.ts +1 -1
  324. package/dist/esm/types/ContourAnnotation.d.ts +1 -1
  325. package/dist/esm/types/ContourSegmentationAnnotation.d.ts +2 -2
  326. package/dist/esm/types/ControlPointInfo.d.ts +1 -1
  327. package/dist/esm/types/EventTypes.d.ts +13 -12
  328. package/dist/esm/types/FloodFillTypes.d.ts +2 -2
  329. package/dist/esm/types/IAnnotationManager.d.ts +3 -3
  330. package/dist/esm/types/IDistance.d.ts +1 -1
  331. package/dist/esm/types/IPoints.d.ts +2 -2
  332. package/dist/esm/types/ISetToolModeOptions.d.ts +2 -2
  333. package/dist/esm/types/ISpline.d.ts +1 -1
  334. package/dist/esm/types/ISynchronizerEventHandler.d.ts +3 -3
  335. package/dist/esm/types/IToolClassReference.d.ts +3 -3
  336. package/dist/esm/types/IToolGroup.d.ts +8 -8
  337. package/dist/esm/types/ITouchPoints.d.ts +2 -2
  338. package/dist/esm/types/InteractionTypes.d.ts +1 -1
  339. package/dist/esm/types/InternalToolTypes.d.ts +4 -4
  340. package/dist/esm/types/InterpolationTypes.d.ts +3 -3
  341. package/dist/esm/types/JumpToSliceOptions.d.ts +1 -1
  342. package/dist/esm/types/LabelmapToolOperationData.d.ts +3 -2
  343. package/dist/esm/types/PlanarBoundingBox.d.ts +1 -1
  344. package/dist/esm/types/SVGDrawingHelper.d.ts +1 -1
  345. package/dist/esm/types/ScrollOptions.d.ts +1 -1
  346. package/dist/esm/types/SegmentationStateTypes.d.ts +7 -6
  347. package/dist/esm/types/SplineCurveSegment.d.ts +1 -1
  348. package/dist/esm/types/SplineLineSegment.d.ts +1 -1
  349. package/dist/esm/types/ToolAction.d.ts +1 -1
  350. package/dist/esm/types/ToolHandle.d.ts +1 -1
  351. package/dist/esm/types/ToolProps.d.ts +1 -1
  352. package/dist/esm/types/ToolSpecificAnnotationTypes.d.ts +34 -12
  353. package/dist/esm/types/index.d.ts +2 -2
  354. package/dist/esm/utilities/annotationFrameRange.d.ts +1 -1
  355. package/dist/esm/utilities/annotationHydration.d.ts +3 -2
  356. package/dist/esm/utilities/cine/playClip.d.ts +6 -2
  357. package/dist/esm/utilities/cine/playClip.js +53 -6
  358. package/dist/esm/utilities/cine/state.d.ts +1 -1
  359. package/dist/esm/utilities/contourSegmentation/addContourSegmentationAnnotation.d.ts +1 -1
  360. package/dist/esm/utilities/contourSegmentation/areSameSegment.d.ts +1 -1
  361. package/dist/esm/utilities/contourSegmentation/isContourSegmentationAnnotation.d.ts +2 -2
  362. package/dist/esm/utilities/contourSegmentation/removeContourSegmentationAnnotation.d.ts +1 -1
  363. package/dist/esm/utilities/contours/AnnotationToPointData.d.ts +1 -1
  364. package/dist/esm/utilities/contours/areCoplanarContours.d.ts +1 -1
  365. package/dist/esm/utilities/contours/findHandlePolylineIndex.d.ts +1 -1
  366. package/dist/esm/utilities/contours/interpolation/createPolylineToolData.d.ts +1 -1
  367. package/dist/esm/utilities/contours/interpolation/getInterpolationData.d.ts +1 -1
  368. package/dist/esm/utilities/contours/interpolation/interpolate.d.ts +1 -1
  369. package/dist/esm/utilities/contours/reverseIfAntiClockwise.d.ts +1 -1
  370. package/dist/esm/utilities/contours/updateContourPolyline.d.ts +1 -1
  371. package/dist/esm/utilities/dynamicVolume/generateImageFromTimeData.d.ts +3 -2
  372. package/dist/esm/utilities/dynamicVolume/generateImageFromTimeData.js +31 -23
  373. package/dist/esm/utilities/dynamicVolume/getDataInTime.d.ts +1 -1
  374. package/dist/esm/utilities/dynamicVolume/getDataInTime.js +14 -9
  375. package/dist/esm/utilities/getAnnotationNearPoint.d.ts +1 -1
  376. package/dist/esm/utilities/getCalibratedUnits.d.ts +0 -6
  377. package/dist/esm/utilities/getCalibratedUnits.js +13 -4
  378. package/dist/esm/utilities/getPixelValueUnits.d.ts +2 -1
  379. package/dist/esm/utilities/getPixelValueUnits.js +1 -0
  380. package/dist/esm/utilities/getSphereBoundsInfo.d.ts +1 -1
  381. package/dist/esm/utilities/getToolsWithModesForElement.d.ts +1 -1
  382. package/dist/esm/utilities/getVOIMultipliers.d.ts +1 -1
  383. package/dist/esm/utilities/index.d.ts +1 -3
  384. package/dist/esm/utilities/index.js +1 -3
  385. package/dist/esm/utilities/livewire/LiveWirePath.d.ts +1 -1
  386. package/dist/esm/utilities/livewire/LivewireScissors.d.ts +1 -1
  387. package/dist/esm/utilities/math/aabb/distanceToPoint.d.ts +1 -1
  388. package/dist/esm/utilities/math/aabb/distanceToPointSquared.d.ts +1 -1
  389. package/dist/esm/utilities/math/aabb/intersectAABB.d.ts +1 -1
  390. package/dist/esm/utilities/math/basic/BasicStatsCalculator.d.ts +2 -2
  391. package/dist/esm/utilities/math/basic/BasicStatsCalculator.js +1 -1
  392. package/dist/esm/utilities/math/basic/Calculator.d.ts +1 -1
  393. package/dist/esm/utilities/math/circle/getCanvasCircleCorners.d.ts +1 -1
  394. package/dist/esm/utilities/math/circle/getCanvasCircleRadius.d.ts +1 -1
  395. package/dist/esm/utilities/math/line/distanceToPointSquared.d.ts +1 -1
  396. package/dist/esm/utilities/math/midPoint.d.ts +1 -1
  397. package/dist/esm/utilities/math/point/mirror.d.ts +1 -1
  398. package/dist/esm/utilities/math/polyline/addCanvasPointsToArray.d.ts +1 -1
  399. package/dist/esm/utilities/math/polyline/combinePolyline.d.ts +1 -1
  400. package/dist/esm/utilities/math/polyline/getAABB.d.ts +1 -1
  401. package/dist/esm/utilities/math/polyline/getLinesIntersection.d.ts +1 -1
  402. package/dist/esm/utilities/math/polyline/getNormal2.d.ts +1 -1
  403. package/dist/esm/utilities/math/polyline/getNormal3.d.ts +1 -1
  404. package/dist/esm/utilities/math/polyline/intersectPolyline.d.ts +1 -1
  405. package/dist/esm/utilities/math/polyline/planarFreehandROIInternalTypes.d.ts +2 -2
  406. package/dist/esm/utilities/math/sphere/pointInSphere.d.ts +1 -1
  407. package/dist/esm/utilities/orientation/getOrientationStringLPS.d.ts +1 -1
  408. package/dist/esm/utilities/planar/filterAnnotationsForDisplay.d.ts +1 -1
  409. package/dist/esm/utilities/planar/filterAnnotationsWithinPlane.d.ts +3 -0
  410. package/dist/esm/utilities/planar/filterAnnotationsWithinPlane.js +26 -0
  411. package/dist/esm/utilities/planar/filterAnnotationsWithinSlice.d.ts +1 -1
  412. package/dist/esm/utilities/planar/index.d.ts +3 -1
  413. package/dist/esm/utilities/planar/index.js +3 -1
  414. package/dist/esm/utilities/planarFreehandROITool/interpolation/algorithms/bspline.d.ts +1 -1
  415. package/dist/esm/utilities/planarFreehandROITool/interpolation/interpolateSegmentPoints.d.ts +1 -1
  416. package/dist/esm/utilities/planarFreehandROITool/smoothAnnotation.d.ts +2 -2
  417. package/dist/esm/utilities/planarFreehandROITool/smoothPoints.d.ts +11 -3
  418. package/dist/esm/utilities/polyData/utils.d.ts +1 -1
  419. package/dist/esm/utilities/scroll.d.ts +4 -3
  420. package/dist/esm/utilities/scroll.js +3 -10
  421. package/dist/esm/utilities/segmentation/InterpolationManager/InterpolationManager.d.ts +1 -1
  422. package/dist/esm/utilities/segmentation/createLabelmapVolumeForViewport.d.ts +2 -11
  423. package/dist/esm/utilities/segmentation/createLabelmapVolumeForViewport.js +1 -1
  424. package/dist/esm/utilities/segmentation/createMergedLabelmapForIndex.d.ts +1 -1
  425. package/dist/esm/utilities/segmentation/createMergedLabelmapForIndex.js +7 -7
  426. package/dist/esm/utilities/segmentation/floodFill.d.ts +1 -1
  427. package/dist/esm/utilities/segmentation/getDefaultRepresentationConfig.d.ts +1 -1
  428. package/dist/esm/utilities/segmentation/getSegmentIndexAtLabelmapBorder.js +8 -5
  429. package/dist/esm/utilities/segmentation/getSegmentIndexAtWorldPoint.d.ts +1 -1
  430. package/dist/esm/utilities/segmentation/getSegmentIndexAtWorldPoint.js +7 -4
  431. package/dist/esm/utilities/segmentation/getUniqueSegmentIndices.js +4 -5
  432. package/dist/esm/utilities/segmentation/index.d.ts +2 -2
  433. package/dist/esm/utilities/segmentation/index.js +2 -2
  434. package/dist/esm/utilities/segmentation/isValidRepresentationConfig.d.ts +1 -1
  435. package/dist/esm/utilities/segmentation/rectangleROIThresholdVolumeByRange.d.ts +1 -1
  436. package/dist/esm/utilities/segmentation/rectangleROIThresholdVolumeByRange.js +3 -2
  437. package/dist/esm/utilities/segmentation/segmentContourAction.d.ts +1 -1
  438. package/dist/esm/utilities/segmentation/segmentContourAction.js +4 -4
  439. package/dist/esm/utilities/segmentation/thresholdSegmentationByRange.d.ts +2 -2
  440. package/dist/esm/utilities/segmentation/thresholdSegmentationByRange.js +24 -17
  441. package/dist/esm/utilities/segmentation/thresholdVolumeByRange.d.ts +3 -3
  442. package/dist/esm/utilities/segmentation/thresholdVolumeByRange.js +21 -12
  443. package/dist/esm/utilities/segmentation/triggerSegmentationRender.d.ts +3 -3
  444. package/dist/esm/utilities/segmentation/triggerSegmentationRender.js +7 -5
  445. package/dist/esm/utilities/segmentation/utilities.d.ts +12 -2
  446. package/dist/esm/utilities/segmentation/utilities.js +5 -6
  447. package/dist/esm/utilities/stackPrefetch/stackContextPrefetch.js +30 -25
  448. package/dist/esm/utilities/stackPrefetch/stackPrefetch.js +3 -8
  449. package/dist/esm/utilities/stackPrefetch/stackPrefetchUtils.js +2 -3
  450. package/dist/esm/utilities/stackPrefetch/state.d.ts +20 -1
  451. package/dist/esm/utilities/touch/index.d.ts +1 -1
  452. package/dist/esm/utilities/triggerAnnotationRender.d.ts +0 -20
  453. package/dist/esm/utilities/triggerAnnotationRender.js +1 -112
  454. package/dist/esm/utilities/viewport/isViewportPreScaled.d.ts +1 -1
  455. package/dist/esm/utilities/viewport/isViewportPreScaled.js +2 -5
  456. package/dist/esm/utilities/viewport/jumpToSlice.d.ts +1 -1
  457. package/dist/esm/utilities/viewport/jumpToSlice.js +4 -6
  458. package/dist/esm/utilities/voi/colorbar/ColorbarCanvas.d.ts +2 -2
  459. package/dist/esm/utilities/voi/colorbar/ViewportColorbar.d.ts +1 -1
  460. package/dist/esm/utilities/voi/colorbar/ViewportColorbar.js +1 -1
  461. package/dist/esm/utilities/voi/colorbar/types/ColorbarCanvasProps.d.ts +1 -1
  462. package/dist/esm/utilities/voi/colorbar/types/ColorbarCommonProps.d.ts +1 -1
  463. package/dist/esm/utilities/voi/colorbar/types/ColorbarProps.d.ts +3 -3
  464. package/dist/esm/utilities/voi/windowlevel/extractWindowLevelRegionToolData.d.ts +8 -0
  465. package/dist/esm/utilities/voi/windowlevel/extractWindowLevelRegionToolData.js +4 -10
  466. package/dist/esm/widgets/types/index.d.ts +2 -2
  467. package/dist/esm/workers/polySegConverters.js +65 -32
  468. package/dist/umd/78.index.js +1 -1
  469. package/dist/umd/78.index.js.map +1 -1
  470. package/dist/umd/985.index.js +1 -1
  471. package/dist/umd/985.index.js.map +1 -1
  472. package/dist/umd/index.js +1 -1
  473. package/dist/umd/index.js.map +1 -1
  474. package/package.json +5 -7
  475. package/dist/esm/stateManagement/segmentation/addRepresentation.d.ts +0 -3
  476. package/dist/esm/stateManagement/segmentation/addRepresentations.d.ts +0 -3
  477. package/dist/esm/stateManagement/segmentation/addRepresentations.js +0 -9
  478. package/dist/esm/stateManagement/segmentation/helpers/getRepresentationRenderingConfig.d.ts +0 -2
  479. package/dist/esm/stateManagement/segmentation/removeRepresentationsFromViewport.d.ts +0 -2
  480. package/dist/esm/utilities/pointInShapeCallback.d.ts +0 -18
  481. package/dist/esm/utilities/pointInShapeCallback.js +0 -82
  482. package/dist/esm/utilities/pointInSurroundingSphereCallback.d.ts +0 -4
  483. package/dist/esm/utilities/pointInSurroundingSphereCallback.js +0 -63
  484. package/dist/esm/utilities/segmentation/triggerSegmentationRenderForViewports.d.ts +0 -3
  485. package/dist/esm/utilities/segmentation/triggerSegmentationRenderForViewports.js +0 -6
@@ -1,6 +1,5 @@
1
1
  import { utilities, cache } from '@cornerstonejs/core';
2
2
  import { getVoxelOverlap } from '../segmentation/utilities';
3
- import pointInShapeCallback from '../pointInShapeCallback';
4
3
  function getDataInTime(dynamicVolume, options) {
5
4
  let dataInTime;
6
5
  const frames = options.frameNumbers || [
@@ -45,15 +44,15 @@ function _getTimePointDataCoordinate(frames, coordinate, volume) {
45
44
  }
46
45
  function _getTimePointDataMask(frames, dynamicVolume, segmentationVolume) {
47
46
  const { imageData: maskImageData } = segmentationVolume;
48
- const segScalarData = segmentationVolume.getScalarData();
49
- const len = segScalarData.length;
47
+ const segVoxelManager = segmentationVolume.voxelManager;
48
+ const scalarDataLength = segVoxelManager.getScalarDataLength();
50
49
  const nonZeroVoxelIndices = [];
51
- nonZeroVoxelIndices.length = len;
50
+ nonZeroVoxelIndices.length = scalarDataLength;
52
51
  const ijkCoords = [];
53
52
  const dimensions = segmentationVolume.dimensions;
54
53
  let actualLen = 0;
55
- for (let i = 0, len = segScalarData.length; i < len; i++) {
56
- if (segScalarData[i] !== 0) {
54
+ for (let i = 0, len = scalarDataLength; i < len; i++) {
55
+ if (segVoxelManager.getAtIndex(i) !== 0) {
57
56
  ijkCoords.push([
58
57
  i % dimensions[0],
59
58
  Math.floor((i / dimensions[0]) % dimensions[1]),
@@ -65,7 +64,7 @@ function _getTimePointDataMask(frames, dynamicVolume, segmentationVolume) {
65
64
  nonZeroVoxelIndices.length = actualLen;
66
65
  const dynamicVolumeScalarDataArray = dynamicVolume.getScalarDataArrays();
67
66
  const values = [];
68
- const isSameVolume = dynamicVolumeScalarDataArray[0].length === len &&
67
+ const isSameVolume = dynamicVolumeScalarDataArray[0].length === scalarDataLength &&
69
68
  JSON.stringify(dynamicVolume.spacing) ===
70
69
  JSON.stringify(segmentationVolume.spacing);
71
70
  if (isSameVolume) {
@@ -95,7 +94,10 @@ function _getTimePointDataMask(frames, dynamicVolume, segmentationVolume) {
95
94
  }
96
95
  count++;
97
96
  };
98
- pointInShapeCallback(dynamicVolume.imageData, () => true, averageCallback, overlapIJKMinMax);
97
+ dynamicVolume.voxelManager.forEach(averageCallback, {
98
+ imageData: dynamicVolume.imageData,
99
+ boundsIJK: overlapIJKMinMax,
100
+ });
99
101
  const averageValues = [];
100
102
  perFrameSum.forEach((sum) => {
101
103
  averageValues.push(sum / count);
@@ -103,7 +105,10 @@ function _getTimePointDataMask(frames, dynamicVolume, segmentationVolume) {
103
105
  ijkCoords.push(segPointIJK);
104
106
  values.push(averageValues);
105
107
  };
106
- pointInShapeCallback(maskImageData, () => true, callback);
108
+ const { voxelManager } = maskImageData.get('voxelManager');
109
+ voxelManager.forEach(callback, {
110
+ imageData: maskImageData,
111
+ });
107
112
  return [values, ijkCoords];
108
113
  }
109
114
  export default getDataInTime;
@@ -1,5 +1,5 @@
1
1
  import type { Types } from '@cornerstonejs/core';
2
- import { Annotation } from '../types';
2
+ import type { Annotation } from '../types';
3
3
  declare function getAnnotationNearPoint(element: HTMLDivElement, canvasPoint: Types.Point2, proximity?: number): Annotation | null;
4
4
  declare function getAnnotationNearPointOnEnabledElement(enabledElement: Types.IEnabledElement, point: Types.Point2, proximity: number): Annotation | null;
5
5
  export { getAnnotationNearPoint, getAnnotationNearPointOnEnabledElement };
@@ -2,12 +2,6 @@ declare const getCalibratedLengthUnitsAndScale: (image: any, handles: any) => {
2
2
  lengthUnits: string;
3
3
  areaUnits: string;
4
4
  scale: number;
5
- units?: undefined;
6
- } | {
7
- units: string;
8
- areaUnits: string;
9
- scale: number;
10
- lengthUnits?: undefined;
11
5
  };
12
6
  declare const getCalibratedProbeUnitsAndValue: (image: any, handles: any) => {
13
7
  units: string[];
@@ -11,8 +11,17 @@ const SUPPORTED_PROBE_VARIANT = [
11
11
  '4,3',
12
12
  ];
13
13
  const UNIT_MAPPING = {
14
+ 0: 'px',
15
+ 1: 'percent',
16
+ 2: 'dB',
14
17
  3: 'cm',
15
18
  4: 'seconds',
19
+ 5: 'hertz',
20
+ 6: 'dB/seconds',
21
+ 7: 'cm/sec',
22
+ 8: 'cm\xb2',
23
+ 9: 'cm\xb2/s',
24
+ 0xc: 'degrees',
16
25
  };
17
26
  const EPS = 1e-3;
18
27
  const SQUARE = '\xb2';
@@ -27,7 +36,7 @@ const getCalibratedLengthUnitsAndScale = (image, handles) => {
27
36
  return { lengthUnits, areaUnits, scale };
28
37
  }
29
38
  if (calibration.type === CalibrationTypes.UNCALIBRATED) {
30
- return { units: PIXEL_UNITS, areaUnits: PIXEL_UNITS + SQUARE, scale };
39
+ return { lengthUnits: PIXEL_UNITS, areaUnits: PIXEL_UNITS + SQUARE, scale };
31
40
  }
32
41
  if (calibration.sequenceOfUltrasoundRegions) {
33
42
  let imageIndex1, imageIndex2;
@@ -64,10 +73,10 @@ const getCalibratedLengthUnitsAndScale = (image, handles) => {
64
73
  const physicalDeltaY = Math.abs(region.physicalDeltaY);
65
74
  const isSamePhysicalDelta = utilities.isEqual(physicalDeltaX, physicalDeltaY, EPS);
66
75
  if (isSamePhysicalDelta) {
67
- scale = 1 / (physicalDeltaX * 10);
76
+ scale = 1 / physicalDeltaX;
68
77
  calibrationType = 'US Region';
69
- lengthUnits = 'mm';
70
- areaUnits = 'mm' + SQUARE;
78
+ lengthUnits = UNIT_MAPPING[region.physicalUnitsXDirection] || 'unknown';
79
+ areaUnits = lengthUnits + SQUARE;
71
80
  }
72
81
  else {
73
82
  return {
@@ -3,4 +3,5 @@ type pixelUnitsOptions = {
3
3
  isSuvScaled: boolean;
4
4
  };
5
5
  declare function getPixelValueUnits(modality: string, imageId: string, options: pixelUnitsOptions): string;
6
- export { getPixelValueUnits, pixelUnitsOptions };
6
+ export type { pixelUnitsOptions };
7
+ export { getPixelValueUnits };
@@ -22,5 +22,6 @@ function _handlePTModality(imageId, options) {
22
22
  const petSeriesModule = metaData.get('petSeriesModule', imageId);
23
23
  return petSeriesModule?.units || 'unitless';
24
24
  }
25
+ return 'unknown';
25
26
  }
26
27
  export { getPixelValueUnits };
@@ -1,6 +1,6 @@
1
1
  import type { Types } from '@cornerstonejs/core';
2
2
  import type { vtkImageData } from '@kitware/vtk.js/Common/DataModel/ImageData';
3
- import { BoundsIJK } from '../types';
3
+ import type { BoundsIJK } from '../types';
4
4
  declare function getSphereBoundsInfo(circlePoints: [Types.Point3, Types.Point3], imageData: vtkImageData, viewport: any): {
5
5
  boundsIJK: BoundsIJK;
6
6
  centerWorld: Types.Point3;
@@ -1,4 +1,4 @@
1
- import { ToolModes } from '../enums';
1
+ import type { ToolModes } from '../enums';
2
2
  type ModesFilter = Array<ToolModes>;
3
3
  export default function getToolsWithModesForElement(element: HTMLDivElement, modesFilter: ModesFilter): any[];
4
4
  export {};
@@ -1,4 +1,4 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  declare function getVOIMultipliers(viewport: Types.IStackViewport | Types.IVolumeViewport, volumeId?: string, options?: {
3
3
  fixedPTWindowWidth?: boolean;
4
4
  }): [number, number];
@@ -10,12 +10,10 @@ import triggerAnnotationRenderForViewportIds from './triggerAnnotationRenderForV
10
10
  import triggerAnnotationRenderForToolGroupIds from './triggerAnnotationRenderForToolGroupIds';
11
11
  import triggerAnnotationRender from './triggerAnnotationRender';
12
12
  import jumpToSlice from './viewport/jumpToSlice';
13
- import pointInShapeCallback from './pointInShapeCallback';
14
13
  import { getSphereBoundsInfo } from './getSphereBoundsInfo';
15
14
  import scroll from './scroll';
16
15
  import { pointToString } from './pointToString';
17
16
  import annotationFrameRange from './annotationFrameRange';
18
- import pointInSurroundingSphereCallback from './pointInSurroundingSphereCallback';
19
17
  import getViewportForAnnotation from './getViewportForAnnotation';
20
18
  import { annotationHydration, getClosestImageIdForStackViewport } from './annotationHydration';
21
19
  import * as contours from './contours';
@@ -38,4 +36,4 @@ import * as voi from './voi';
38
36
  import * as contourSegmentation from './contourSegmentation';
39
37
  declare const roundNumber: typeof utilities.roundNumber;
40
38
  import { triggerEvent } from '@cornerstonejs/core';
41
- export { math, planar, viewportFilters, drawing, debounce, dynamicVolume, throttle, orientation, isObject, touch, triggerEvent, calibrateImageSpacing, getCalibratedLengthUnitsAndScale, getCalibratedProbeUnitsAndValue, getCalibratedAspect, segmentation, contours, triggerAnnotationRenderForViewportIds, triggerAnnotationRenderForToolGroupIds, triggerAnnotationRender, pointInShapeCallback, getSphereBoundsInfo, getAnnotationNearPoint, getViewportForAnnotation, getAnnotationNearPointOnEnabledElement, jumpToSlice, pointInSurroundingSphereCallback, viewport, cine, clip, boundingBox, rectangleROITool, planarFreehandROITool, stackPrefetch, stackContextPrefetch, scroll, roundNumber, pointToString, polyDataUtils, voi, annotationFrameRange, contourSegmentation, annotationHydration, getClosestImageIdForStackViewport, };
39
+ export { math, planar, viewportFilters, drawing, debounce, dynamicVolume, throttle, orientation, isObject, touch, triggerEvent, calibrateImageSpacing, getCalibratedLengthUnitsAndScale, getCalibratedProbeUnitsAndValue, getCalibratedAspect, segmentation, contours, triggerAnnotationRenderForViewportIds, triggerAnnotationRenderForToolGroupIds, triggerAnnotationRender, getSphereBoundsInfo, getAnnotationNearPoint, getViewportForAnnotation, getAnnotationNearPointOnEnabledElement, jumpToSlice, viewport, cine, clip, boundingBox, rectangleROITool, planarFreehandROITool, stackPrefetch, stackContextPrefetch, scroll, roundNumber, pointToString, polyDataUtils, voi, annotationFrameRange, contourSegmentation, annotationHydration, getClosestImageIdForStackViewport, };
@@ -10,12 +10,10 @@ import triggerAnnotationRenderForViewportIds from './triggerAnnotationRenderForV
10
10
  import triggerAnnotationRenderForToolGroupIds from './triggerAnnotationRenderForToolGroupIds';
11
11
  import triggerAnnotationRender from './triggerAnnotationRender';
12
12
  import jumpToSlice from './viewport/jumpToSlice';
13
- import pointInShapeCallback from './pointInShapeCallback';
14
13
  import { getSphereBoundsInfo } from './getSphereBoundsInfo';
15
14
  import scroll from './scroll';
16
15
  import { pointToString } from './pointToString';
17
16
  import annotationFrameRange from './annotationFrameRange';
18
- import pointInSurroundingSphereCallback from './pointInSurroundingSphereCallback';
19
17
  import getViewportForAnnotation from './getViewportForAnnotation';
20
18
  import { annotationHydration, getClosestImageIdForStackViewport, } from './annotationHydration';
21
19
  import * as contours from './contours';
@@ -38,4 +36,4 @@ import * as voi from './voi';
38
36
  import * as contourSegmentation from './contourSegmentation';
39
37
  const roundNumber = utilities.roundNumber;
40
38
  import { triggerEvent } from '@cornerstonejs/core';
41
- export { math, planar, viewportFilters, drawing, debounce, dynamicVolume, throttle, orientation, isObject, touch, triggerEvent, calibrateImageSpacing, getCalibratedLengthUnitsAndScale, getCalibratedProbeUnitsAndValue, getCalibratedAspect, segmentation, contours, triggerAnnotationRenderForViewportIds, triggerAnnotationRenderForToolGroupIds, triggerAnnotationRender, pointInShapeCallback, getSphereBoundsInfo, getAnnotationNearPoint, getViewportForAnnotation, getAnnotationNearPointOnEnabledElement, jumpToSlice, pointInSurroundingSphereCallback, viewport, cine, clip, boundingBox, rectangleROITool, planarFreehandROITool, stackPrefetch, stackContextPrefetch, scroll, roundNumber, pointToString, polyDataUtils, voi, annotationFrameRange, contourSegmentation, annotationHydration, getClosestImageIdForStackViewport, };
39
+ export { math, planar, viewportFilters, drawing, debounce, dynamicVolume, throttle, orientation, isObject, touch, triggerEvent, calibrateImageSpacing, getCalibratedLengthUnitsAndScale, getCalibratedProbeUnitsAndValue, getCalibratedAspect, segmentation, contours, triggerAnnotationRenderForViewportIds, triggerAnnotationRenderForToolGroupIds, triggerAnnotationRender, getSphereBoundsInfo, getAnnotationNearPoint, getViewportForAnnotation, getAnnotationNearPointOnEnabledElement, jumpToSlice, viewport, cine, clip, boundingBox, rectangleROITool, planarFreehandROITool, stackPrefetch, stackContextPrefetch, scroll, roundNumber, pointToString, polyDataUtils, voi, annotationFrameRange, contourSegmentation, annotationHydration, getClosestImageIdForStackViewport, };
@@ -1,4 +1,4 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  export declare class LivewirePath {
3
3
  pointArray: Types.Point2[];
4
4
  private _controlPointIndexes;
@@ -1,4 +1,4 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  export declare class LivewireScissors {
3
3
  private searchGranularityBits;
4
4
  private searchGranularity;
@@ -1,2 +1,2 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  export default function distanceToPoint(aabb: Types.AABB2, point: Types.Point2): number;
@@ -1,2 +1,2 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  export default function distanceToPointSquared(aabb: Types.AABB2, point: Types.Point2): number;
@@ -1,2 +1,2 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  export default function intersectAABB(aabb1: Types.AABB2, aabb2: Types.AABB2): boolean;
@@ -1,4 +1,4 @@
1
- import { NamedStatistics } from '../../../types';
1
+ import type { NamedStatistics } from '../../../types';
2
2
  import Calculator from './Calculator';
3
3
  export default class BasicStatsCalculator extends Calculator {
4
4
  private static max;
@@ -9,7 +9,7 @@ export default class BasicStatsCalculator extends Calculator {
9
9
  private static m2;
10
10
  private static pointsInShape;
11
11
  static statsInit(options: {
12
- noPointsCollection: boolean;
12
+ storePointData: boolean;
13
13
  }): void;
14
14
  static statsCallback: ({ value: newValue, pointLPS }: {
15
15
  value: any;
@@ -10,7 +10,7 @@ export default class BasicStatsCalculator extends Calculator {
10
10
  static { this.m2 = [0]; }
11
11
  static { this.pointsInShape = PointsManager.create3(1024); }
12
12
  static statsInit(options) {
13
- if (options.noPointsCollection) {
13
+ if (!options.storePointData) {
14
14
  BasicStatsCalculator.pointsInShape = null;
15
15
  }
16
16
  }
@@ -1,4 +1,4 @@
1
- import { NamedStatistics } from '../../../types';
1
+ import type { NamedStatistics } from '../../../types';
2
2
  declare abstract class Calculator {
3
3
  static run: ({ value }: {
4
4
  value: any;
@@ -1,3 +1,3 @@
1
1
  import type { Types } from '@cornerstonejs/core';
2
- import { canvasCoordinates } from './_types';
2
+ import type { canvasCoordinates } from './_types';
3
3
  export default function getCanvasCircleCorners(circleCanvasPoints: canvasCoordinates): Array<Types.Point2>;
@@ -1,2 +1,2 @@
1
- import { canvasCoordinates } from './_types';
1
+ import type { canvasCoordinates } from './_types';
2
2
  export default function getCanvasCircleRadius(circleCanvasPoints: canvasCoordinates): number;
@@ -1,2 +1,2 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  export default function distanceToPointSquared(lineStart: Types.Point2, lineEnd: Types.Point2, point: Types.Point2): number;
@@ -1,4 +1,4 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  declare const midPoint: (...args: (Types.Point2 | Types.Point3)[]) => Types.Point2 | Types.Point3;
3
3
  declare const midPoint2: (...args: Types.Point2[]) => Types.Point2;
4
4
  export default midPoint;
@@ -1,2 +1,2 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  export default function mirror(mirrorPoint: Types.Point2, staticPoint: Types.Point2): Types.Point2;
@@ -1,4 +1,4 @@
1
1
  import type { Types } from '@cornerstonejs/core';
2
- import { PlanarFreehandROICommonData } from './planarFreehandROIInternalTypes';
2
+ import type { PlanarFreehandROICommonData } from './planarFreehandROIInternalTypes';
3
3
  declare const addCanvasPointsToArray: (element: HTMLDivElement, canvasPoints: Types.Point2[], newCanvasPoint: Types.Point2, commonData: PlanarFreehandROICommonData) => number;
4
4
  export default addCanvasPointsToArray;
@@ -1,4 +1,4 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  declare function mergePolylines(targetPolyline: Types.Point2[], sourcePolyline: Types.Point2[]): Types.Point2[];
3
3
  declare function subtractPolylines(targetPolyline: Types.Point2[], sourcePolyline: Types.Point2[]): Types.Point2[][];
4
4
  export { mergePolylines, subtractPolylines };
@@ -1,4 +1,4 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  export default function getAABB(polyline: Types.Point2[] | Types.Point3[] | number[], options?: {
3
3
  numDimensions: number;
4
4
  }): Types.AABB2 | Types.AABB3;
@@ -1,2 +1,2 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  export default function getLinesIntersection(p1: Types.Point2, q1: Types.Point2, p2: Types.Point2, q2: Types.Point2): number[];
@@ -1,2 +1,2 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  export default function getNormal2(polyline: Types.Point2[]): Types.Point3;
@@ -1,2 +1,2 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  export default function getNormal3(polyline: Types.Point3[]): Types.Point3;
@@ -1,2 +1,2 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  export default function intersectPolyline(sourcePolyline: Types.Point2[], targetPolyline: Types.Point2[]): boolean;
@@ -1,5 +1,5 @@
1
1
  import type { Types } from '@cornerstonejs/core';
2
- import { PlanarFreehandROIAnnotation } from '../../../types/ToolSpecificAnnotationTypes';
2
+ import type { PlanarFreehandROIAnnotation } from '../../../types/ToolSpecificAnnotationTypes';
3
3
  type PlanarFreehandROIDrawData = {
4
4
  polylineIndex: number;
5
5
  canvasPoints: Types.Point2[];
@@ -21,4 +21,4 @@ type PlanarFreehandROICommonData = {
21
21
  yDir: Types.Point3;
22
22
  movingTextBox?: boolean;
23
23
  };
24
- export { PlanarFreehandROIDrawData, PlanarFreehandROIEditData, PlanarFreehandROICommonData, };
24
+ export type { PlanarFreehandROIDrawData, PlanarFreehandROIEditData, PlanarFreehandROICommonData, };
@@ -1,5 +1,5 @@
1
1
  import type { Types } from '@cornerstonejs/core';
2
- import { vec3 } from 'gl-matrix';
2
+ import type { vec3 } from 'gl-matrix';
3
3
  type Sphere = {
4
4
  center: Types.Point3 | vec3;
5
5
  radius: number;
@@ -1,2 +1,2 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  export default function getOrientationStringLPS(vector: Types.Point3): string;
@@ -1,3 +1,3 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  import type { Annotations } from '../../types';
3
3
  export default function filterAnnotationsForDisplay(viewport: Types.IViewport, annotations: Annotations, filterOptions?: Types.ReferenceCompatibleOptions): Annotations;
@@ -0,0 +1,3 @@
1
+ import type { Types } from '@cornerstonejs/core';
2
+ import type { Annotations } from '../../types';
3
+ export declare function filterAnnotationsWithinSamePlane(annotations: Annotations, camera: Types.ICamera): Annotations;
@@ -0,0 +1,26 @@
1
+ import { vec3 } from 'gl-matrix';
2
+ import { CONSTANTS, metaData } from '@cornerstonejs/core';
3
+ const { EPSILON } = CONSTANTS;
4
+ const PARALLEL_THRESHOLD = 1 - EPSILON;
5
+ export function filterAnnotationsWithinSamePlane(annotations, camera) {
6
+ const { viewPlaneNormal } = camera;
7
+ const annotationsWithParallelNormals = annotations.filter((td) => {
8
+ let annotationViewPlaneNormal = td.metadata.viewPlaneNormal;
9
+ if (!annotationViewPlaneNormal) {
10
+ const { referencedImageId } = td.metadata;
11
+ const { imageOrientationPatient } = metaData.get('imagePlaneModule', referencedImageId);
12
+ const rowCosineVec = vec3.fromValues(imageOrientationPatient[0], imageOrientationPatient[1], imageOrientationPatient[2]);
13
+ const colCosineVec = vec3.fromValues(imageOrientationPatient[3], imageOrientationPatient[4], imageOrientationPatient[5]);
14
+ annotationViewPlaneNormal = vec3.create();
15
+ vec3.cross(annotationViewPlaneNormal, rowCosineVec, colCosineVec);
16
+ td.metadata.viewPlaneNormal = annotationViewPlaneNormal;
17
+ }
18
+ const isParallel = Math.abs(vec3.dot(viewPlaneNormal, annotationViewPlaneNormal)) >
19
+ PARALLEL_THRESHOLD;
20
+ return annotationViewPlaneNormal && isParallel;
21
+ });
22
+ if (!annotationsWithParallelNormals.length) {
23
+ return [];
24
+ }
25
+ return annotationsWithParallelNormals;
26
+ }
@@ -1,3 +1,3 @@
1
1
  import type { Types } from '@cornerstonejs/core';
2
- import { Annotations } from '../../types';
2
+ import type { Annotations } from '../../types';
3
3
  export default function filterAnnotationsWithinSlice(annotations: Annotations, camera: Types.ICamera, spacingInNormalDirection: number): Annotations;
@@ -3,12 +3,14 @@ import getWorldWidthAndHeightFromCorners from './getWorldWidthAndHeightFromCorne
3
3
  import filterAnnotationsForDisplay from './filterAnnotationsForDisplay';
4
4
  import getPointInLineOfSightWithCriteria from './getPointInLineOfSightWithCriteria';
5
5
  import { isPlaneIntersectingAABB } from './isPlaneIntersectingAABB';
6
+ import { filterAnnotationsWithinSamePlane } from './filterAnnotationsWithinPlane';
6
7
  declare const _default: {
7
8
  filterAnnotationsWithinSlice: typeof filterAnnotationsWithinSlice;
8
9
  getWorldWidthAndHeightFromCorners: typeof getWorldWidthAndHeightFromCorners;
9
10
  filterAnnotationsForDisplay: typeof filterAnnotationsForDisplay;
10
11
  getPointInLineOfSightWithCriteria: typeof getPointInLineOfSightWithCriteria;
11
12
  isPlaneIntersectingAABB: (origin: any, normal: any, minX: any, minY: any, minZ: any, maxX: any, maxY: any, maxZ: any) => boolean;
13
+ filterAnnotationsWithinSamePlane: typeof filterAnnotationsWithinSamePlane;
12
14
  };
13
15
  export default _default;
14
- export { filterAnnotationsWithinSlice, getWorldWidthAndHeightFromCorners, filterAnnotationsForDisplay, getPointInLineOfSightWithCriteria, isPlaneIntersectingAABB, };
16
+ export { filterAnnotationsWithinSlice, getWorldWidthAndHeightFromCorners, filterAnnotationsForDisplay, getPointInLineOfSightWithCriteria, isPlaneIntersectingAABB, filterAnnotationsWithinSamePlane, };
@@ -3,11 +3,13 @@ import getWorldWidthAndHeightFromCorners from './getWorldWidthAndHeightFromCorne
3
3
  import filterAnnotationsForDisplay from './filterAnnotationsForDisplay';
4
4
  import getPointInLineOfSightWithCriteria from './getPointInLineOfSightWithCriteria';
5
5
  import { isPlaneIntersectingAABB } from './isPlaneIntersectingAABB';
6
+ import { filterAnnotationsWithinSamePlane } from './filterAnnotationsWithinPlane';
6
7
  export default {
7
8
  filterAnnotationsWithinSlice,
8
9
  getWorldWidthAndHeightFromCorners,
9
10
  filterAnnotationsForDisplay,
10
11
  getPointInLineOfSightWithCriteria,
11
12
  isPlaneIntersectingAABB,
13
+ filterAnnotationsWithinSamePlane,
12
14
  };
13
- export { filterAnnotationsWithinSlice, getWorldWidthAndHeightFromCorners, filterAnnotationsForDisplay, getPointInLineOfSightWithCriteria, isPlaneIntersectingAABB, };
15
+ export { filterAnnotationsWithinSlice, getWorldWidthAndHeightFromCorners, filterAnnotationsForDisplay, getPointInLineOfSightWithCriteria, isPlaneIntersectingAABB, filterAnnotationsWithinSamePlane, };
@@ -1,2 +1,2 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  export declare function interpolatePoints(originalPoints: (Types.Point2 | Types.Point3)[], knotsIndexes: number[]): (Types.Point2 | Types.Point3)[];
@@ -1,2 +1,2 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  export default function interpolateSegmentPoints(points: (Types.Point2 | Types.Point3)[], iniIndex: number, endIndex: number, knotsRatioPercentage: number): (Types.Point2 | Types.Point3)[];
@@ -1,3 +1,3 @@
1
- import { Types } from '@cornerstonejs/core';
2
- import { PlanarFreehandROIAnnotation } from '../../types/ToolSpecificAnnotationTypes';
1
+ import type { Types } from '@cornerstonejs/core';
2
+ import type { PlanarFreehandROIAnnotation } from '../../types/ToolSpecificAnnotationTypes';
3
3
  export default function smoothAnnotation(enabledElement: Types.IEnabledElement, annotation: PlanarFreehandROIAnnotation, knotsRatioPercentage: number): boolean;
@@ -1,3 +1,11 @@
1
- import { Types } from '@cornerstonejs/core';
2
- export declare function shouldSmooth(configuration: Record<any, any>, annotation?: any): boolean;
3
- export declare function getInterpolatedPoints(configuration: Record<any, any>, points: Types.Point2[], pointsOfReference?: Types.Point2[]): Types.Point2[];
1
+ import type { Types } from '@cornerstonejs/core';
2
+ export declare function shouldSmooth(configuration: Record<string, {
3
+ smoothOnAdd: boolean;
4
+ smoothOnEdit: boolean;
5
+ }>, annotation?: any): boolean;
6
+ export declare function getInterpolatedPoints(configuration: Record<string, {
7
+ smoothOnAdd: boolean;
8
+ smoothOnEdit: boolean;
9
+ knotsRatioPercentageOnAdd: number;
10
+ knotsRatioPercentageOnEdit: number;
11
+ }>, points: Types.Point2[], pointsOfReference?: Types.Point2[]): Types.Point2[];
@@ -1,4 +1,4 @@
1
- import vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData';
1
+ import type vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData';
2
2
  import type { Types } from '@cornerstonejs/core';
3
3
  export declare function getPoint(points: any, idx: any): Types.Point3;
4
4
  export declare function getPolyDataPointIndexes(polyData: vtkPolyData): any[];
@@ -1,4 +1,5 @@
1
- import { Types, VolumeViewport } from '@cornerstonejs/core';
2
- import { ScrollOptions } from '../types';
3
- export default function scroll(viewport: Types.IViewport, options: ScrollOptions): void;
1
+ import type { Types } from '@cornerstonejs/core';
2
+ import { VolumeViewport } from '@cornerstonejs/core';
3
+ import type { ScrollOptions } from '../types';
4
+ export default function scroll(viewport: Types.IViewport | Types.IVideoViewport, options: ScrollOptions): void;
4
5
  export declare function scrollVolume(viewport: VolumeViewport, volumeId: string, delta: number, scrollSlabs?: boolean): void;
@@ -1,4 +1,4 @@
1
- import { StackViewport, VolumeViewport, eventTarget, EVENTS, utilities as csUtils, getEnabledElement, VideoViewport, } from '@cornerstonejs/core';
1
+ import { StackViewport, VolumeViewport, eventTarget, EVENTS, utilities as csUtils, getEnabledElement, } from '@cornerstonejs/core';
2
2
  export default function scroll(viewport, options) {
3
3
  const enabledElement = getEnabledElement(viewport.element);
4
4
  if (!enabledElement) {
@@ -8,19 +8,12 @@ export default function scroll(viewport, options) {
8
8
  viewport.getImageIds().length === 0) {
9
9
  throw new Error('Scroll::Stack Viewport has no images');
10
10
  }
11
- const { type: viewportType } = viewport;
12
11
  const { volumeId, delta, scrollSlabs } = options;
13
- if (viewport instanceof StackViewport) {
14
- viewport.scroll(delta, options.debounceLoading, options.loop);
15
- }
16
- else if (viewport instanceof VolumeViewport) {
12
+ if (viewport instanceof VolumeViewport) {
17
13
  scrollVolume(viewport, volumeId, delta, scrollSlabs);
18
14
  }
19
- else if (viewport instanceof VideoViewport) {
20
- viewport.scroll(delta);
21
- }
22
15
  else {
23
- throw new Error(`Not implemented for Viewport Type: ${viewportType}`);
16
+ viewport.scroll(delta, options.debounceLoading, options.loop);
24
17
  }
25
18
  }
26
19
  export function scrollVolume(viewport, volumeId, delta, scrollSlabs = false) {
@@ -1,4 +1,4 @@
1
- import { AnnotationCompletedEventType, AnnotationModifiedEventType, AnnotationRemovedEventType } from '../../../types/EventTypes';
1
+ import type { AnnotationCompletedEventType, AnnotationModifiedEventType, AnnotationRemovedEventType } from '../../../types/EventTypes';
2
2
  import type AnnotationGroupSelector from '../../../types/AnnotationGroupSelector';
3
3
  import type { AcceptInterpolationSelector } from '../../../types/InterpolationTypes';
4
4
  export default class InterpolationManager {
@@ -3,16 +3,7 @@ export default function createLabelmapVolumeForViewport(input: {
3
3
  viewportId: string;
4
4
  renderingEngineId: string;
5
5
  segmentationId?: string;
6
- options?: {
7
- volumeId: string;
8
- scalarData: Float32Array | Uint8Array | Uint16Array | Int16Array;
9
- targetBuffer: {
10
- type: 'Float32Array' | 'Uint8Array' | 'Uint16Array' | 'Int8Array';
11
- };
12
- metadata: Types.Metadata;
13
- dimensions: Types.Point3;
14
- spacing: Types.Point3;
15
- origin: Types.Point3;
16
- direction: Types.Mat3;
6
+ options?: Types.LocalVolumeOptions & {
7
+ volumeId?: string;
17
8
  };
18
9
  }): Promise<string>;
@@ -16,7 +16,7 @@ export default async function createLabelmapVolumeForViewport(input) {
16
16
  }
17
17
  if (options) {
18
18
  const properties = structuredClone(options);
19
- await volumeLoader.createLocalVolume(properties, segmentationId);
19
+ await volumeLoader.createLocalVolume(segmentationId, properties);
20
20
  }
21
21
  else {
22
22
  const { uid: volumeId } = viewport.getDefaultActor();
@@ -1,3 +1,3 @@
1
- import { Types } from '@cornerstonejs/core';
1
+ import type { Types } from '@cornerstonejs/core';
2
2
  declare function createMergedLabelmapForIndex(labelmaps: Array<Types.IImageVolume>, segmentIndex?: number, volumeId?: string): Types.IImageVolume;
3
3
  export default createMergedLabelmapForIndex;
@@ -9,12 +9,13 @@ function createMergedLabelmapForIndex(labelmaps, segmentIndex = 1, volumeId = 'm
9
9
  }
10
10
  });
11
11
  const labelmap = labelmaps[0];
12
- const arrayType = labelmap.getScalarData().constructor;
13
- const outputData = new arrayType(labelmap.getScalarData().length);
12
+ const arrayType = labelmap.voxelManager.getConstructor();
13
+ const outputData = new arrayType(labelmap.voxelManager.getScalarDataLength());
14
14
  labelmaps.forEach((labelmap) => {
15
- const scalarData = labelmap.getScalarData();
16
- for (let i = 0; i < scalarData.length; i++) {
17
- if (scalarData[i] === segmentIndex) {
15
+ const voxelManager = labelmap.voxelManager;
16
+ const scalarDataLength = voxelManager.getScalarDataLength();
17
+ for (let i = 0; i < scalarDataLength; i++) {
18
+ if (voxelManager.getAtIndex(i) === segmentIndex) {
18
19
  outputData[i] = segmentIndex;
19
20
  }
20
21
  }
@@ -27,8 +28,7 @@ function createMergedLabelmapForIndex(labelmaps, segmentIndex = 1, volumeId = 'm
27
28
  direction: labelmap.direction,
28
29
  dimensions: labelmap.dimensions,
29
30
  };
30
- const preventCache = true;
31
- const mergedVolume = volumeLoader.createLocalVolume(options, volumeId, preventCache);
31
+ const mergedVolume = volumeLoader.createLocalVolume(volumeId, options);
32
32
  return mergedVolume;
33
33
  }
34
34
  export default createMergedLabelmapForIndex;
@@ -1,4 +1,4 @@
1
1
  import type { FloodFillResult, FloodFillGetter, FloodFillOptions } from '../../types';
2
- import { Types } from '@cornerstonejs/core';
2
+ import type { Types } from '@cornerstonejs/core';
3
3
  declare function floodFill(getter: FloodFillGetter, seed: Types.Point2 | Types.Point3, options?: FloodFillOptions): FloodFillResult;
4
4
  export default floodFill;