@cornerstonejs/tools 1.52.0 → 1.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (909) hide show
  1. package/dist/cjs/drawingSvg/drawPath.d.ts +11 -0
  2. package/dist/cjs/drawingSvg/drawPath.js +55 -0
  3. package/dist/cjs/drawingSvg/drawPath.js.map +1 -0
  4. package/dist/cjs/drawingSvg/drawPolyline.d.ts +1 -1
  5. package/dist/cjs/drawingSvg/drawPolyline.js +2 -10
  6. package/dist/cjs/drawingSvg/drawPolyline.js.map +1 -1
  7. package/dist/cjs/drawingSvg/index.d.ts +2 -1
  8. package/dist/cjs/drawingSvg/index.js +3 -1
  9. package/dist/cjs/drawingSvg/index.js.map +1 -1
  10. package/dist/cjs/enums/WorkerTypes.d.ts +8 -0
  11. package/dist/cjs/enums/WorkerTypes.js +12 -0
  12. package/dist/cjs/enums/WorkerTypes.js.map +1 -0
  13. package/dist/cjs/enums/index.d.ts +2 -1
  14. package/dist/cjs/enums/index.js +3 -1
  15. package/dist/cjs/enums/index.js.map +1 -1
  16. package/dist/cjs/eventDispatchers/shared/getActiveToolForMouseEvent.js.map +1 -1
  17. package/dist/cjs/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.d.ts +1 -1
  18. package/dist/cjs/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js +171 -89
  19. package/dist/cjs/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js.map +1 -1
  20. package/dist/cjs/eventListeners/segmentation/imageChangeEventListener.js +4 -3
  21. package/dist/cjs/eventListeners/segmentation/imageChangeEventListener.js.map +1 -1
  22. package/dist/cjs/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js +58 -47
  23. package/dist/cjs/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js.map +1 -1
  24. package/dist/cjs/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.d.ts +1 -0
  25. package/dist/cjs/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.js +5 -0
  26. package/dist/cjs/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.js.map +1 -1
  27. package/dist/cjs/stateManagement/annotation/annotationState.d.ts +7 -1
  28. package/dist/cjs/stateManagement/annotation/annotationState.js +54 -1
  29. package/dist/cjs/stateManagement/annotation/annotationState.js.map +1 -1
  30. package/dist/cjs/stateManagement/annotation/helpers/state.d.ts +2 -1
  31. package/dist/cjs/stateManagement/annotation/helpers/state.js +14 -3
  32. package/dist/cjs/stateManagement/annotation/helpers/state.js.map +1 -1
  33. package/dist/cjs/stateManagement/index.d.ts +6 -1
  34. package/dist/cjs/stateManagement/index.js +6 -1
  35. package/dist/cjs/stateManagement/index.js.map +1 -1
  36. package/dist/cjs/stateManagement/segmentation/SegmentationStateManager.js +4 -1
  37. package/dist/cjs/stateManagement/segmentation/SegmentationStateManager.js.map +1 -1
  38. package/dist/cjs/stateManagement/segmentation/addRepresentationData.d.ts +12 -0
  39. package/dist/cjs/stateManagement/segmentation/addRepresentationData.js +35 -0
  40. package/dist/cjs/stateManagement/segmentation/addRepresentationData.js.map +1 -0
  41. package/dist/cjs/stateManagement/segmentation/addSegmentationRepresentation.js +32 -14
  42. package/dist/cjs/stateManagement/segmentation/addSegmentationRepresentation.js.map +1 -1
  43. package/dist/cjs/stateManagement/segmentation/config/segmentationVisibility.js +3 -52
  44. package/dist/cjs/stateManagement/segmentation/config/segmentationVisibility.js.map +1 -1
  45. package/dist/cjs/stateManagement/segmentation/convertStackToVolumeSegmentation.d.ts +9 -2
  46. package/dist/cjs/stateManagement/segmentation/convertStackToVolumeSegmentation.js +44 -27
  47. package/dist/cjs/stateManagement/segmentation/convertStackToVolumeSegmentation.js.map +1 -1
  48. package/dist/cjs/stateManagement/segmentation/convertVolumeToStackSegmentation.d.ts +13 -0
  49. package/dist/cjs/stateManagement/segmentation/convertVolumeToStackSegmentation.js +52 -26
  50. package/dist/cjs/stateManagement/segmentation/convertVolumeToStackSegmentation.js.map +1 -1
  51. package/dist/cjs/stateManagement/segmentation/helpers/validateSegmentationInput.js +6 -9
  52. package/dist/cjs/stateManagement/segmentation/helpers/validateSegmentationInput.js.map +1 -1
  53. package/dist/cjs/stateManagement/segmentation/index.d.ts +3 -1
  54. package/dist/cjs/stateManagement/segmentation/index.js +5 -1
  55. package/dist/cjs/stateManagement/segmentation/index.js.map +1 -1
  56. package/dist/cjs/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts +2 -0
  57. package/dist/cjs/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js +8 -0
  58. package/dist/cjs/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js.map +1 -0
  59. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.d.ts +2 -0
  60. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.js +11 -0
  61. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.js.map +1 -0
  62. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.d.ts +7 -0
  63. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js +162 -0
  64. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js.map +1 -0
  65. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.d.ts +6 -0
  66. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js +71 -0
  67. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js.map +1 -0
  68. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.d.ts +6 -0
  69. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js +120 -0
  70. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js.map +1 -0
  71. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.d.ts +4 -0
  72. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.js +12 -0
  73. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.js.map +1 -0
  74. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.d.ts +3 -0
  75. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js +52 -0
  76. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js.map +1 -0
  77. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.d.ts +3 -0
  78. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js +60 -0
  79. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js.map +1 -0
  80. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.d.ts +5 -0
  81. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js +56 -0
  82. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js.map +1 -0
  83. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.d.ts +12 -0
  84. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.js +94 -0
  85. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.js.map +1 -0
  86. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.d.ts +1 -0
  87. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js +74 -0
  88. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js.map +1 -0
  89. package/dist/cjs/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.d.ts +2 -0
  90. package/dist/cjs/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js +83 -0
  91. package/dist/cjs/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js.map +1 -0
  92. package/dist/cjs/stateManagement/segmentation/polySeg/computeAndAddRepresentation.d.ts +3 -0
  93. package/dist/cjs/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js +64 -0
  94. package/dist/cjs/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js.map +1 -0
  95. package/dist/cjs/stateManagement/segmentation/polySeg/index.d.ts +5 -0
  96. package/dist/cjs/stateManagement/segmentation/polySeg/index.js +12 -0
  97. package/dist/cjs/stateManagement/segmentation/polySeg/index.js.map +1 -0
  98. package/dist/cjs/stateManagement/segmentation/polySeg/registerPolySegWorker.d.ts +1 -0
  99. package/dist/cjs/stateManagement/segmentation/polySeg/registerPolySegWorker.js +27 -0
  100. package/dist/cjs/stateManagement/segmentation/polySeg/registerPolySegWorker.js.map +1 -0
  101. package/dist/cjs/stateManagement/segmentation/segmentIndex.js +4 -0
  102. package/dist/cjs/stateManagement/segmentation/segmentIndex.js.map +1 -1
  103. package/dist/cjs/stateManagement/segmentation/segmentationState.d.ts +6 -1
  104. package/dist/cjs/stateManagement/segmentation/segmentationState.js +30 -1
  105. package/dist/cjs/stateManagement/segmentation/segmentationState.js.map +1 -1
  106. package/dist/cjs/store/ToolGroupManager/ToolGroup.d.ts +3 -1
  107. package/dist/cjs/store/ToolGroupManager/ToolGroup.js +3 -2
  108. package/dist/cjs/store/ToolGroupManager/ToolGroup.js.map +1 -1
  109. package/dist/cjs/tools/ScaleOverlayTool.js +2 -1
  110. package/dist/cjs/tools/ScaleOverlayTool.js.map +1 -1
  111. package/dist/cjs/tools/SegmentationIntersectionTool.js +1 -1
  112. package/dist/cjs/tools/SegmentationIntersectionTool.js.map +1 -1
  113. package/dist/cjs/tools/annotation/LivewireContourSegmentationTool.js +1 -1
  114. package/dist/cjs/tools/annotation/LivewireContourSegmentationTool.js.map +1 -1
  115. package/dist/cjs/tools/annotation/LivewireContourTool.d.ts +4 -3
  116. package/dist/cjs/tools/annotation/LivewireContourTool.js +26 -26
  117. package/dist/cjs/tools/annotation/LivewireContourTool.js.map +1 -1
  118. package/dist/cjs/tools/annotation/PlanarFreehandContourSegmentationTool.d.ts +1 -2
  119. package/dist/cjs/tools/annotation/PlanarFreehandContourSegmentationTool.js +0 -11
  120. package/dist/cjs/tools/annotation/PlanarFreehandContourSegmentationTool.js.map +1 -1
  121. package/dist/cjs/tools/annotation/PlanarFreehandROITool.js +2 -2
  122. package/dist/cjs/tools/annotation/PlanarFreehandROITool.js.map +1 -1
  123. package/dist/cjs/tools/annotation/ProbeTool.js +3 -0
  124. package/dist/cjs/tools/annotation/ProbeTool.js.map +1 -1
  125. package/dist/cjs/tools/annotation/SplineROITool.d.ts +6 -3
  126. package/dist/cjs/tools/annotation/SplineROITool.js +37 -18
  127. package/dist/cjs/tools/annotation/SplineROITool.js.map +1 -1
  128. package/dist/cjs/tools/annotation/planarFreehandROITool/closedContourEditLoop.js +12 -7
  129. package/dist/cjs/tools/annotation/planarFreehandROITool/closedContourEditLoop.js.map +1 -1
  130. package/dist/cjs/tools/annotation/planarFreehandROITool/drawLoop.js +25 -19
  131. package/dist/cjs/tools/annotation/planarFreehandROITool/drawLoop.js.map +1 -1
  132. package/dist/cjs/tools/annotation/planarFreehandROITool/openContourEditLoop.js +16 -10
  133. package/dist/cjs/tools/annotation/planarFreehandROITool/openContourEditLoop.js.map +1 -1
  134. package/dist/cjs/tools/annotation/planarFreehandROITool/openContourEndEditLoop.js +1 -1
  135. package/dist/cjs/tools/annotation/planarFreehandROITool/openContourEndEditLoop.js.map +1 -1
  136. package/dist/cjs/tools/annotation/planarFreehandROITool/renderMethods.js +19 -7
  137. package/dist/cjs/tools/annotation/planarFreehandROITool/renderMethods.js.map +1 -1
  138. package/dist/cjs/tools/annotation/splines/LinearSpline.js +1 -1
  139. package/dist/cjs/tools/annotation/splines/LinearSpline.js.map +1 -1
  140. package/dist/cjs/tools/annotation/splines/Spline.d.ts +2 -0
  141. package/dist/cjs/tools/annotation/splines/Spline.js +7 -3
  142. package/dist/cjs/tools/annotation/splines/Spline.js.map +1 -1
  143. package/dist/cjs/tools/base/AnnotationTool.js +1 -1
  144. package/dist/cjs/tools/base/AnnotationTool.js.map +1 -1
  145. package/dist/cjs/tools/base/BaseTool.js.map +1 -1
  146. package/dist/cjs/tools/base/ContourBaseTool.d.ts +1 -0
  147. package/dist/cjs/tools/base/ContourBaseTool.js +18 -1
  148. package/dist/cjs/tools/base/ContourBaseTool.js.map +1 -1
  149. package/dist/cjs/tools/base/ContourSegmentationBaseTool.d.ts +1 -2
  150. package/dist/cjs/tools/base/ContourSegmentationBaseTool.js +28 -24
  151. package/dist/cjs/tools/base/ContourSegmentationBaseTool.js.map +1 -1
  152. package/dist/cjs/tools/displayTools/Contour/contourConfig.js +1 -0
  153. package/dist/cjs/tools/displayTools/Contour/contourConfig.js.map +1 -1
  154. package/dist/cjs/tools/displayTools/Contour/contourDisplay.js +9 -6
  155. package/dist/cjs/tools/displayTools/Contour/contourDisplay.js.map +1 -1
  156. package/dist/cjs/tools/displayTools/Contour/removeContourFromElement.js.map +1 -1
  157. package/dist/cjs/tools/displayTools/Contour/{addContourSetsToElement.d.ts → vtkContour/addContourSetsToElement.d.ts} +1 -1
  158. package/dist/cjs/tools/displayTools/Contour/vtkContour/addContourSetsToElement.js.map +1 -0
  159. package/dist/cjs/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.d.ts +3 -0
  160. package/dist/cjs/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.js +14 -0
  161. package/dist/cjs/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.js.map +1 -0
  162. package/dist/cjs/tools/displayTools/Contour/vtkContour/contourConfigCache.js.map +1 -0
  163. package/dist/cjs/tools/displayTools/Contour/vtkContour/updateVTKContourSets.d.ts +3 -0
  164. package/dist/cjs/tools/displayTools/Contour/{updateContourSets.js → vtkContour/updateVTKContourSets.js} +4 -4
  165. package/dist/cjs/tools/displayTools/Contour/vtkContour/updateVTKContourSets.js.map +1 -0
  166. package/dist/cjs/tools/displayTools/Contour/{utils.d.ts → vtkContour/utils.d.ts} +2 -2
  167. package/dist/cjs/tools/displayTools/Contour/vtkContour/utils.js.map +1 -0
  168. package/dist/cjs/tools/displayTools/Labelmap/addLabelmapToElement.js +1 -1
  169. package/dist/cjs/tools/displayTools/Labelmap/addLabelmapToElement.js.map +1 -1
  170. package/dist/cjs/tools/displayTools/Labelmap/index.d.ts +2 -1
  171. package/dist/cjs/tools/displayTools/Labelmap/index.js +4 -1
  172. package/dist/cjs/tools/displayTools/Labelmap/index.js.map +1 -1
  173. package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js +20 -2
  174. package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
  175. package/dist/cjs/tools/displayTools/Labelmap/validateLabelmap.d.ts +4 -0
  176. package/dist/cjs/tools/displayTools/Labelmap/validateLabelmap.js +38 -0
  177. package/dist/cjs/tools/displayTools/Labelmap/validateLabelmap.js.map +1 -0
  178. package/dist/cjs/tools/displayTools/Surface/addOrUpdateSurfaceToElement.d.ts +3 -0
  179. package/dist/cjs/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js +112 -0
  180. package/dist/cjs/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js.map +1 -0
  181. package/dist/cjs/tools/displayTools/Surface/surfaceConfig.d.ts +3 -0
  182. package/dist/cjs/tools/displayTools/Surface/surfaceConfig.js +11 -0
  183. package/dist/cjs/tools/displayTools/Surface/surfaceConfig.js.map +1 -0
  184. package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.d.ts +7 -0
  185. package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.js +173 -27
  186. package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.js.map +1 -1
  187. package/dist/cjs/tools/displayTools/registerDisplayToolsWorker.d.ts +1 -0
  188. package/dist/cjs/tools/displayTools/registerDisplayToolsWorker.js +27 -0
  189. package/dist/cjs/tools/displayTools/registerDisplayToolsWorker.js.map +1 -0
  190. package/dist/cjs/tools/segmentation/BrushTool.js +1 -1
  191. package/dist/cjs/tools/segmentation/BrushTool.js.map +1 -1
  192. package/dist/cjs/tools/segmentation/CircleScissorsTool.js +1 -1
  193. package/dist/cjs/tools/segmentation/CircleScissorsTool.js.map +1 -1
  194. package/dist/cjs/tools/segmentation/PaintFillTool.js +1 -1
  195. package/dist/cjs/tools/segmentation/PaintFillTool.js.map +1 -1
  196. package/dist/cjs/tools/segmentation/RectangleScissorsTool.js +1 -1
  197. package/dist/cjs/tools/segmentation/RectangleScissorsTool.js.map +1 -1
  198. package/dist/cjs/tools/segmentation/SegmentSelectTool.d.ts +6 -2
  199. package/dist/cjs/tools/segmentation/SegmentSelectTool.js +45 -35
  200. package/dist/cjs/tools/segmentation/SegmentSelectTool.js.map +1 -1
  201. package/dist/cjs/tools/segmentation/SphereScissorsTool.js +1 -1
  202. package/dist/cjs/tools/segmentation/SphereScissorsTool.js.map +1 -1
  203. package/dist/cjs/tools/segmentation/strategies/BrushStrategy.js +7 -5
  204. package/dist/cjs/tools/segmentation/strategies/BrushStrategy.js.map +1 -1
  205. package/dist/cjs/tools/segmentation/strategies/compositions/regionFill.js +1 -1
  206. package/dist/cjs/tools/segmentation/strategies/compositions/regionFill.js.map +1 -1
  207. package/dist/cjs/tools/segmentation/strategies/fillSphere.js +14 -5
  208. package/dist/cjs/tools/segmentation/strategies/fillSphere.js.map +1 -1
  209. package/dist/cjs/tools/segmentation/strategies/utils/getStrategyData.js +21 -9
  210. package/dist/cjs/tools/segmentation/strategies/utils/getStrategyData.js.map +1 -1
  211. package/dist/cjs/tools/segmentation/strategies/utils/stackVolumeCheck.d.ts +5 -5
  212. package/dist/cjs/tools/segmentation/strategies/utils/stackVolumeCheck.js +15 -8
  213. package/dist/cjs/tools/segmentation/strategies/utils/stackVolumeCheck.js.map +1 -1
  214. package/dist/cjs/types/AnnotationTypes.d.ts +2 -0
  215. package/dist/cjs/types/ContourAnnotation.d.ts +6 -0
  216. package/dist/cjs/types/ContourAnnotation.js +7 -0
  217. package/dist/cjs/types/ContourAnnotation.js.map +1 -1
  218. package/dist/cjs/types/ContourSegmentationAnnotation.d.ts +0 -1
  219. package/dist/cjs/types/ContourTypes.d.ts +1 -0
  220. package/dist/cjs/types/EventTypes.d.ts +4 -1
  221. package/dist/cjs/types/ISpline.d.ts +1 -0
  222. package/dist/cjs/types/LabelmapTypes.d.ts +5 -1
  223. package/dist/cjs/types/PolySeg.d.ts +6 -0
  224. package/dist/cjs/types/PolySeg.js +3 -0
  225. package/dist/cjs/types/PolySeg.js.map +1 -0
  226. package/dist/cjs/types/SegmentationStateTypes.d.ts +12 -2
  227. package/dist/cjs/types/SplineProps.d.ts +1 -0
  228. package/dist/cjs/types/SurfaceTypes.d.ts +1 -1
  229. package/dist/cjs/types/index.d.ts +2 -1
  230. package/dist/cjs/utilities/boundingBox/getBoundingBoxAroundShape.js +6 -6
  231. package/dist/cjs/utilities/boundingBox/getBoundingBoxAroundShape.js.map +1 -1
  232. package/dist/cjs/utilities/contourSegmentation/addContourSegmentationAnnotation.d.ts +2 -0
  233. package/dist/cjs/utilities/contourSegmentation/addContourSegmentationAnnotation.js +20 -0
  234. package/dist/cjs/utilities/contourSegmentation/addContourSegmentationAnnotation.js.map +1 -0
  235. package/dist/cjs/utilities/contourSegmentation/areSameSegment.js +0 -2
  236. package/dist/cjs/utilities/contourSegmentation/areSameSegment.js.map +1 -1
  237. package/dist/cjs/utilities/contourSegmentation/index.d.ts +2 -0
  238. package/dist/cjs/utilities/contourSegmentation/index.js +5 -1
  239. package/dist/cjs/utilities/contourSegmentation/index.js.map +1 -1
  240. package/dist/cjs/utilities/contourSegmentation/removeContourSegmentationAnnotation.d.ts +2 -0
  241. package/dist/cjs/utilities/contourSegmentation/removeContourSegmentationAnnotation.js +19 -0
  242. package/dist/cjs/utilities/contourSegmentation/removeContourSegmentationAnnotation.js.map +1 -0
  243. package/dist/cjs/utilities/contours/detectContourHoles.js.map +1 -1
  244. package/dist/cjs/utilities/contours/generateContourSetsFromLabelmap.js +2 -2
  245. package/dist/cjs/utilities/contours/generateContourSetsFromLabelmap.js.map +1 -1
  246. package/dist/cjs/utilities/contours/getContourHolesDataCanvas.d.ts +3 -0
  247. package/dist/cjs/utilities/contours/getContourHolesDataCanvas.js +21 -0
  248. package/dist/cjs/utilities/contours/getContourHolesDataCanvas.js.map +1 -0
  249. package/dist/cjs/utilities/contours/getContourHolesDataWorld.d.ts +3 -0
  250. package/dist/cjs/utilities/contours/getContourHolesDataWorld.js +10 -0
  251. package/dist/cjs/utilities/contours/getContourHolesDataWorld.js.map +1 -0
  252. package/dist/cjs/utilities/contours/getDeduplicatedVTKPolyDataPoints.d.ts +11 -0
  253. package/dist/cjs/utilities/contours/getDeduplicatedVTKPolyDataPoints.js +50 -0
  254. package/dist/cjs/utilities/contours/getDeduplicatedVTKPolyDataPoints.js.map +1 -0
  255. package/dist/cjs/utilities/contours/index.d.ts +5 -2
  256. package/dist/cjs/utilities/contours/index.js +9 -3
  257. package/dist/cjs/utilities/contours/index.js.map +1 -1
  258. package/dist/cjs/utilities/contours/updateContourPolyline.d.ts +10 -0
  259. package/dist/cjs/utilities/contours/updateContourPolyline.js +64 -0
  260. package/dist/cjs/utilities/contours/updateContourPolyline.js.map +1 -0
  261. package/dist/cjs/utilities/index.d.ts +3 -1
  262. package/dist/cjs/utilities/index.js +5 -1
  263. package/dist/cjs/utilities/index.js.map +1 -1
  264. package/dist/cjs/utilities/math/polyline/containsPoint.js.map +1 -1
  265. package/dist/cjs/utilities/math/polyline/containsPoints.d.ts +2 -0
  266. package/dist/cjs/utilities/math/polyline/containsPoints.js +16 -0
  267. package/dist/cjs/utilities/math/polyline/containsPoints.js.map +1 -0
  268. package/dist/cjs/utilities/math/polyline/getWindingDirection.d.ts +2 -0
  269. package/dist/cjs/utilities/math/polyline/getWindingDirection.js +12 -0
  270. package/dist/cjs/utilities/math/polyline/getWindingDirection.js.map +1 -0
  271. package/dist/cjs/utilities/math/polyline/index.d.ts +4 -1
  272. package/dist/cjs/utilities/math/polyline/index.js +7 -1
  273. package/dist/cjs/utilities/math/polyline/index.js.map +1 -1
  274. package/dist/cjs/utilities/math/polyline/isPointInsidePolyline3D.d.ts +2 -0
  275. package/dist/cjs/utilities/math/polyline/isPointInsidePolyline3D.js +34 -0
  276. package/dist/cjs/utilities/math/polyline/isPointInsidePolyline3D.js.map +1 -0
  277. package/dist/cjs/utilities/math/polyline/planarFreehandROIInternalTypes.d.ts +1 -0
  278. package/dist/cjs/utilities/segmentation/contourAndFindLargestBidirectional.js +0 -1
  279. package/dist/cjs/utilities/segmentation/contourAndFindLargestBidirectional.js.map +1 -1
  280. package/dist/cjs/utilities/segmentation/getHoveredContourSegmentationAnnotation.d.ts +1 -0
  281. package/dist/cjs/utilities/segmentation/getHoveredContourSegmentationAnnotation.js +18 -0
  282. package/dist/cjs/utilities/segmentation/getHoveredContourSegmentationAnnotation.js.map +1 -0
  283. package/dist/cjs/utilities/segmentation/getSegmentAtLabelmapBorder.d.ts +7 -0
  284. package/dist/cjs/utilities/segmentation/getSegmentAtLabelmapBorder.js +77 -0
  285. package/dist/cjs/utilities/segmentation/getSegmentAtLabelmapBorder.js.map +1 -0
  286. package/dist/cjs/utilities/segmentation/getSegmentAtWorldPoint.d.ts +11 -0
  287. package/dist/cjs/utilities/segmentation/getSegmentAtWorldPoint.js +82 -0
  288. package/dist/cjs/utilities/segmentation/getSegmentAtWorldPoint.js.map +1 -0
  289. package/dist/cjs/utilities/segmentation/getUniqueSegmentIndices.d.ts +2 -0
  290. package/dist/cjs/utilities/segmentation/getUniqueSegmentIndices.js +59 -0
  291. package/dist/cjs/utilities/segmentation/getUniqueSegmentIndices.js.map +1 -0
  292. package/dist/cjs/utilities/segmentation/index.d.ts +5 -1
  293. package/dist/cjs/utilities/segmentation/index.js +9 -1
  294. package/dist/cjs/utilities/segmentation/index.js.map +1 -1
  295. package/dist/cjs/utilities/triggerAnnotationRenderForToolGroupIds.d.ts +2 -0
  296. package/dist/cjs/utilities/triggerAnnotationRenderForToolGroupIds.js +32 -0
  297. package/dist/cjs/utilities/triggerAnnotationRenderForToolGroupIds.js.map +1 -0
  298. package/dist/cjs/workers/clippingPlaneWorker.d.ts +1 -0
  299. package/dist/cjs/workers/clippingPlaneWorker.js +63 -0
  300. package/dist/cjs/workers/clippingPlaneWorker.js.map +1 -0
  301. package/dist/cjs/workers/polySegConverters.d.ts +1 -0
  302. package/dist/cjs/workers/polySegConverters.js +267 -0
  303. package/dist/cjs/workers/polySegConverters.js.map +1 -0
  304. package/dist/esm/drawingSvg/drawPath.js +49 -0
  305. package/dist/esm/drawingSvg/drawPath.js.map +1 -0
  306. package/dist/esm/drawingSvg/drawPolyline.js +2 -10
  307. package/dist/esm/drawingSvg/drawPolyline.js.map +1 -1
  308. package/dist/esm/drawingSvg/index.js +2 -1
  309. package/dist/esm/drawingSvg/index.js.map +1 -1
  310. package/dist/esm/enums/WorkerTypes.js +10 -0
  311. package/dist/esm/enums/WorkerTypes.js.map +1 -0
  312. package/dist/esm/enums/index.js +2 -1
  313. package/dist/esm/enums/index.js.map +1 -1
  314. package/dist/esm/eventDispatchers/shared/getActiveToolForMouseEvent.js.map +1 -1
  315. package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js +112 -43
  316. package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js.map +1 -1
  317. package/dist/esm/eventListeners/segmentation/imageChangeEventListener.js +3 -3
  318. package/dist/esm/eventListeners/segmentation/imageChangeEventListener.js.map +1 -1
  319. package/dist/esm/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js +59 -45
  320. package/dist/esm/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js.map +1 -1
  321. package/dist/esm/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.js +5 -0
  322. package/dist/esm/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.js.map +1 -1
  323. package/dist/esm/stateManagement/annotation/annotationState.js +46 -1
  324. package/dist/esm/stateManagement/annotation/annotationState.js.map +1 -1
  325. package/dist/esm/stateManagement/annotation/helpers/state.js +12 -2
  326. package/dist/esm/stateManagement/annotation/helpers/state.js.map +1 -1
  327. package/dist/esm/stateManagement/index.js +2 -2
  328. package/dist/esm/stateManagement/index.js.map +1 -1
  329. package/dist/esm/stateManagement/segmentation/SegmentationStateManager.js +4 -1
  330. package/dist/esm/stateManagement/segmentation/SegmentationStateManager.js.map +1 -1
  331. package/dist/esm/stateManagement/segmentation/addRepresentationData.js +30 -0
  332. package/dist/esm/stateManagement/segmentation/addRepresentationData.js.map +1 -0
  333. package/dist/esm/stateManagement/segmentation/addSegmentationRepresentation.js +32 -15
  334. package/dist/esm/stateManagement/segmentation/addSegmentationRepresentation.js.map +1 -1
  335. package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js +1 -46
  336. package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js.map +1 -1
  337. package/dist/esm/stateManagement/segmentation/convertStackToVolumeSegmentation.js +42 -27
  338. package/dist/esm/stateManagement/segmentation/convertStackToVolumeSegmentation.js.map +1 -1
  339. package/dist/esm/stateManagement/segmentation/convertVolumeToStackSegmentation.js +49 -25
  340. package/dist/esm/stateManagement/segmentation/convertVolumeToStackSegmentation.js.map +1 -1
  341. package/dist/esm/stateManagement/segmentation/helpers/validateSegmentationInput.js +6 -6
  342. package/dist/esm/stateManagement/segmentation/helpers/validateSegmentationInput.js.map +1 -1
  343. package/dist/esm/stateManagement/segmentation/index.js +3 -1
  344. package/dist/esm/stateManagement/segmentation/index.js.map +1 -1
  345. package/dist/esm/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js +4 -0
  346. package/dist/esm/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js.map +1 -0
  347. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.js +7 -0
  348. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.js.map +1 -0
  349. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js +142 -0
  350. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js.map +1 -0
  351. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js +53 -0
  352. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js.map +1 -0
  353. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js +108 -0
  354. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js.map +1 -0
  355. package/dist/esm/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.js +8 -0
  356. package/dist/esm/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.js.map +1 -0
  357. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js +37 -0
  358. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js.map +1 -0
  359. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js +45 -0
  360. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js.map +1 -0
  361. package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js +41 -0
  362. package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js.map +1 -0
  363. package/dist/esm/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.js +78 -0
  364. package/dist/esm/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.js.map +1 -0
  365. package/dist/esm/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js +59 -0
  366. package/dist/esm/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js.map +1 -0
  367. package/dist/esm/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js +68 -0
  368. package/dist/esm/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js.map +1 -0
  369. package/dist/esm/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js +47 -0
  370. package/dist/esm/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js.map +1 -0
  371. package/dist/esm/stateManagement/segmentation/polySeg/index.js +6 -0
  372. package/dist/esm/stateManagement/segmentation/polySeg/index.js.map +1 -0
  373. package/dist/esm/stateManagement/segmentation/polySeg/registerPolySegWorker.js +23 -0
  374. package/dist/esm/stateManagement/segmentation/polySeg/registerPolySegWorker.js.map +1 -0
  375. package/dist/esm/stateManagement/segmentation/segmentIndex.js +4 -0
  376. package/dist/esm/stateManagement/segmentation/segmentIndex.js.map +1 -1
  377. package/dist/esm/stateManagement/segmentation/segmentationState.js +28 -1
  378. package/dist/esm/stateManagement/segmentation/segmentationState.js.map +1 -1
  379. package/dist/esm/store/ToolGroupManager/ToolGroup.js +3 -2
  380. package/dist/esm/store/ToolGroupManager/ToolGroup.js.map +1 -1
  381. package/dist/esm/tools/ScaleOverlayTool.js +2 -1
  382. package/dist/esm/tools/ScaleOverlayTool.js.map +1 -1
  383. package/dist/esm/tools/SegmentationIntersectionTool.js +1 -1
  384. package/dist/esm/tools/SegmentationIntersectionTool.js.map +1 -1
  385. package/dist/esm/tools/annotation/LivewireContourSegmentationTool.js +1 -1
  386. package/dist/esm/tools/annotation/LivewireContourSegmentationTool.js.map +1 -1
  387. package/dist/esm/tools/annotation/LivewireContourTool.js +28 -28
  388. package/dist/esm/tools/annotation/LivewireContourTool.js.map +1 -1
  389. package/dist/esm/tools/annotation/PlanarFreehandContourSegmentationTool.js +0 -11
  390. package/dist/esm/tools/annotation/PlanarFreehandContourSegmentationTool.js.map +1 -1
  391. package/dist/esm/tools/annotation/PlanarFreehandROITool.js +3 -3
  392. package/dist/esm/tools/annotation/PlanarFreehandROITool.js.map +1 -1
  393. package/dist/esm/tools/annotation/ProbeTool.js +3 -0
  394. package/dist/esm/tools/annotation/ProbeTool.js.map +1 -1
  395. package/dist/esm/tools/annotation/SplineROITool.js +37 -19
  396. package/dist/esm/tools/annotation/SplineROITool.js.map +1 -1
  397. package/dist/esm/tools/annotation/planarFreehandROITool/closedContourEditLoop.js +12 -7
  398. package/dist/esm/tools/annotation/planarFreehandROITool/closedContourEditLoop.js.map +1 -1
  399. package/dist/esm/tools/annotation/planarFreehandROITool/drawLoop.js +26 -20
  400. package/dist/esm/tools/annotation/planarFreehandROITool/drawLoop.js.map +1 -1
  401. package/dist/esm/tools/annotation/planarFreehandROITool/openContourEditLoop.js +16 -10
  402. package/dist/esm/tools/annotation/planarFreehandROITool/openContourEditLoop.js.map +1 -1
  403. package/dist/esm/tools/annotation/planarFreehandROITool/openContourEndEditLoop.js +1 -1
  404. package/dist/esm/tools/annotation/planarFreehandROITool/openContourEndEditLoop.js.map +1 -1
  405. package/dist/esm/tools/annotation/planarFreehandROITool/renderMethods.js +20 -8
  406. package/dist/esm/tools/annotation/planarFreehandROITool/renderMethods.js.map +1 -1
  407. package/dist/esm/tools/annotation/splines/LinearSpline.js +1 -1
  408. package/dist/esm/tools/annotation/splines/LinearSpline.js.map +1 -1
  409. package/dist/esm/tools/annotation/splines/Spline.js +5 -1
  410. package/dist/esm/tools/annotation/splines/Spline.js.map +1 -1
  411. package/dist/esm/tools/base/AnnotationTool.js +1 -1
  412. package/dist/esm/tools/base/AnnotationTool.js.map +1 -1
  413. package/dist/esm/tools/base/BaseTool.js +1 -1
  414. package/dist/esm/tools/base/BaseTool.js.map +1 -1
  415. package/dist/esm/tools/base/ContourBaseTool.js +20 -3
  416. package/dist/esm/tools/base/ContourBaseTool.js.map +1 -1
  417. package/dist/esm/tools/base/ContourSegmentationBaseTool.js +28 -24
  418. package/dist/esm/tools/base/ContourSegmentationBaseTool.js.map +1 -1
  419. package/dist/esm/tools/displayTools/Contour/contourConfig.js +1 -0
  420. package/dist/esm/tools/displayTools/Contour/contourConfig.js.map +1 -1
  421. package/dist/esm/tools/displayTools/Contour/contourDisplay.js +10 -7
  422. package/dist/esm/tools/displayTools/Contour/contourDisplay.js.map +1 -1
  423. package/dist/esm/tools/displayTools/Contour/removeContourFromElement.js.map +1 -1
  424. package/dist/esm/tools/displayTools/Contour/vtkContour/addContourSetsToElement.js.map +1 -0
  425. package/dist/esm/tools/displayTools/Contour/{addOrUpdateContourSets.js → vtkContour/addOrUpdateVTKContourSets.js} +4 -4
  426. package/dist/esm/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.js.map +1 -0
  427. package/dist/esm/tools/displayTools/Contour/vtkContour/contourConfigCache.js.map +1 -0
  428. package/dist/esm/tools/displayTools/Contour/{updateContourSets.js → vtkContour/updateVTKContourSets.js} +2 -2
  429. package/dist/esm/tools/displayTools/Contour/vtkContour/updateVTKContourSets.js.map +1 -0
  430. package/dist/esm/tools/displayTools/Contour/vtkContour/utils.js.map +1 -0
  431. package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.js +1 -1
  432. package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.js.map +1 -1
  433. package/dist/esm/tools/displayTools/Labelmap/index.js +2 -1
  434. package/dist/esm/tools/displayTools/Labelmap/index.js.map +1 -1
  435. package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js +20 -2
  436. package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
  437. package/dist/esm/tools/displayTools/Labelmap/validateLabelmap.js +33 -0
  438. package/dist/esm/tools/displayTools/Labelmap/validateLabelmap.js.map +1 -0
  439. package/dist/esm/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js +106 -0
  440. package/dist/esm/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js.map +1 -0
  441. package/dist/esm/tools/displayTools/Surface/surfaceConfig.js +9 -0
  442. package/dist/esm/tools/displayTools/Surface/surfaceConfig.js.map +1 -0
  443. package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js +162 -28
  444. package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js.map +1 -1
  445. package/dist/esm/tools/displayTools/registerDisplayToolsWorker.js +23 -0
  446. package/dist/esm/tools/displayTools/registerDisplayToolsWorker.js.map +1 -0
  447. package/dist/esm/tools/segmentation/BrushTool.js +1 -1
  448. package/dist/esm/tools/segmentation/BrushTool.js.map +1 -1
  449. package/dist/esm/tools/segmentation/CircleScissorsTool.js +1 -1
  450. package/dist/esm/tools/segmentation/CircleScissorsTool.js.map +1 -1
  451. package/dist/esm/tools/segmentation/PaintFillTool.js +1 -1
  452. package/dist/esm/tools/segmentation/PaintFillTool.js.map +1 -1
  453. package/dist/esm/tools/segmentation/RectangleScissorsTool.js +1 -1
  454. package/dist/esm/tools/segmentation/RectangleScissorsTool.js.map +1 -1
  455. package/dist/esm/tools/segmentation/SegmentSelectTool.js +47 -37
  456. package/dist/esm/tools/segmentation/SegmentSelectTool.js.map +1 -1
  457. package/dist/esm/tools/segmentation/SphereScissorsTool.js +1 -1
  458. package/dist/esm/tools/segmentation/SphereScissorsTool.js.map +1 -1
  459. package/dist/esm/tools/segmentation/strategies/BrushStrategy.js +7 -5
  460. package/dist/esm/tools/segmentation/strategies/BrushStrategy.js.map +1 -1
  461. package/dist/esm/tools/segmentation/strategies/compositions/regionFill.js +1 -1
  462. package/dist/esm/tools/segmentation/strategies/compositions/regionFill.js.map +1 -1
  463. package/dist/esm/tools/segmentation/strategies/fillSphere.js +14 -5
  464. package/dist/esm/tools/segmentation/strategies/fillSphere.js.map +1 -1
  465. package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.js +21 -9
  466. package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.js.map +1 -1
  467. package/dist/esm/tools/segmentation/strategies/utils/stackVolumeCheck.js +15 -7
  468. package/dist/esm/tools/segmentation/strategies/utils/stackVolumeCheck.js.map +1 -1
  469. package/dist/esm/types/ContourAnnotation.js +6 -1
  470. package/dist/esm/types/ContourAnnotation.js.map +1 -1
  471. package/dist/esm/types/PolySeg.js +2 -0
  472. package/dist/esm/types/PolySeg.js.map +1 -0
  473. package/dist/esm/utilities/boundingBox/getBoundingBoxAroundShape.js +3 -2
  474. package/dist/esm/utilities/boundingBox/getBoundingBoxAroundShape.js.map +1 -1
  475. package/dist/esm/utilities/contourSegmentation/addContourSegmentationAnnotation.js +16 -0
  476. package/dist/esm/utilities/contourSegmentation/addContourSegmentationAnnotation.js.map +1 -0
  477. package/dist/esm/utilities/contourSegmentation/areSameSegment.js +0 -2
  478. package/dist/esm/utilities/contourSegmentation/areSameSegment.js.map +1 -1
  479. package/dist/esm/utilities/contourSegmentation/index.js +2 -0
  480. package/dist/esm/utilities/contourSegmentation/index.js.map +1 -1
  481. package/dist/esm/utilities/contourSegmentation/removeContourSegmentationAnnotation.js +15 -0
  482. package/dist/esm/utilities/contourSegmentation/removeContourSegmentationAnnotation.js.map +1 -0
  483. package/dist/esm/utilities/contours/detectContourHoles.js.map +1 -1
  484. package/dist/esm/utilities/contours/generateContourSetsFromLabelmap.js +2 -2
  485. package/dist/esm/utilities/contours/generateContourSetsFromLabelmap.js.map +1 -1
  486. package/dist/esm/utilities/contours/getContourHolesDataCanvas.js +15 -0
  487. package/dist/esm/utilities/contours/getContourHolesDataCanvas.js.map +1 -0
  488. package/dist/esm/utilities/contours/getContourHolesDataWorld.js +6 -0
  489. package/dist/esm/utilities/contours/getContourHolesDataWorld.js.map +1 -0
  490. package/dist/esm/utilities/contours/getDeduplicatedVTKPolyDataPoints.js +46 -0
  491. package/dist/esm/utilities/contours/getDeduplicatedVTKPolyDataPoints.js.map +1 -0
  492. package/dist/esm/utilities/contours/index.js +5 -2
  493. package/dist/esm/utilities/contours/index.js.map +1 -1
  494. package/dist/esm/utilities/contours/updateContourPolyline.js +38 -0
  495. package/dist/esm/utilities/contours/updateContourPolyline.js.map +1 -0
  496. package/dist/esm/utilities/index.js +3 -1
  497. package/dist/esm/utilities/index.js.map +1 -1
  498. package/dist/esm/utilities/math/polyline/containsPoint.js.map +1 -1
  499. package/dist/esm/utilities/math/polyline/containsPoints.js +10 -0
  500. package/dist/esm/utilities/math/polyline/containsPoints.js.map +1 -0
  501. package/dist/esm/utilities/math/polyline/getWindingDirection.js +6 -0
  502. package/dist/esm/utilities/math/polyline/getWindingDirection.js.map +1 -0
  503. package/dist/esm/utilities/math/polyline/index.js +4 -1
  504. package/dist/esm/utilities/math/polyline/index.js.map +1 -1
  505. package/dist/esm/utilities/math/polyline/isPointInsidePolyline3D.js +27 -0
  506. package/dist/esm/utilities/math/polyline/isPointInsidePolyline3D.js.map +1 -0
  507. package/dist/esm/utilities/segmentation/contourAndFindLargestBidirectional.js +0 -1
  508. package/dist/esm/utilities/segmentation/contourAndFindLargestBidirectional.js.map +1 -1
  509. package/dist/esm/utilities/segmentation/getHoveredContourSegmentationAnnotation.js +14 -0
  510. package/dist/esm/utilities/segmentation/getHoveredContourSegmentationAnnotation.js.map +1 -0
  511. package/dist/esm/utilities/segmentation/getSegmentAtLabelmapBorder.js +73 -0
  512. package/dist/esm/utilities/segmentation/getSegmentAtLabelmapBorder.js.map +1 -0
  513. package/dist/esm/utilities/segmentation/getSegmentAtWorldPoint.js +75 -0
  514. package/dist/esm/utilities/segmentation/getSegmentAtWorldPoint.js.map +1 -0
  515. package/dist/esm/utilities/segmentation/getUniqueSegmentIndices.js +55 -0
  516. package/dist/esm/utilities/segmentation/getUniqueSegmentIndices.js.map +1 -0
  517. package/dist/esm/utilities/segmentation/index.js +5 -1
  518. package/dist/esm/utilities/segmentation/index.js.map +1 -1
  519. package/dist/esm/utilities/triggerAnnotationRenderForToolGroupIds.js +25 -0
  520. package/dist/esm/utilities/triggerAnnotationRenderForToolGroupIds.js.map +1 -0
  521. package/dist/esm/workers/clippingPlaneWorker.js +58 -0
  522. package/dist/esm/workers/clippingPlaneWorker.js.map +1 -0
  523. package/dist/esm/workers/polySegConverters.js +241 -0
  524. package/dist/esm/workers/polySegConverters.js.map +1 -0
  525. package/dist/types/drawingSvg/drawPath.d.ts +12 -0
  526. package/dist/types/drawingSvg/drawPath.d.ts.map +1 -0
  527. package/dist/types/drawingSvg/drawPolyline.d.ts +1 -1
  528. package/dist/types/drawingSvg/drawPolyline.d.ts.map +1 -1
  529. package/dist/types/drawingSvg/index.d.ts +2 -1
  530. package/dist/types/drawingSvg/index.d.ts.map +1 -1
  531. package/dist/types/enums/WorkerTypes.d.ts +9 -0
  532. package/dist/types/enums/WorkerTypes.d.ts.map +1 -0
  533. package/dist/types/enums/index.d.ts +2 -1
  534. package/dist/types/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.d.ts +1 -1
  535. package/dist/types/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.d.ts.map +1 -1
  536. package/dist/types/eventListeners/segmentation/imageChangeEventListener.d.ts.map +1 -1
  537. package/dist/types/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.d.ts.map +1 -1
  538. package/dist/types/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.d.ts +1 -0
  539. package/dist/types/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.d.ts.map +1 -1
  540. package/dist/types/stateManagement/annotation/annotationState.d.ts +7 -1
  541. package/dist/types/stateManagement/annotation/annotationState.d.ts.map +1 -1
  542. package/dist/types/stateManagement/annotation/helpers/state.d.ts +2 -1
  543. package/dist/types/stateManagement/annotation/helpers/state.d.ts.map +1 -1
  544. package/dist/types/stateManagement/index.d.ts +6 -1
  545. package/dist/types/stateManagement/segmentation/SegmentationStateManager.d.ts.map +1 -1
  546. package/dist/types/stateManagement/segmentation/addRepresentationData.d.ts +13 -0
  547. package/dist/types/stateManagement/segmentation/addRepresentationData.d.ts.map +1 -0
  548. package/dist/types/stateManagement/segmentation/addSegmentationRepresentation.d.ts.map +1 -1
  549. package/dist/types/stateManagement/segmentation/config/segmentationVisibility.d.ts.map +1 -1
  550. package/dist/types/stateManagement/segmentation/convertStackToVolumeSegmentation.d.ts +9 -2
  551. package/dist/types/stateManagement/segmentation/convertStackToVolumeSegmentation.d.ts.map +1 -1
  552. package/dist/types/stateManagement/segmentation/convertVolumeToStackSegmentation.d.ts +13 -0
  553. package/dist/types/stateManagement/segmentation/convertVolumeToStackSegmentation.d.ts.map +1 -1
  554. package/dist/types/stateManagement/segmentation/helpers/validateSegmentationInput.d.ts.map +1 -1
  555. package/dist/types/stateManagement/segmentation/index.d.ts +3 -1
  556. package/dist/types/stateManagement/segmentation/index.d.ts.map +1 -1
  557. package/dist/types/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts +3 -0
  558. package/dist/types/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts.map +1 -0
  559. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.d.ts +3 -0
  560. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.d.ts.map +1 -0
  561. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.d.ts +8 -0
  562. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.d.ts.map +1 -0
  563. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.d.ts +7 -0
  564. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.d.ts.map +1 -0
  565. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.d.ts +7 -0
  566. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.d.ts.map +1 -0
  567. package/dist/types/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.d.ts +5 -0
  568. package/dist/types/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.d.ts.map +1 -0
  569. package/dist/types/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.d.ts +4 -0
  570. package/dist/types/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.d.ts.map +1 -0
  571. package/dist/types/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.d.ts +4 -0
  572. package/dist/types/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.d.ts.map +1 -0
  573. package/dist/types/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.d.ts +6 -0
  574. package/dist/types/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.d.ts.map +1 -0
  575. package/dist/types/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.d.ts +13 -0
  576. package/dist/types/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.d.ts.map +1 -0
  577. package/dist/types/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.d.ts +2 -0
  578. package/dist/types/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.d.ts.map +1 -0
  579. package/dist/types/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.d.ts +3 -0
  580. package/dist/types/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.d.ts.map +1 -0
  581. package/dist/types/stateManagement/segmentation/polySeg/computeAndAddRepresentation.d.ts +4 -0
  582. package/dist/types/stateManagement/segmentation/polySeg/computeAndAddRepresentation.d.ts.map +1 -0
  583. package/dist/types/stateManagement/segmentation/polySeg/index.d.ts +6 -0
  584. package/dist/types/stateManagement/segmentation/polySeg/index.d.ts.map +1 -0
  585. package/dist/types/stateManagement/segmentation/polySeg/registerPolySegWorker.d.ts +2 -0
  586. package/dist/types/stateManagement/segmentation/polySeg/registerPolySegWorker.d.ts.map +1 -0
  587. package/dist/types/stateManagement/segmentation/segmentIndex.d.ts.map +1 -1
  588. package/dist/types/stateManagement/segmentation/segmentationState.d.ts +6 -1
  589. package/dist/types/stateManagement/segmentation/segmentationState.d.ts.map +1 -1
  590. package/dist/types/store/ToolGroupManager/ToolGroup.d.ts +3 -1
  591. package/dist/types/store/ToolGroupManager/ToolGroup.d.ts.map +1 -1
  592. package/dist/types/tools/ScaleOverlayTool.d.ts.map +1 -1
  593. package/dist/types/tools/annotation/LivewireContourTool.d.ts +4 -3
  594. package/dist/types/tools/annotation/LivewireContourTool.d.ts.map +1 -1
  595. package/dist/types/tools/annotation/PlanarFreehandContourSegmentationTool.d.ts +1 -2
  596. package/dist/types/tools/annotation/PlanarFreehandContourSegmentationTool.d.ts.map +1 -1
  597. package/dist/types/tools/annotation/PlanarFreehandROITool.d.ts.map +1 -1
  598. package/dist/types/tools/annotation/ProbeTool.d.ts.map +1 -1
  599. package/dist/types/tools/annotation/SplineROITool.d.ts +6 -3
  600. package/dist/types/tools/annotation/SplineROITool.d.ts.map +1 -1
  601. package/dist/types/tools/annotation/planarFreehandROITool/closedContourEditLoop.d.ts.map +1 -1
  602. package/dist/types/tools/annotation/planarFreehandROITool/drawLoop.d.ts.map +1 -1
  603. package/dist/types/tools/annotation/planarFreehandROITool/openContourEditLoop.d.ts.map +1 -1
  604. package/dist/types/tools/annotation/planarFreehandROITool/renderMethods.d.ts.map +1 -1
  605. package/dist/types/tools/annotation/splines/Spline.d.ts +2 -0
  606. package/dist/types/tools/annotation/splines/Spline.d.ts.map +1 -1
  607. package/dist/types/tools/base/AnnotationTool.d.ts.map +1 -1
  608. package/dist/types/tools/base/BaseTool.d.ts.map +1 -1
  609. package/dist/types/tools/base/ContourBaseTool.d.ts +1 -0
  610. package/dist/types/tools/base/ContourBaseTool.d.ts.map +1 -1
  611. package/dist/types/tools/base/ContourSegmentationBaseTool.d.ts +1 -2
  612. package/dist/types/tools/base/ContourSegmentationBaseTool.d.ts.map +1 -1
  613. package/dist/types/tools/displayTools/Contour/contourConfig.d.ts.map +1 -1
  614. package/dist/types/tools/displayTools/Contour/contourDisplay.d.ts.map +1 -1
  615. package/dist/types/tools/displayTools/Contour/removeContourFromElement.d.ts.map +1 -1
  616. package/dist/types/tools/displayTools/Contour/{addContourSetsToElement.d.ts → vtkContour/addContourSetsToElement.d.ts} +1 -1
  617. package/dist/types/tools/displayTools/Contour/vtkContour/addContourSetsToElement.d.ts.map +1 -0
  618. package/dist/types/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.d.ts +4 -0
  619. package/dist/types/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.d.ts.map +1 -0
  620. package/dist/types/tools/displayTools/Contour/vtkContour/contourConfigCache.d.ts.map +1 -0
  621. package/dist/types/tools/displayTools/Contour/vtkContour/updateVTKContourSets.d.ts +4 -0
  622. package/dist/types/tools/displayTools/Contour/vtkContour/updateVTKContourSets.d.ts.map +1 -0
  623. package/dist/types/tools/displayTools/Contour/{utils.d.ts → vtkContour/utils.d.ts} +2 -2
  624. package/dist/types/tools/displayTools/Contour/vtkContour/utils.d.ts.map +1 -0
  625. package/dist/types/tools/displayTools/Labelmap/index.d.ts +2 -1
  626. package/dist/types/tools/displayTools/Labelmap/index.d.ts.map +1 -1
  627. package/dist/types/tools/displayTools/Labelmap/labelmapDisplay.d.ts.map +1 -1
  628. package/dist/types/tools/displayTools/Labelmap/validateLabelmap.d.ts +5 -0
  629. package/dist/types/tools/displayTools/Labelmap/validateLabelmap.d.ts.map +1 -0
  630. package/dist/types/tools/displayTools/Surface/addOrUpdateSurfaceToElement.d.ts +4 -0
  631. package/dist/types/tools/displayTools/Surface/addOrUpdateSurfaceToElement.d.ts.map +1 -0
  632. package/dist/types/tools/displayTools/Surface/surfaceConfig.d.ts +4 -0
  633. package/dist/types/tools/displayTools/Surface/surfaceConfig.d.ts.map +1 -0
  634. package/dist/types/tools/displayTools/Surface/surfaceDisplay.d.ts +7 -0
  635. package/dist/types/tools/displayTools/Surface/surfaceDisplay.d.ts.map +1 -1
  636. package/dist/types/tools/displayTools/registerDisplayToolsWorker.d.ts +2 -0
  637. package/dist/types/tools/displayTools/registerDisplayToolsWorker.d.ts.map +1 -0
  638. package/dist/types/tools/segmentation/CircleScissorsTool.d.ts.map +1 -1
  639. package/dist/types/tools/segmentation/RectangleScissorsTool.d.ts.map +1 -1
  640. package/dist/types/tools/segmentation/SegmentSelectTool.d.ts +6 -2
  641. package/dist/types/tools/segmentation/SegmentSelectTool.d.ts.map +1 -1
  642. package/dist/types/tools/segmentation/SphereScissorsTool.d.ts.map +1 -1
  643. package/dist/types/tools/segmentation/strategies/BrushStrategy.d.ts.map +1 -1
  644. package/dist/types/tools/segmentation/strategies/fillSphere.d.ts.map +1 -1
  645. package/dist/types/tools/segmentation/strategies/utils/getStrategyData.d.ts.map +1 -1
  646. package/dist/types/tools/segmentation/strategies/utils/stackVolumeCheck.d.ts +5 -5
  647. package/dist/types/tools/segmentation/strategies/utils/stackVolumeCheck.d.ts.map +1 -1
  648. package/dist/types/types/AnnotationTypes.d.ts +2 -0
  649. package/dist/types/types/AnnotationTypes.d.ts.map +1 -1
  650. package/dist/types/types/ContourAnnotation.d.ts +6 -0
  651. package/dist/types/types/ContourAnnotation.d.ts.map +1 -1
  652. package/dist/types/types/ContourSegmentationAnnotation.d.ts +0 -1
  653. package/dist/types/types/ContourSegmentationAnnotation.d.ts.map +1 -1
  654. package/dist/types/types/ContourTypes.d.ts +1 -0
  655. package/dist/types/types/ContourTypes.d.ts.map +1 -1
  656. package/dist/types/types/EventTypes.d.ts +4 -1
  657. package/dist/types/types/EventTypes.d.ts.map +1 -1
  658. package/dist/types/types/ISpline.d.ts +1 -0
  659. package/dist/types/types/ISpline.d.ts.map +1 -1
  660. package/dist/types/types/LabelmapTypes.d.ts +5 -1
  661. package/dist/types/types/LabelmapTypes.d.ts.map +1 -1
  662. package/dist/types/types/PolySeg.d.ts +7 -0
  663. package/dist/types/types/PolySeg.d.ts.map +1 -0
  664. package/dist/types/types/SegmentationStateTypes.d.ts +12 -2
  665. package/dist/types/types/SegmentationStateTypes.d.ts.map +1 -1
  666. package/dist/types/types/SplineProps.d.ts +1 -0
  667. package/dist/types/types/SplineProps.d.ts.map +1 -1
  668. package/dist/types/types/SurfaceTypes.d.ts +1 -1
  669. package/dist/types/types/SurfaceTypes.d.ts.map +1 -1
  670. package/dist/types/types/index.d.ts +2 -1
  671. package/dist/types/types/index.d.ts.map +1 -1
  672. package/dist/types/utilities/boundingBox/getBoundingBoxAroundShape.d.ts.map +1 -1
  673. package/dist/types/utilities/contourSegmentation/addContourSegmentationAnnotation.d.ts +3 -0
  674. package/dist/types/utilities/contourSegmentation/addContourSegmentationAnnotation.d.ts.map +1 -0
  675. package/dist/types/utilities/contourSegmentation/areSameSegment.d.ts.map +1 -1
  676. package/dist/types/utilities/contourSegmentation/index.d.ts +2 -0
  677. package/dist/types/utilities/contourSegmentation/index.d.ts.map +1 -1
  678. package/dist/types/utilities/contourSegmentation/removeContourSegmentationAnnotation.d.ts +3 -0
  679. package/dist/types/utilities/contourSegmentation/removeContourSegmentationAnnotation.d.ts.map +1 -0
  680. package/dist/types/utilities/contours/detectContourHoles.d.ts.map +1 -1
  681. package/dist/types/utilities/contours/getContourHolesDataCanvas.d.ts +4 -0
  682. package/dist/types/utilities/contours/getContourHolesDataCanvas.d.ts.map +1 -0
  683. package/dist/types/utilities/contours/getContourHolesDataWorld.d.ts +4 -0
  684. package/dist/types/utilities/contours/getContourHolesDataWorld.d.ts.map +1 -0
  685. package/dist/types/utilities/contours/getDeduplicatedVTKPolyDataPoints.d.ts +12 -0
  686. package/dist/types/utilities/contours/getDeduplicatedVTKPolyDataPoints.d.ts.map +1 -0
  687. package/dist/types/utilities/contours/index.d.ts +5 -2
  688. package/dist/types/utilities/contours/index.d.ts.map +1 -1
  689. package/dist/types/utilities/contours/updateContourPolyline.d.ts +11 -0
  690. package/dist/types/utilities/contours/updateContourPolyline.d.ts.map +1 -0
  691. package/dist/types/utilities/index.d.ts +3 -1
  692. package/dist/types/utilities/index.d.ts.map +1 -1
  693. package/dist/types/utilities/math/polyline/containsPoint.d.ts.map +1 -1
  694. package/dist/types/utilities/math/polyline/containsPoints.d.ts +3 -0
  695. package/dist/types/utilities/math/polyline/containsPoints.d.ts.map +1 -0
  696. package/dist/types/utilities/math/polyline/getWindingDirection.d.ts +3 -0
  697. package/dist/types/utilities/math/polyline/getWindingDirection.d.ts.map +1 -0
  698. package/dist/types/utilities/math/polyline/index.d.ts +4 -1
  699. package/dist/types/utilities/math/polyline/index.d.ts.map +1 -1
  700. package/dist/types/utilities/math/polyline/isPointInsidePolyline3D.d.ts +3 -0
  701. package/dist/types/utilities/math/polyline/isPointInsidePolyline3D.d.ts.map +1 -0
  702. package/dist/types/utilities/math/polyline/planarFreehandROIInternalTypes.d.ts +1 -0
  703. package/dist/types/utilities/math/polyline/planarFreehandROIInternalTypes.d.ts.map +1 -1
  704. package/dist/types/utilities/segmentation/contourAndFindLargestBidirectional.d.ts.map +1 -1
  705. package/dist/types/utilities/segmentation/getHoveredContourSegmentationAnnotation.d.ts +2 -0
  706. package/dist/types/utilities/segmentation/getHoveredContourSegmentationAnnotation.d.ts.map +1 -0
  707. package/dist/types/utilities/segmentation/getSegmentAtLabelmapBorder.d.ts +8 -0
  708. package/dist/types/utilities/segmentation/getSegmentAtLabelmapBorder.d.ts.map +1 -0
  709. package/dist/types/utilities/segmentation/getSegmentAtWorldPoint.d.ts +12 -0
  710. package/dist/types/utilities/segmentation/getSegmentAtWorldPoint.d.ts.map +1 -0
  711. package/dist/types/utilities/segmentation/getUniqueSegmentIndices.d.ts +3 -0
  712. package/dist/types/utilities/segmentation/getUniqueSegmentIndices.d.ts.map +1 -0
  713. package/dist/types/utilities/segmentation/index.d.ts +5 -1
  714. package/dist/types/utilities/segmentation/index.d.ts.map +1 -1
  715. package/dist/types/utilities/triggerAnnotationRenderForToolGroupIds.d.ts +3 -0
  716. package/dist/types/utilities/triggerAnnotationRenderForToolGroupIds.d.ts.map +1 -0
  717. package/dist/types/workers/clippingPlaneWorker.d.ts +2 -0
  718. package/dist/types/workers/clippingPlaneWorker.d.ts.map +1 -0
  719. package/dist/types/workers/polySegConverters.d.ts +2 -0
  720. package/dist/types/workers/polySegConverters.d.ts.map +1 -0
  721. package/dist/umd/17dd54813d5acc10bf8f.wasm +0 -0
  722. package/dist/umd/444.index.js +3 -0
  723. package/dist/umd/444.index.js.LICENSE.txt +5 -0
  724. package/dist/umd/444.index.js.map +1 -0
  725. package/dist/umd/78.index.js +3 -0
  726. package/dist/umd/78.index.js.LICENSE.txt +5 -0
  727. package/dist/umd/78.index.js.map +1 -0
  728. package/dist/umd/985.index.js +2 -0
  729. package/dist/umd/985.index.js.map +1 -0
  730. package/dist/umd/index.js +1 -1
  731. package/dist/umd/index.js.map +1 -1
  732. package/package.json +5 -3
  733. package/src/drawingSvg/drawPath.ts +96 -0
  734. package/src/drawingSvg/drawPolyline.ts +12 -16
  735. package/src/drawingSvg/index.ts +2 -0
  736. package/src/enums/WorkerTypes.ts +16 -0
  737. package/src/enums/index.js +2 -0
  738. package/src/eventDispatchers/shared/getActiveToolForMouseEvent.ts +1 -1
  739. package/src/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.ts +204 -75
  740. package/src/eventListeners/segmentation/imageChangeEventListener.ts +3 -4
  741. package/src/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.ts +97 -69
  742. package/src/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.ts +11 -0
  743. package/src/stateManagement/annotation/annotationState.ts +107 -0
  744. package/src/stateManagement/annotation/helpers/state.ts +29 -1
  745. package/src/stateManagement/index.js +10 -0
  746. package/src/stateManagement/segmentation/SegmentationStateManager.ts +4 -1
  747. package/src/stateManagement/segmentation/addRepresentationData.ts +71 -0
  748. package/src/stateManagement/segmentation/addSegmentationRepresentation.ts +39 -16
  749. package/src/stateManagement/segmentation/config/segmentationVisibility.ts +1 -59
  750. package/src/stateManagement/segmentation/convertStackToVolumeSegmentation.ts +74 -37
  751. package/src/stateManagement/segmentation/convertVolumeToStackSegmentation.ts +102 -38
  752. package/src/stateManagement/segmentation/helpers/validateSegmentationInput.ts +13 -8
  753. package/src/stateManagement/segmentation/index.ts +9 -2
  754. package/src/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.ts +17 -0
  755. package/src/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.ts +25 -0
  756. package/src/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.ts +273 -0
  757. package/src/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.ts +89 -0
  758. package/src/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.ts +193 -0
  759. package/src/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.ts +26 -0
  760. package/src/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.ts +62 -0
  761. package/src/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.ts +81 -0
  762. package/src/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.ts +81 -0
  763. package/src/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.ts +167 -0
  764. package/src/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.ts +95 -0
  765. package/src/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.ts +123 -0
  766. package/src/stateManagement/segmentation/polySeg/computeAndAddRepresentation.ts +97 -0
  767. package/src/stateManagement/segmentation/polySeg/index.ts +12 -0
  768. package/src/stateManagement/segmentation/polySeg/registerPolySegWorker.ts +34 -0
  769. package/src/stateManagement/segmentation/segmentIndex.ts +5 -0
  770. package/src/stateManagement/segmentation/segmentationState.ts +62 -0
  771. package/src/store/ToolGroupManager/ToolGroup.ts +9 -2
  772. package/src/tools/ScaleOverlayTool.ts +4 -1
  773. package/src/tools/SegmentationIntersectionTool.ts +1 -1
  774. package/src/tools/annotation/LivewireContourSegmentationTool.ts +1 -1
  775. package/src/tools/annotation/LivewireContourTool.ts +65 -38
  776. package/src/tools/annotation/PlanarFreehandContourSegmentationTool.ts +1 -22
  777. package/src/tools/annotation/PlanarFreehandROITool.ts +8 -5
  778. package/src/tools/annotation/ProbeTool.ts +4 -0
  779. package/src/tools/annotation/SplineROITool.ts +76 -29
  780. package/src/tools/annotation/planarFreehandROITool/closedContourEditLoop.ts +20 -11
  781. package/src/tools/annotation/planarFreehandROITool/drawLoop.ts +42 -23
  782. package/src/tools/annotation/planarFreehandROITool/openContourEditLoop.ts +28 -13
  783. package/src/tools/annotation/planarFreehandROITool/openContourEndEditLoop.ts +1 -1
  784. package/src/tools/annotation/planarFreehandROITool/renderMethods.ts +28 -10
  785. package/src/tools/annotation/splines/LinearSpline.ts +1 -1
  786. package/src/tools/annotation/splines/Spline.ts +13 -1
  787. package/src/tools/base/AnnotationTool.ts +2 -1
  788. package/src/tools/base/BaseTool.ts +1 -6
  789. package/src/tools/base/ContourBaseTool.ts +46 -4
  790. package/src/tools/base/ContourSegmentationBaseTool.ts +51 -42
  791. package/src/tools/displayTools/Contour/contourConfig.ts +1 -0
  792. package/src/tools/displayTools/Contour/contourDisplay.ts +82 -9
  793. package/src/tools/displayTools/Contour/removeContourFromElement.ts +2 -0
  794. package/src/tools/displayTools/Contour/{addContourSetsToElement.ts → vtkContour/addContourSetsToElement.ts} +1 -1
  795. package/src/tools/displayTools/Contour/{addOrUpdateContourSets.ts → vtkContour/addOrUpdateVTKContourSets.ts} +4 -4
  796. package/src/tools/displayTools/Contour/{updateContourSets.ts → vtkContour/updateVTKContourSets.ts} +2 -2
  797. package/src/tools/displayTools/Contour/{utils.ts → vtkContour/utils.ts} +1 -1
  798. package/src/tools/displayTools/Labelmap/addLabelmapToElement.ts +1 -1
  799. package/src/tools/displayTools/Labelmap/index.ts +10 -1
  800. package/src/tools/displayTools/Labelmap/labelmapDisplay.ts +39 -4
  801. package/src/tools/displayTools/Labelmap/validateLabelmap.ts +71 -0
  802. package/src/tools/displayTools/Surface/addOrUpdateSurfaceToElement.ts +172 -0
  803. package/src/tools/displayTools/Surface/surfaceConfig.ts +12 -0
  804. package/src/tools/displayTools/Surface/surfaceDisplay.ts +275 -35
  805. package/src/tools/displayTools/registerDisplayToolsWorker.ts +34 -0
  806. package/src/tools/segmentation/BrushTool.ts +1 -1
  807. package/src/tools/segmentation/CircleScissorsTool.ts +3 -1
  808. package/src/tools/segmentation/PaintFillTool.ts +1 -1
  809. package/src/tools/segmentation/RectangleScissorsTool.ts +3 -1
  810. package/src/tools/segmentation/SegmentSelectTool.ts +70 -75
  811. package/src/tools/segmentation/SphereScissorsTool.ts +3 -1
  812. package/src/tools/segmentation/strategies/BrushStrategy.ts +12 -9
  813. package/src/tools/segmentation/strategies/compositions/regionFill.ts +1 -1
  814. package/src/tools/segmentation/strategies/fillSphere.ts +13 -5
  815. package/src/tools/segmentation/strategies/utils/getStrategyData.ts +30 -15
  816. package/src/tools/segmentation/strategies/utils/stackVolumeCheck.ts +24 -17
  817. package/src/types/AnnotationTypes.ts +14 -0
  818. package/src/types/ContourAnnotation.ts +13 -0
  819. package/src/types/ContourSegmentationAnnotation.ts +0 -1
  820. package/src/types/ContourTypes.ts +3 -0
  821. package/src/types/EventTypes.ts +9 -0
  822. package/src/types/ISpline.ts +3 -0
  823. package/src/types/LabelmapTypes.ts +7 -1
  824. package/src/types/PolySeg.ts +7 -0
  825. package/src/types/SegmentationStateTypes.ts +20 -4
  826. package/src/types/SplineProps.ts +10 -0
  827. package/src/types/SurfaceTypes.ts +1 -1
  828. package/src/types/index.ts +3 -0
  829. package/src/utilities/boundingBox/getBoundingBoxAroundShape.ts +4 -2
  830. package/src/utilities/contourSegmentation/addContourSegmentationAnnotation.ts +29 -0
  831. package/src/utilities/contourSegmentation/areSameSegment.ts +0 -2
  832. package/src/utilities/contourSegmentation/index.ts +2 -0
  833. package/src/utilities/contourSegmentation/removeContourSegmentationAnnotation.ts +30 -0
  834. package/src/utilities/contours/detectContourHoles.ts +2 -0
  835. package/src/utilities/contours/generateContourSetsFromLabelmap.ts +2 -2
  836. package/src/utilities/contours/getContourHolesDataCanvas.ts +33 -0
  837. package/src/utilities/contours/getContourHolesDataWorld.ts +19 -0
  838. package/src/utilities/contours/getDeduplicatedVTKPolyDataPoints.ts +66 -0
  839. package/src/utilities/contours/index.ts +8 -2
  840. package/src/utilities/contours/updateContourPolyline.ts +74 -0
  841. package/src/utilities/index.ts +4 -0
  842. package/src/utilities/math/polyline/containsPoint.ts +4 -2
  843. package/src/utilities/math/polyline/containsPoints.ts +22 -0
  844. package/src/utilities/math/polyline/getWindingDirection.ts +14 -0
  845. package/src/utilities/math/polyline/index.ts +6 -0
  846. package/src/utilities/math/polyline/isPointInsidePolyline3D.ts +56 -0
  847. package/src/utilities/math/polyline/planarFreehandROIInternalTypes.ts +1 -0
  848. package/src/utilities/segmentation/contourAndFindLargestBidirectional.ts +0 -1
  849. package/src/utilities/segmentation/getHoveredContourSegmentationAnnotation.ts +25 -0
  850. package/src/utilities/segmentation/getSegmentAtLabelmapBorder.ts +179 -0
  851. package/src/utilities/segmentation/getSegmentAtWorldPoint.ts +173 -0
  852. package/src/utilities/segmentation/getUniqueSegmentIndices.ts +76 -0
  853. package/src/utilities/segmentation/index.ts +8 -0
  854. package/src/utilities/triggerAnnotationRenderForToolGroupIds.ts +38 -0
  855. package/src/workers/clippingPlaneWorker.js +87 -0
  856. package/src/workers/polySegConverters.js +467 -0
  857. package/dist/cjs/tools/displayTools/Contour/addContourSetsToElement.js.map +0 -1
  858. package/dist/cjs/tools/displayTools/Contour/addOrUpdateContourSets.d.ts +0 -3
  859. package/dist/cjs/tools/displayTools/Contour/addOrUpdateContourSets.js +0 -14
  860. package/dist/cjs/tools/displayTools/Contour/addOrUpdateContourSets.js.map +0 -1
  861. package/dist/cjs/tools/displayTools/Contour/contourConfigCache.js.map +0 -1
  862. package/dist/cjs/tools/displayTools/Contour/updateContourSets.d.ts +0 -3
  863. package/dist/cjs/tools/displayTools/Contour/updateContourSets.js.map +0 -1
  864. package/dist/cjs/tools/displayTools/Contour/utils.js.map +0 -1
  865. package/dist/cjs/tools/displayTools/Labelmap/validateRepresentationData.d.ts +0 -3
  866. package/dist/cjs/tools/displayTools/Labelmap/validateRepresentationData.js +0 -20
  867. package/dist/cjs/tools/displayTools/Labelmap/validateRepresentationData.js.map +0 -1
  868. package/dist/cjs/tools/displayTools/Surface/addSurfaceToElement.d.ts +0 -2
  869. package/dist/cjs/tools/displayTools/Surface/addSurfaceToElement.js +0 -84
  870. package/dist/cjs/tools/displayTools/Surface/addSurfaceToElement.js.map +0 -1
  871. package/dist/cjs/utilities/contours/mergePoints.d.ts +0 -8
  872. package/dist/cjs/utilities/contours/mergePoints.js +0 -77
  873. package/dist/cjs/utilities/contours/mergePoints.js.map +0 -1
  874. package/dist/esm/tools/displayTools/Contour/addContourSetsToElement.js.map +0 -1
  875. package/dist/esm/tools/displayTools/Contour/addOrUpdateContourSets.js.map +0 -1
  876. package/dist/esm/tools/displayTools/Contour/contourConfigCache.js.map +0 -1
  877. package/dist/esm/tools/displayTools/Contour/updateContourSets.js.map +0 -1
  878. package/dist/esm/tools/displayTools/Contour/utils.js.map +0 -1
  879. package/dist/esm/tools/displayTools/Labelmap/validateRepresentationData.js +0 -18
  880. package/dist/esm/tools/displayTools/Labelmap/validateRepresentationData.js.map +0 -1
  881. package/dist/esm/tools/displayTools/Surface/addSurfaceToElement.js +0 -79
  882. package/dist/esm/tools/displayTools/Surface/addSurfaceToElement.js.map +0 -1
  883. package/dist/esm/utilities/contours/mergePoints.js +0 -73
  884. package/dist/esm/utilities/contours/mergePoints.js.map +0 -1
  885. package/dist/types/tools/displayTools/Contour/addContourSetsToElement.d.ts.map +0 -1
  886. package/dist/types/tools/displayTools/Contour/addOrUpdateContourSets.d.ts +0 -4
  887. package/dist/types/tools/displayTools/Contour/addOrUpdateContourSets.d.ts.map +0 -1
  888. package/dist/types/tools/displayTools/Contour/contourConfigCache.d.ts.map +0 -1
  889. package/dist/types/tools/displayTools/Contour/updateContourSets.d.ts +0 -4
  890. package/dist/types/tools/displayTools/Contour/updateContourSets.d.ts.map +0 -1
  891. package/dist/types/tools/displayTools/Contour/utils.d.ts.map +0 -1
  892. package/dist/types/tools/displayTools/Labelmap/validateRepresentationData.d.ts +0 -4
  893. package/dist/types/tools/displayTools/Labelmap/validateRepresentationData.d.ts.map +0 -1
  894. package/dist/types/tools/displayTools/Surface/addSurfaceToElement.d.ts +0 -3
  895. package/dist/types/tools/displayTools/Surface/addSurfaceToElement.d.ts.map +0 -1
  896. package/dist/types/utilities/contours/mergePoints.d.ts +0 -9
  897. package/dist/types/utilities/contours/mergePoints.d.ts.map +0 -1
  898. package/src/tools/displayTools/Labelmap/validateRepresentationData.ts +0 -36
  899. package/src/tools/displayTools/Surface/addSurfaceToElement.ts +0 -115
  900. package/src/utilities/contours/mergePoints.ts +0 -108
  901. /package/dist/cjs/tools/displayTools/Contour/{addContourSetsToElement.js → vtkContour/addContourSetsToElement.js} +0 -0
  902. /package/dist/cjs/tools/displayTools/Contour/{contourConfigCache.d.ts → vtkContour/contourConfigCache.d.ts} +0 -0
  903. /package/dist/cjs/tools/displayTools/Contour/{contourConfigCache.js → vtkContour/contourConfigCache.js} +0 -0
  904. /package/dist/cjs/tools/displayTools/Contour/{utils.js → vtkContour/utils.js} +0 -0
  905. /package/dist/esm/tools/displayTools/Contour/{addContourSetsToElement.js → vtkContour/addContourSetsToElement.js} +0 -0
  906. /package/dist/esm/tools/displayTools/Contour/{contourConfigCache.js → vtkContour/contourConfigCache.js} +0 -0
  907. /package/dist/esm/tools/displayTools/Contour/{utils.js → vtkContour/utils.js} +0 -0
  908. /package/dist/types/tools/displayTools/Contour/{contourConfigCache.d.ts → vtkContour/contourConfigCache.d.ts} +0 -0
  909. /package/src/tools/displayTools/Contour/{contourConfigCache.ts → vtkContour/contourConfigCache.ts} +0 -0
@@ -3,18 +3,22 @@ import { isVolumeSegmentation } from './stackVolumeCheck';
3
3
  const { VoxelManager } = utilities;
4
4
  function getStrategyData({ operationData, viewport }) {
5
5
  let segmentationImageData, segmentationScalarData, imageScalarData;
6
- let dimensions;
7
- if (isVolumeSegmentation(operationData)) {
6
+ let imageDimensions;
7
+ let segmentationDimensions;
8
+ if (isVolumeSegmentation(operationData, viewport)) {
8
9
  const { volumeId, referencedVolumeId } = operationData;
9
10
  const segmentationVolume = cache.getVolume(volumeId);
10
- const imageVolume = cache.getVolume(referencedVolumeId);
11
- if (!segmentationVolume || !imageVolume) {
11
+ if (!segmentationVolume) {
12
12
  return;
13
13
  }
14
+ if (referencedVolumeId) {
15
+ const imageVolume = cache.getVolume(referencedVolumeId);
16
+ imageScalarData = imageVolume.getScalarData();
17
+ imageDimensions = imageVolume.dimensions;
18
+ }
14
19
  ({ imageData: segmentationImageData } = segmentationVolume);
15
20
  segmentationScalarData = segmentationVolume.getScalarData();
16
- imageScalarData = imageVolume.getScalarData();
17
- dimensions = imageVolume.dimensions;
21
+ segmentationDimensions = segmentationVolume.dimensions;
18
22
  }
19
23
  else {
20
24
  const { imageIdReferenceMap, segmentationRepresentationUID } = operationData;
@@ -32,14 +36,22 @@ function getStrategyData({ operationData, viewport }) {
32
36
  segmentationScalarData = segmentationImage.getPixelData();
33
37
  const image = cache.getImage(currentImageId);
34
38
  imageScalarData = image.getPixelData();
35
- dimensions = [image.columns, image.rows, 1];
39
+ imageDimensions = [image.columns, image.rows, 1];
40
+ segmentationDimensions = [
41
+ segmentationImage.columns,
42
+ segmentationImage.rows,
43
+ 1,
44
+ ];
36
45
  }
46
+ const segmentationVoxelManager = VoxelManager.createVolumeVoxelManager(segmentationDimensions, segmentationScalarData);
47
+ const imageVoxelManager = imageDimensions &&
48
+ VoxelManager.createVolumeVoxelManager(imageDimensions, imageScalarData);
37
49
  return {
38
50
  segmentationImageData,
39
51
  segmentationScalarData,
40
- segmentationVoxelManager: VoxelManager.createVolumeVoxelManager(dimensions, segmentationScalarData),
52
+ segmentationVoxelManager,
41
53
  imageScalarData,
42
- imageVoxelManager: VoxelManager.createVolumeVoxelManager(dimensions, imageScalarData),
54
+ imageVoxelManager,
43
55
  };
44
56
  }
45
57
  export { getStrategyData };
@@ -1 +1 @@
1
- {"version":3,"file":"getStrategyData.js","sourceRoot":"","sources":["../../../../../../src/tools/segmentation/strategies/utils/getStrategyData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA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GAAG,CAAC,cAAc,CAAC,CAAC;QAE3E,MAAM,iBAAiB,GAAG,KAAK,CAAC,QAAQ,CAAC,0BAA0B,CAAC,CAAC;QACrE,sBAAsB,GAAG,iBAAiB,CAAC,YAAY,EAAE,CAAC;QAE1D,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAK7C,eAAe,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;QACvC,UAAU,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;KAC7C;IAED,OAAO;QACL,qBAAqB;QACrB,sBAAsB;QACtB,wBAAwB,EAAE,YAAY,CAAC,wBAAwB,CAC7D,UAAU,EACV,sBAAsB,CACvB;QACD,eAAe;QACf,iBAAiB,EAAE,YAAY,CAAC,wBAAwB,CACtD,UAAU,EACV,eAAe,CAChB;KACF,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"getStrategyData.js","sourceRoot":"","sources":["../../../../../../src/tools/segmentation/strategies/utils/getStrategyData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG1D,MAAM,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC;AAEnC,SAAS,eAAe,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE;IAClD,IAAI,qBAAqB,EAAE,sBAAsB,EAAE,eAAe,CAAC;IACnE,IAAI,eAA6B,CAAC;IAClC,IAAI,sBAAoC,CAAC;IACzC,IAAI,oBAAoB,CAAC,aAAa,EAAE,QAAQ,CAAC,EAAE;QACjD,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,GAAG,aAAa,CAAC;QAEvD,MAAM,kBAAkB,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,CAA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;YACvB,iBAAiB,CAAC,OAAO;YACzB,iBAAiB,CAAC,IAAI;YACtB,CAAC;SACF,CAAC;KACH;IAED,MAAM,wBAAwB,GAAG,YAAY,CAAC,wBAAwB,CACpE,sBAAsB,EACtB,sBAAsB,CACvB,CAAC;IAEF,MAAM,iBAAiB,GACrB,eAAe;QACf,YAAY,CAAC,wBAAwB,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;IAE1E,OAAO;QACL,qBAAqB;QACrB,sBAAsB;QACtB,wBAAwB;QACxB,eAAe;QACf,iBAAiB;KAClB,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,9 +1,17 @@
1
- function isStackSegmentation(operationData) {
2
- return (operationData.imageIdReferenceMap !==
3
- undefined);
1
+ import { VolumeViewport } from '@cornerstonejs/core';
2
+ function isVolumeSegmentation(operationData, viewport) {
3
+ const { imageIdReferenceMap } = operationData;
4
+ const { volumeId } = operationData;
5
+ if (volumeId && !imageIdReferenceMap) {
6
+ return true;
7
+ }
8
+ if (imageIdReferenceMap && !volumeId) {
9
+ return false;
10
+ }
11
+ if (volumeId && imageIdReferenceMap && !viewport) {
12
+ throw new Error('isVolumeSegmentation: viewport is required when both volumeId and imageIdReferenceMap are provided');
13
+ }
14
+ return viewport instanceof VolumeViewport;
4
15
  }
5
- function isVolumeSegmentation(operationData) {
6
- return (operationData?.volumeId !== undefined);
7
- }
8
- export { isStackSegmentation, isVolumeSegmentation };
16
+ export { isVolumeSegmentation };
9
17
  //# sourceMappingURL=stackVolumeCheck.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stackVolumeCheck.js","sourceRoot":"","sources":["../../../../../../src/tools/segmentation/strategies/utils/stackVolumeCheck.ts"],"names":[],"mappings":"AAWA,SAAS,mBAAmB,CAC1B,aAAmE;IAInE,OAAO,CACJ,aAAgD,CAAC,mBAAmB;QACrE,SAAS,CACV,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAC3B,aAAmE;IAInE,OAAO,CACJ,aAAiD,EAAE,QAAQ,KAAK,SAAS,CAC3E,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"stackVolumeCheck.js","sourceRoot":"","sources":["../../../../../../src/tools/segmentation/strategies/utils/stackVolumeCheck.ts"],"names":[],"mappings":"AASA,OAAO,EAAS,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE5D,SAAS,oBAAoB,CAC3B,aAAmE,EACnE,QAA0B;IAI1B,MAAM,EAAE,mBAAmB,EAAE,GAC3B,aAA+C,CAAC;IAClD,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAgD,CAAC;IAEtE,IAAI,QAAQ,IAAI,CAAC,mBAAmB,EAAE;QACpC,OAAO,IAAI,CAAC;KACb;IAED,IAAI,mBAAmB,IAAI,CAAC,QAAQ,EAAE;QACpC,OAAO,KAAK,CAAC;KACd;IAED,IAAI,QAAQ,IAAI,mBAAmB,IAAI,CAAC,QAAQ,EAAE;QAChD,MAAM,IAAI,KAAK,CACb,oGAAoG,CACrG,CAAC;KACH;IAGD,OAAO,QAAQ,YAAY,cAAc,CAAC;AAC5C,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -1,2 +1,7 @@
1
- export {};
1
+ export var ContourWindingDirection;
2
+ (function (ContourWindingDirection) {
3
+ ContourWindingDirection[ContourWindingDirection["CounterClockwise"] = -1] = "CounterClockwise";
4
+ ContourWindingDirection[ContourWindingDirection["Unknown"] = 0] = "Unknown";
5
+ ContourWindingDirection[ContourWindingDirection["Clockwise"] = 1] = "Clockwise";
6
+ })(ContourWindingDirection || (ContourWindingDirection = {}));
2
7
  //# sourceMappingURL=ContourAnnotation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContourAnnotation.js","sourceRoot":"","sources":["../../../src/types/ContourAnnotation.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"ContourAnnotation.js","sourceRoot":"","sources":["../../../src/types/ContourAnnotation.ts"],"names":[],"mappings":"AASA,MAAM,CAAN,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,8FAAqB,CAAA;IACrB,2EAAW,CAAA;IACX,+EAAa,CAAA;AACf,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,QAIlC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PolySeg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PolySeg.js","sourceRoot":"","sources":["../../../src/types/PolySeg.ts"],"names":[],"mappings":""}
@@ -8,7 +8,8 @@ function calculateBoundingBox(points, dimensions, isWorld = false) {
8
8
  let zMin = Infinity;
9
9
  let zMax = isWorld ? -Infinity : 0;
10
10
  const is3D = points[0]?.length === 3;
11
- points.forEach((p) => {
11
+ for (let i = 0; i < points.length; i++) {
12
+ const p = points[i];
12
13
  xMin = Math.min(p[0], xMin);
13
14
  xMax = Math.max(p[0], xMax);
14
15
  yMin = Math.min(p[1], yMin);
@@ -17,7 +18,7 @@ function calculateBoundingBox(points, dimensions, isWorld = false) {
17
18
  zMin = Math.min(p[2] ?? zMin, zMin);
18
19
  zMax = Math.max(p[2] ?? zMax, zMax);
19
20
  }
20
- });
21
+ }
21
22
  if (dimensions) {
22
23
  xMin = Math.max(isWorld ? dimensions[0] + EPSILON : 0, xMin);
23
24
  xMax = Math.min(isWorld ? dimensions[0] - EPSILON : dimensions[0] - 1, xMax);
@@ -1 +1 @@
1
- {"version":3,"file":"getBoundingBoxAroundShape.js","sourceRoot":"","sources":["../../../../src/utilities/boundingBox/getBoundingBoxAroundShape.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;AAO9B,SAAS,oBAAoB,CAC3B,MAAM,EACN,UAAU,EACV,OAAO,GAAG,KAAK;IAEf,IAAI,IAAI,GAAG,QAAQ,CAAC;IACpB,IAAI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,QAAQ,EAAE,IAAI,CAAC,CAAC;QAEhC,IAAI,IAAI,EAAE;YACR,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;YACzB,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;SACjC;KACF;IAED,OAAO,IAAI;QACT,CAAC,CAAC;YACE,CAAC,IAAI,EAAE,IAAI,CAAC;YACZ,CAAC,IAAI,EAAE,IAAI,CAAC;YACZ,CAAC,IAAI,EAAE,IAAI,CAAC;SACb;QACH,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC;AAWD,MAAM,UAAU,4BAA4B,CAC1C,MAAuC,EACvC,UAAwC;IAExC,OAAO,oBAAoB,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;AACzD,CAAC;AAWD,MAAM,UAAU,8BAA8B,CAC5C,MAAuC,EACvC,UAAwC;IAExC,OAAO,oBAAoB,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC"}
1
+ {"version":3,"file":"getBoundingBoxAroundShape.js","sourceRoot":"","sources":["../../../../src/utilities/boundingBox/getBoundingBoxAroundShape.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;AAO9B,SAAS,oBAAoB,CAC3B,MAAM,EACN,UAAU,EACV,OAAO,GAAG,KAAK;IAEf,IAAI,IAAI,GAAG,QAAQ,CAAC;IACpB,IAAI,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,IAAI,GAAG,QAAQ,CAAC;IACpB,IAAI,IAAI,GAAG,OAAO,CAAC,C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AI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;YACzB,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;SACjC;KACF;IAED,OAAO,IAAI;QACT,CAAC,CAAC;YACE,CAAC,IAAI,EAAE,IAAI,CAAC;YACZ,CAAC,IAAI,EAAE,IAAI,CAAC;YACZ,CAAC,IAAI,EAAE,IAAI,CAAC;SACb;QACH,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC;AAWD,MAAM,UAAU,4BAA4B,CAC1C,MAAuC,EACvC,UAAwC;IAExC,OAAO,oBAAoB,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;AACzD,CAAC;AAWD,MAAM,UAAU,8BAA8B,CAC5C,MAAuC,EACvC,UAAwC;IAExC,OAAO,oBAAoB,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { getSegmentation } from '../../stateManagement/segmentation/segmentationState';
2
+ export function addContourSegmentationAnnotation(annotation) {
3
+ if (!annotation.data.segmentation) {
4
+ throw new Error('addContourSegmentationAnnotation: annotation does not have a segmentation data');
5
+ }
6
+ const { segmentationId, segmentIndex } = annotation.data.segmentation;
7
+ const segmentation = getSegmentation(segmentationId);
8
+ const { annotationUIDsMap } = segmentation.representationData.CONTOUR;
9
+ let annotationsUIDsSet = annotationUIDsMap.get(segmentIndex);
10
+ if (!annotationsUIDsSet) {
11
+ annotationsUIDsSet = new Set();
12
+ annotationUIDsMap.set(segmentIndex, annotationsUIDsSet);
13
+ }
14
+ annotationsUIDsSet.add(annotation.annotationUID);
15
+ }
16
+ //# sourceMappingURL=addContourSegmentationAnnotation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addContourSegmentationAnnotation.js","sourceRoot":"","sources":["../../../../src/utilities/contourSegmentation/addContourSegmentationAnnotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sDAAsD,CAAC;AAOvF,MAAM,UAAU,gCAAgC,CAC9C,UAAyC;IAEzC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE;QACjC,MAAM,IAAI,KAAK,CACb,gFAAgF,CACjF,CAAC;KACH;IAED,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC;IACtE,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IACrD,MAAM,EAAE,iBAAiB,EAAE,GAAG,YAAY,CAAC,kBAAkB,CAAC,OAAO,CAAC;IAEtE,IAAI,kBAAkB,GAAG,iBAAiB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAE7D,IAAI,CAAC,kBAAkB,EAAE;QACvB,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,iBAAiB,CAAC,GAAG,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC;KACzD;IAED,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACnD,CAAC"}
@@ -2,8 +2,6 @@ export default function areSameSegment(firstAnnotation, secondAnnotation) {
2
2
  const { segmentation: firstSegmentation } = firstAnnotation.data;
3
3
  const { segmentation: secondSegmentation } = secondAnnotation.data;
4
4
  return (firstSegmentation.segmentationId === secondSegmentation.segmentationId &&
5
- firstSegmentation.segmentationRepresentationUID ===
6
- secondSegmentation.segmentationRepresentationUID &&
7
5
  firstSegmentation.segmentIndex === secondSegmentation.segmentIndex);
8
6
  }
9
7
  //# sourceMappingURL=areSameSegment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"areSameSegment.js","sourceRoot":"","sources":["../../../../src/utilities/contourSegmentation/areSameSegment.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,eAA8C,EAC9C,gBAA+C;IAE/C,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,GAAG,eAAe,CAAC,IAAI,CAAC;IACjE,MAAM,EAAE,YAAY,EAAE,kBAAkB,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC;IAEnE,OAAO,CACL,iBAAiB,CAAC,cAAc,KAAK,kBAAkB,CAAC,cAAc;QACtE,iBAAiB,CAAC,6BAA6B;YAC7C,kBAAkB,CAAC,6BAA6B;QAClD,iBAAiB,CAAC,YAAY,KAAK,kBAAkB,CAAC,YAAY,CACnE,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"areSameSegment.js","sourceRoot":"","sources":["../../../../src/utilities/contourSegmentation/areSameSegment.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,eAA8C,EAC9C,gBAA+C;IAE/C,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,GAAG,eAAe,CAAC,IAAI,CAAC;IACjE,MAAM,EAAE,YAAY,EAAE,kBAAkB,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC;IAEnE,OAAO,CACL,iBAAiB,CAAC,cAAc,KAAK,kBAAkB,CAAC,cAAc;QACtE,iBAAiB,CAAC,YAAY,KAAK,kBAAkB,CAAC,YAAY,CACnE,CAAC;AACJ,CAAC"}
@@ -1,3 +1,5 @@
1
1
  export { default as areSameSegment } from './areSameSegment';
2
2
  export { default as isContourSegmentationAnnotation } from './isContourSegmentationAnnotation';
3
+ export { addContourSegmentationAnnotation } from './addContourSegmentationAnnotation';
4
+ export { removeContourSegmentationAnnotation } from './removeContourSegmentationAnnotation';
3
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/contourSegmentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,+BAA+B,EAAE,MAAM,mCAAmC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/contourSegmentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAC/F,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { state } from '../../stateManagement/segmentation';
2
+ export function removeContourSegmentationAnnotation(annotation) {
3
+ if (!annotation.data.segmentation) {
4
+ throw new Error('removeContourSegmentationAnnotation: annotation does not have a segmentation data');
5
+ }
6
+ const { segmentationId, segmentIndex } = annotation.data.segmentation;
7
+ const segmentation = state.getSegmentation(segmentationId);
8
+ const { annotationUIDsMap } = segmentation.representationData.CONTOUR;
9
+ const annotationsUIDsSet = annotationUIDsMap.get(segmentIndex);
10
+ annotationsUIDsSet.delete(annotation.annotationUID);
11
+ if (!annotationsUIDsSet.size) {
12
+ annotationUIDsMap.delete(segmentIndex);
13
+ }
14
+ }
15
+ //# sourceMappingURL=removeContourSegmentationAnnotation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeContourSegmentationAnnotation.js","sourceRoot":"","sources":["../../../../src/utilities/contourSegmentation/removeContourSegmentationAnnotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAS3D,MAAM,UAAU,mCAAmC,CACjD,UAAyC;IAEzC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE;QACjC,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;KACH;IAED,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,IAAI,C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,CAAC,CAAC,YAAY,EAAE,EAAE;YAC3C,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;KACJ;SAAM;KAEN;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,eAAe,EAAE,mBAAmB,EAAE,CAAC"}
@@ -2,7 +2,7 @@ import { cache as cornerstoneCache } from '@cornerstonejs/core';
2
2
  import vtkImageMarchingSquares from '@kitware/vtk.js/Filters/General/ImageMarchingSquares';
3
3
  import vtkDataArray from '@kitware/vtk.js/Common/Core/DataArray';
4
4
  import vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData';
5
- import { removeDuplicatePoints } from './mergePoints';
5
+ import { getDeduplicatedVTKPolyDataPoints } from '../contours';
6
6
  import { findContoursFromReducedSet } from './contourFinder';
7
7
  import SegmentationRepresentations from '../../enums/SegmentationRepresentations';
8
8
  const { Labelmap } = SegmentationRepresentations;
@@ -71,7 +71,7 @@ function generateContourSetsFromLabelmap({ segmentations }) {
71
71
  mSquares.setContourValues(cValues);
72
72
  mSquares.setMergePoints(false);
73
73
  const msOutput = mSquares.getOutputData();
74
- const reducedSet = removeDuplicatePoints(msOutput);
74
+ const reducedSet = getDeduplicatedVTKPolyDataPoints(msOutput);
75
75
  if (reducedSet.points?.length) {
76
76
  const contours = findContoursFromReducedSet(reducedSet.lines);
77
77
  sliceContours.push({
@@ -1 +1 @@
1
- {"version":3,"file":"generateContourSetsFromLabelmap.js","sourceRoot":"","sources":["../../../../src/utilities/contours/generateContourSetsFromLabelmap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,uBAAuB,MAAM,sDAAsD,CAAC;AAC3F,OAAO,YAAY,MAAM,uCAAuC,CAAC;AACjE,OAAO,YAAY,MAAM,4CAA4C,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;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AAC;iBACJ;aACF;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACjB;SACF;QAED,MAAM,QAAQ,GAAG;YACf,iBAAiB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;YACvC,mBAAmB;SACpB,CAAC;QAEF,MAAM,UAAU,GAAG;YACjB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,QAAQ;YACR,aAAa;SACd,CAAC;QAEF,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KAC9B;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,SAAS,sBAAsB,CAAC,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ;IAC3E,MAAM,QAAQ,GAAG,UAAU,GAAG,cAAc,CAAC;IAC7C,MAAM,MAAM,GAAG,QAAQ,GAAG,cAAc,CAAC;IAEzC,KAAK,IAAI,CAAC,GAAG,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;YAC3B,OAAO,KAAK,CAAC;SACd;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
1
+ {"version":3,"file":"generateContourSetsFromLabelmap.js","sourceRoot":"","sources":["../../../../src/utilities/contours/generateContourSetsFromLabelmap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,uBAAuB,MAAM,sDAAsD,CAAC;AAC3F,OAAO,YAAY,MAAM,uCAAuC,CAAC;AACjE,OAAO,YAAY,MAAM,4CAA4C,CAAC;AAEtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa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B,CAAC,CAAC;iBACJ;aACF;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACjB;SACF;QAED,MAAM,QAAQ,GAAG;YACf,iBAAiB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;YACvC,mBAAmB;SACpB,CAAC;QAEF,MAAM,UAAU,GAAG;YACjB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,QAAQ;YACR,aAAa;SACd,CAAC;QAEF,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KAC9B;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,SAAS,sBAAsB,CAAC,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ;IAC3E,MAAM,QAAQ,GAAG,UAAU,GAAG,cAAc,CAAC;IAC7C,MAAM,MAAM,GAAG,QAAQ,GAAG,cAAc,CAAC;IAEzC,KAAK,IAAI,CAAC,GAAG,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;YAC3B,OAAO,KAAK,CAAC;SACd;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import getContourHolesDataWorld from './getContourHolesDataWorld';
2
+ export default function getContourHolesDataCanvas(annotation, viewport) {
3
+ const worldHoleContours = getContourHolesDataWorld(annotation);
4
+ const canvasHoleContours = [];
5
+ worldHoleContours.forEach((worldHoleContour) => {
6
+ const numPoints = worldHoleContour.length;
7
+ const canvasHoleContour = new Array(numPoints);
8
+ for (let i = 0; i < numPoints; i++) {
9
+ canvasHoleContour[i] = viewport.worldToCanvas(worldHoleContour[i]);
10
+ }
11
+ canvasHoleContours.push(canvasHoleContour);
12
+ });
13
+ return canvasHoleContours;
14
+ }
15
+ //# sourceMappingURL=getContourHolesDataCanvas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getContourHolesDataCanvas.js","sourceRoot":"","sources":["../../../../src/utilities/contours/getContourHolesDataCanvas.ts"],"names":[],"mappings":"AAEA,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAQlE,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAC/C,UAAsB,EACtB,QAAyB;IAEzB,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,UAAU,CAAC,CAAC;IAC/D,MAAM,kBAAkB,GAAG,EAAE,CAAC;IAE9B,iBAAiB,CAAC,OAAO,CAAC,CAAC,gBAAgB,EAAE,EAAE;QAC7C,MAAM,SAAS,GAAG,gBAAgB,CAAC,MAAM,CAAC;QAG1C,MAAM,iBAAiB,GAAmB,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;QAG/D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;YAClC,iBAAiB,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;SACpE;QAED,kBAAkB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,OAAO,kBAAkB,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { getAnnotation } from '../../stateManagement';
2
+ export default function getContourHolesDataWorld(annotation) {
3
+ const childAnnotationUIDs = annotation.childAnnotationUIDs ?? [];
4
+ return childAnnotationUIDs.map((uid) => getAnnotation(uid).data.contour.polyline);
5
+ }
6
+ //# sourceMappingURL=getContourHolesDataWorld.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getContourHolesDataWorld.js","sourceRoot":"","sources":["../../../../src/utilities/contours/getContourHolesDataWorld.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAQtD,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAC9C,UAAsB;IAEtB,MAAM,mBAAmB,GAAG,UAAU,CAAC,mBAAmB,IAAI,EAAE,CAAC;IAEjE,OAAO,mBAAmB,CAAC,GAAG,CAC5B,CAAC,GAAG,EAAE,EAAE,CAAE,aAAa,CAAC,GAAG,CAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CACzE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,46 @@
1
+ export function getDeduplicatedVTKPolyDataPoints(polyData, bypass = false) {
2
+ const points = polyData.getPoints();
3
+ const lines = polyData.getLines();
4
+ const pointsArray = new Array(points.getNumberOfPoints())
5
+ .fill(0)
6
+ .map((_, i) => points.getPoint(i).slice());
7
+ const linesArray = new Array(lines.getNumberOfCells()).fill(0).map((_, i) => {
8
+ const cell = lines.getCell(i * 3).slice();
9
+ return { a: cell[0], b: cell[1] };
10
+ });
11
+ if (bypass) {
12
+ return { points: pointsArray, lines: linesArray };
13
+ }
14
+ const newPoints = [];
15
+ for (const [i, pt] of pointsArray.entries()) {
16
+ const index = newPoints.findIndex((point) => point[0] === pt[0] && point[1] === pt[1] && point[2] === pt[2]);
17
+ if (index >= 0) {
18
+ linesArray.map((line) => {
19
+ if (line.a === i) {
20
+ line.a = index;
21
+ }
22
+ if (line.b === i) {
23
+ line.b = index;
24
+ }
25
+ return line;
26
+ });
27
+ }
28
+ else {
29
+ const newIndex = newPoints.length;
30
+ newPoints.push(pt);
31
+ linesArray.map((line) => {
32
+ if (line.a === i) {
33
+ line.a = newIndex;
34
+ }
35
+ if (line.b === i) {
36
+ line.b = newIndex;
37
+ }
38
+ return line;
39
+ });
40
+ }
41
+ }
42
+ const newLines = linesArray.filter((line) => line.a !== line.b);
43
+ return { points: newPoints, lines: newLines };
44
+ }
45
+ export default { getDeduplicatedVTKPolyDataPoints };
46
+ //# sourceMappingURL=getDeduplicatedVTKPolyDataPoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDeduplicatedVTKPolyDataPoints.js","sourceRoot":"","sources":["../../../../src/utilities/contours/getDeduplicatedVTKPolyDataPoints.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,gCAAgC,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK;IACvE,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;IACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAIlC,MAAM,WAAW,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;SACtD,IAAI,CAAC,CAAC,CAAC;SACP,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;IAE7C,MAAM,UAAU,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC1E,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QAC1C,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,IAAI,MAAM,EAAE;QACV,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;KACnD;IAED,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,KAAK,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE;QAI3C,MAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAC/B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
@@ -1,11 +1,14 @@
1
1
  import areCoplanarContours from './areCoplanarContours';
2
2
  import contourFinder from './contourFinder';
3
- import mergePoints from './mergePoints';
3
+ import { getDeduplicatedVTKPolyDataPoints } from './getDeduplicatedVTKPolyDataPoints';
4
4
  import detectContourHoles from './detectContourHoles';
5
5
  import { generateContourSetsFromLabelmap } from './generateContourSetsFromLabelmap';
6
6
  import AnnotationToPointData from './AnnotationToPointData';
7
+ import getContourHolesDataWorld from './getContourHolesDataWorld';
8
+ import getContourHolesDataCanvas from './getContourHolesDataCanvas';
9
+ import updateContourPolyline from './updateContourPolyline';
7
10
  import acceptAutogeneratedInterpolations from './interpolation/acceptAutogeneratedInterpolations';
8
11
  import * as interpolation from './interpolation';
9
12
  import findHandlePolylineIndex from './findHandlePolylineIndex';
10
- export { areCoplanarContours, contourFinder, mergePoints, detectContourHoles, generateContourSetsFromLabelmap, AnnotationToPointData, interpolation, acceptAutogeneratedInterpolations, findHandlePolylineIndex, };
13
+ export { areCoplanarContours, contourFinder, getDeduplicatedVTKPolyDataPoints, detectContourHoles, generateContourSetsFromLabelmap, AnnotationToPointData, getContourHolesDataWorld, getContourHolesDataCanvas, updateContourPolyline, interpolation, acceptAutogeneratedInterpolations, findHandlePolylineIndex, };
11
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/contours/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,iCAAiC,MAAM,mDAAmD,CAAC;AAClG,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,+BAA+B,EAC/B,qBAAqB,EACrB,aAAa,EACb,iCAAiC,EACjC,uBAAuB,GACxB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/contours/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,iCAAiC,MAAM,mDAAmD,CAAC;AAClG,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,gCAAgC,EAChC,kBAAkB,EAClB,+BAA+B,EAC/B,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,aAAa,EACb,iCAAiC,EACjC,uBAAuB,GACxB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { utilities as csUtils } from '@cornerstonejs/core';
2
+ import * as math from '../math';
3
+ import { getParentAnnotation, invalidateAnnotation, } from '../../stateManagement';
4
+ export default function updateContourPolyline(annotation, polylineData, transforms) {
5
+ const { canvasToWorld } = transforms;
6
+ const { data } = annotation;
7
+ const { points: polyline, targetWindingDirection } = polylineData;
8
+ let { closed } = polylineData;
9
+ const numPoints = polyline.length;
10
+ const polylineWorldPoints = new Array(numPoints);
11
+ const currentWindingDirection = math.polyline.getWindingDirection(polyline);
12
+ const parentAnnotation = getParentAnnotation(annotation);
13
+ if (closed === undefined) {
14
+ let currentClosedState = false;
15
+ if (polyline.length > 3) {
16
+ const lastToFirstDist = math.point.distanceToPointSquared(polyline[0], polyline[numPoints - 1]);
17
+ currentClosedState = csUtils.isEqual(0, lastToFirstDist);
18
+ }
19
+ closed = currentClosedState;
20
+ }
21
+ let windingDirection = parentAnnotation
22
+ ? parentAnnotation.data.contour.windingDirection * -1
23
+ : targetWindingDirection;
24
+ if (windingDirection === undefined) {
25
+ windingDirection = currentWindingDirection;
26
+ }
27
+ else if (windingDirection !== currentWindingDirection) {
28
+ polyline.reverse();
29
+ }
30
+ for (let i = 0; i < numPoints; i++) {
31
+ polylineWorldPoints[i] = canvasToWorld(polyline[i]);
32
+ }
33
+ data.contour.polyline = polylineWorldPoints;
34
+ data.contour.closed = closed;
35
+ data.contour.windingDirection = windingDirection;
36
+ invalidateAnnotation(annotation);
37
+ }
38
+ //# sourceMappingURL=updateContourPolyline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateContourPolyline.js","sourceRoot":"","sources":["../../../../src/utilities/contours/updateContourPolyline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAI3D,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAChC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAS/B,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAC3C,UAA6B,EAC7B,YAIC,EACD,UAEC;IAED,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC;IACrC,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC;IAC5B,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,sBAAsB,EAAE,GAAG,YAAY,CAAC;IAClE,IAAI,EA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IAC5C,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;IAC7B,IAAI,CAAC,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAEjD,oBAAoB,CAAC,UAAU,CAAC,CAAC;AACnC,CAAC"}
@@ -7,6 +7,7 @@ import clip from './clip';
7
7
  import calibrateImageSpacing from './calibrateImageSpacing';
8
8
  import { getCalibratedLengthUnits, getCalibratedAreaUnits, getCalibratedScale, } from './getCalibratedUnits';
9
9
  import triggerAnnotationRenderForViewportIds from './triggerAnnotationRenderForViewportIds';
10
+ import triggerAnnotationRenderForToolGroupIds from './triggerAnnotationRenderForToolGroupIds';
10
11
  import triggerAnnotationRender from './triggerAnnotationRender';
11
12
  import jumpToSlice from './viewport/jumpToSlice';
12
13
  import pointInShapeCallback from './pointInShapeCallback';
@@ -33,7 +34,8 @@ import * as touch from './touch';
33
34
  import * as dynamicVolume from './dynamicVolume';
34
35
  import * as polyDataUtils from './polyData/utils';
35
36
  import * as voi from './voi';
37
+ import * as contourSegmentation from './contourSegmentation';
36
38
  const roundNumber = utilities.roundNumber;
37
39
  import { triggerEvent } from '@cornerstonejs/core';
38
- export { math, planar, viewportFilters, drawing, debounce, dynamicVolume, throttle, orientation, isObject, touch, triggerEvent, calibrateImageSpacing, getCalibratedLengthUnits, getCalibratedAreaUnits, getCalibratedScale, segmentation, contours, triggerAnnotationRenderForViewportIds, triggerAnnotationRender, pointInShapeCallback, getSphereBoundsInfo, getAnnotationNearPoint, getViewportForAnnotation, getAnnotationNearPointOnEnabledElement, jumpToSlice, pointInSurroundingSphereCallback, viewport, cine, clip, boundingBox, rectangleROITool, planarFreehandROITool, stackPrefetch, stackContextPrefetch, scroll, roundNumber, pointToString, polyDataUtils, voi, annotationFrameRange, };
40
+ export { math, planar, viewportFilters, drawing, debounce, dynamicVolume, throttle, orientation, isObject, touch, triggerEvent, calibrateImageSpacing, getCalibratedLengthUnits, getCalibratedAreaUnits, getCalibratedScale, 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, };
39
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EACL,sBAAsB,EACtB,sCAAsC,GACvC,MAAM,0BAA0B,CAAC;AAGlC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,qCAAqC,MAAM,yCAAyC,CAAC;AAC5F,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,WAAW,MAAM,wBAAwB,CAAC;AAEjD,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,gCAAgC,MAAM,oCAAoC,CAAC;AAClF,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAGlE,OAAO,KAAK,Q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AAC,CAAC;QAC5C,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAE5C,MAAM,uBAAuB,GAC3B,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QAE1D,IAAI,uBAAuB,EAAE;YAC3B,MAAM,cAAc,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;YACvC,IAAI,UAAU,GAAG,cAAc,CAAC;YAEhC,IAAI,CAAC,UAAU,EAAE;gBACf,MAAM,aAAa,GACjB,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;gBAEnE,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC;aACxC;YAED,gBAAgB,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACxC;KACF;IAED,OAAO,CAAC,CAAC,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import containsPoint from './containsPoint';
2
+ export default function containsPoints(polyline, points) {
3
+ for (let i = 0, numPoint = points.length; i < numPoint; i++) {
4
+ if (!containsPoint(polyline, points[i])) {
5
+ return false;
6
+ }
7
+ }
8
+ return true;
9
+ }
10
+ //# sourceMappingURL=containsPoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"containsPoints.js","sourceRoot":"","sources":["../../../../../src/utilities/math/polyline/containsPoints.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAS5C,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,QAAwB,EACxB,MAAsB;IAEtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE;QAC3D,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;YACvC,OAAO,KAAK,CAAC;SACd;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,6 @@
1
+ import getSignedArea from './getSignedArea';
2
+ export default function getWindingDirection(polyline) {
3
+ const signedArea = getSignedArea(polyline);
4
+ return signedArea >= 0 ? 1 : -1;
5
+ }
6
+ //# sourceMappingURL=getWindingDirection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getWindingDirection.js","sourceRoot":"","sources":["../../../../../src/utilities/math/polyline/getWindingDirection.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAO5C,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,QAAwB;IAClE,MAAM,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IAG3C,OAAO,UAAU,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC"}
@@ -1,8 +1,10 @@
1
1
  import isClosed from './isClosed';
2
2
  import containsPoint from './containsPoint';
3
+ import containsPoints from './containsPoints';
3
4
  import getAABB from './getAABB';
4
5
  import getArea from './getArea';
5
6
  import getSignedArea from './getSignedArea';
7
+ import getWindingDirection from './getWindingDirection';
6
8
  import getNormal3 from './getNormal3';
7
9
  import getNormal2 from './getNormal2';
8
10
  import { mergePolylines, subtractPolylines } from './combinePolyline';
@@ -15,5 +17,6 @@ import getSubPixelSpacingAndXYDirections from './getSubPixelSpacingAndXYDirectio
15
17
  import pointsAreWithinCloseContourProximity from './pointsAreWithinCloseContourProximity';
16
18
  import addCanvasPointsToArray from './addCanvasPointsToArray';
17
19
  import pointCanProjectOnLine from './pointCanProjectOnLine';
18
- export { isClosed, containsPoint, getAABB, getArea, getSignedArea, getNormal3, getNormal2, intersectPolyline, getFirstLineSegmentIntersectionIndexes, getLineSegmentIntersectionsIndexes, getLineSegmentIntersectionsCoordinates, getClosestLineSegmentIntersection, getSubPixelSpacingAndXYDirections, pointsAreWithinCloseContourProximity, addCanvasPointsToArray, pointCanProjectOnLine, mergePolylines, subtractPolylines, };
20
+ import { isPointInsidePolyline3D } from './isPointInsidePolyline3D';
21
+ export { isClosed, containsPoint, containsPoints, getAABB, getArea, getSignedArea, getWindingDirection, getNormal3, getNormal2, intersectPolyline, getFirstLineSegmentIntersectionIndexes, getLineSegmentIntersectionsIndexes, getLineSegmentIntersectionsCoordinates, getClosestLineSegmentIntersection, getSubPixelSpacingAndXYDirections, pointsAreWithinCloseContourProximity, addCanvasPointsToArray, pointCanProjectOnLine, mergePolylines, subtractPolylines, isPointInsidePolyline3D, };
19
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/utilities/math/polyline/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,sCAAsC,MAAM,0CAA0C,CAAC;AAC9F,OAAO,kCAAkC,MAAM,sCAAsC,CAAC;AACtF,OAAO,sCAAsC,MAAM,0CAA0C,CAAC;AAC9F,OAAO,iCAAiC,MAAM,qCAAqC,CAAC;AACpF,OAAO,iCAAiC,MAAM,qCAAqC,CAAC;AACpF,OAAO,oCAAoC,MAAM,wCAAwC,CAAC;AAC1F,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EACL,QAAQ,EACR,aAAa,EACb,OAAO,EACP,OAAO,EACP,aAAa,EACb,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,sCAAsC,EACtC,kCAAkC,EAClC,sCAAsC,EACtC,iCAAiC,EACjC,iCAAiC,EACjC,oCAAoC,EACpC,sBAAsB,EACtB,qBAAqB,EACrB,cAAc,EACd,iBAAiB,GAClB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/utilities/math/polyline/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,sCAAsC,MAAM,0CAA0C,CAAC;AAC9F,OAAO,kCAAkC,MAAM,sCAAsC,CAAC;AACtF,OAAO,sCAAsC,MAAM,0CAA0C,CAAC;AAC9F,OAAO,iCAAiC,MAAM,qCAAqC,CAAC;AACpF,OAAO,iCAAiC,MAAM,qCAAqC,CAAC;AACpF,OAAO,oCAAoC,MAAM,wCAAwC,CAAC;AAC1F,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EACL,QAAQ,EACR,aAAa,EACb,cAAc,EACd,OAAO,EACP,OAAO,EACP,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,sCAAsC,EACtC,kCAAkC,EAClC,sCAAsC,EACtC,iCAAiC,EACjC,iCAAiC,EACjC,oCAAoC,EACpC,sBAAsB,EACtB,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,uBAAuB,GACxB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import containsPoint from './containsPoint';
2
+ export function isPointInsidePolyline3D(point, polyline) {
3
+ let sharedDimensionIndex;
4
+ const testPoints = polyline.slice(0, 3);
5
+ for (let i = 0; i < 3; i++) {
6
+ if (testPoints.every((point, index, array) => point[i] === array[0][i])) {
7
+ sharedDimensionIndex = i;
8
+ break;
9
+ }
10
+ }
11
+ if (sharedDimensionIndex === undefined) {
12
+ throw new Error('Cannot find a shared dimension index for polyline, probably oblique plane');
13
+ }
14
+ const points2D = [];
15
+ for (let i = 0; i < polyline.length; i++) {
16
+ points2D.push([
17
+ polyline[i][(sharedDimensionIndex + 1) % 3],
18
+ polyline[i][(sharedDimensionIndex + 2) % 3],
19
+ ]);
20
+ }
21
+ const point2D = [
22
+ point[(sharedDimensionIndex + 1) % 3],
23
+ point[(sharedDimensionIndex + 2) % 3],
24
+ ];
25
+ return containsPoint(points2D, point2D);
26
+ }
27
+ //# sourceMappingURL=isPointInsidePolyline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