@cornerstonejs/tools 1.53.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 (713) hide show
  1. package/dist/cjs/enums/WorkerTypes.d.ts +8 -0
  2. package/dist/cjs/enums/WorkerTypes.js +12 -0
  3. package/dist/cjs/enums/WorkerTypes.js.map +1 -0
  4. package/dist/cjs/enums/index.d.ts +2 -1
  5. package/dist/cjs/enums/index.js +3 -1
  6. package/dist/cjs/enums/index.js.map +1 -1
  7. package/dist/cjs/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js +6 -11
  8. package/dist/cjs/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js.map +1 -1
  9. package/dist/cjs/eventListeners/segmentation/imageChangeEventListener.js +4 -3
  10. package/dist/cjs/eventListeners/segmentation/imageChangeEventListener.js.map +1 -1
  11. package/dist/cjs/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js +58 -47
  12. package/dist/cjs/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js.map +1 -1
  13. package/dist/cjs/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.d.ts +1 -0
  14. package/dist/cjs/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.js +5 -0
  15. package/dist/cjs/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.js.map +1 -1
  16. package/dist/cjs/stateManagement/annotation/annotationState.d.ts +2 -1
  17. package/dist/cjs/stateManagement/annotation/annotationState.js +6 -1
  18. package/dist/cjs/stateManagement/annotation/annotationState.js.map +1 -1
  19. package/dist/cjs/stateManagement/segmentation/SegmentationStateManager.js +4 -1
  20. package/dist/cjs/stateManagement/segmentation/SegmentationStateManager.js.map +1 -1
  21. package/dist/cjs/stateManagement/segmentation/addRepresentationData.d.ts +12 -0
  22. package/dist/cjs/stateManagement/segmentation/addRepresentationData.js +35 -0
  23. package/dist/cjs/stateManagement/segmentation/addRepresentationData.js.map +1 -0
  24. package/dist/cjs/stateManagement/segmentation/addSegmentationRepresentation.js +32 -14
  25. package/dist/cjs/stateManagement/segmentation/addSegmentationRepresentation.js.map +1 -1
  26. package/dist/cjs/stateManagement/segmentation/config/segmentationVisibility.js +3 -52
  27. package/dist/cjs/stateManagement/segmentation/config/segmentationVisibility.js.map +1 -1
  28. package/dist/cjs/stateManagement/segmentation/convertStackToVolumeSegmentation.d.ts +9 -2
  29. package/dist/cjs/stateManagement/segmentation/convertStackToVolumeSegmentation.js +44 -27
  30. package/dist/cjs/stateManagement/segmentation/convertStackToVolumeSegmentation.js.map +1 -1
  31. package/dist/cjs/stateManagement/segmentation/convertVolumeToStackSegmentation.d.ts +13 -0
  32. package/dist/cjs/stateManagement/segmentation/convertVolumeToStackSegmentation.js +52 -26
  33. package/dist/cjs/stateManagement/segmentation/convertVolumeToStackSegmentation.js.map +1 -1
  34. package/dist/cjs/stateManagement/segmentation/helpers/validateSegmentationInput.js +6 -9
  35. package/dist/cjs/stateManagement/segmentation/helpers/validateSegmentationInput.js.map +1 -1
  36. package/dist/cjs/stateManagement/segmentation/index.d.ts +3 -1
  37. package/dist/cjs/stateManagement/segmentation/index.js +5 -1
  38. package/dist/cjs/stateManagement/segmentation/index.js.map +1 -1
  39. package/dist/cjs/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts +2 -0
  40. package/dist/cjs/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js +8 -0
  41. package/dist/cjs/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js.map +1 -0
  42. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.d.ts +2 -0
  43. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.js +11 -0
  44. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.js.map +1 -0
  45. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.d.ts +7 -0
  46. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js +162 -0
  47. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js.map +1 -0
  48. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.d.ts +6 -0
  49. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js +71 -0
  50. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js.map +1 -0
  51. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.d.ts +6 -0
  52. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js +120 -0
  53. package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js.map +1 -0
  54. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.d.ts +4 -0
  55. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.js +12 -0
  56. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.js.map +1 -0
  57. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.d.ts +3 -0
  58. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js +52 -0
  59. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js.map +1 -0
  60. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.d.ts +3 -0
  61. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js +60 -0
  62. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js.map +1 -0
  63. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.d.ts +5 -0
  64. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js +56 -0
  65. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js.map +1 -0
  66. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.d.ts +12 -0
  67. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.js +94 -0
  68. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.js.map +1 -0
  69. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.d.ts +1 -0
  70. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js +74 -0
  71. package/dist/cjs/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js.map +1 -0
  72. package/dist/cjs/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.d.ts +2 -0
  73. package/dist/cjs/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js +83 -0
  74. package/dist/cjs/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js.map +1 -0
  75. package/dist/cjs/stateManagement/segmentation/polySeg/computeAndAddRepresentation.d.ts +3 -0
  76. package/dist/cjs/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js +64 -0
  77. package/dist/cjs/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js.map +1 -0
  78. package/dist/cjs/stateManagement/segmentation/polySeg/index.d.ts +5 -0
  79. package/dist/cjs/stateManagement/segmentation/polySeg/index.js +12 -0
  80. package/dist/cjs/stateManagement/segmentation/polySeg/index.js.map +1 -0
  81. package/dist/cjs/stateManagement/segmentation/polySeg/registerPolySegWorker.d.ts +1 -0
  82. package/dist/cjs/stateManagement/segmentation/polySeg/registerPolySegWorker.js +27 -0
  83. package/dist/cjs/stateManagement/segmentation/polySeg/registerPolySegWorker.js.map +1 -0
  84. package/dist/cjs/stateManagement/segmentation/segmentIndex.js +4 -0
  85. package/dist/cjs/stateManagement/segmentation/segmentIndex.js.map +1 -1
  86. package/dist/cjs/stateManagement/segmentation/segmentationState.d.ts +6 -1
  87. package/dist/cjs/stateManagement/segmentation/segmentationState.js +30 -1
  88. package/dist/cjs/stateManagement/segmentation/segmentationState.js.map +1 -1
  89. package/dist/cjs/tools/ScaleOverlayTool.js +2 -1
  90. package/dist/cjs/tools/ScaleOverlayTool.js.map +1 -1
  91. package/dist/cjs/tools/annotation/PlanarFreehandContourSegmentationTool.d.ts +1 -2
  92. package/dist/cjs/tools/annotation/PlanarFreehandContourSegmentationTool.js +0 -11
  93. package/dist/cjs/tools/annotation/PlanarFreehandContourSegmentationTool.js.map +1 -1
  94. package/dist/cjs/tools/annotation/PlanarFreehandROITool.js +1 -2
  95. package/dist/cjs/tools/annotation/PlanarFreehandROITool.js.map +1 -1
  96. package/dist/cjs/tools/annotation/ProbeTool.js +3 -0
  97. package/dist/cjs/tools/annotation/ProbeTool.js.map +1 -1
  98. package/dist/cjs/tools/annotation/planarFreehandROITool/drawLoop.js +1 -1
  99. package/dist/cjs/tools/annotation/planarFreehandROITool/drawLoop.js.map +1 -1
  100. package/dist/cjs/tools/annotation/planarFreehandROITool/openContourEndEditLoop.js +1 -1
  101. package/dist/cjs/tools/annotation/planarFreehandROITool/openContourEndEditLoop.js.map +1 -1
  102. package/dist/cjs/tools/base/AnnotationTool.js +1 -1
  103. package/dist/cjs/tools/base/AnnotationTool.js.map +1 -1
  104. package/dist/cjs/tools/base/BaseTool.js.map +1 -1
  105. package/dist/cjs/tools/base/ContourSegmentationBaseTool.d.ts +1 -2
  106. package/dist/cjs/tools/base/ContourSegmentationBaseTool.js +24 -24
  107. package/dist/cjs/tools/base/ContourSegmentationBaseTool.js.map +1 -1
  108. package/dist/cjs/tools/displayTools/Contour/contourDisplay.js +9 -6
  109. package/dist/cjs/tools/displayTools/Contour/contourDisplay.js.map +1 -1
  110. package/dist/cjs/tools/displayTools/Contour/removeContourFromElement.js.map +1 -1
  111. package/dist/cjs/tools/displayTools/Contour/{addContourSetsToElement.d.ts → vtkContour/addContourSetsToElement.d.ts} +1 -1
  112. package/dist/cjs/tools/displayTools/Contour/vtkContour/addContourSetsToElement.js.map +1 -0
  113. package/dist/cjs/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.d.ts +3 -0
  114. package/dist/cjs/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.js +14 -0
  115. package/dist/cjs/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.js.map +1 -0
  116. package/dist/cjs/tools/displayTools/Contour/vtkContour/contourConfigCache.js.map +1 -0
  117. package/dist/cjs/tools/displayTools/Contour/vtkContour/updateVTKContourSets.d.ts +3 -0
  118. package/dist/cjs/tools/displayTools/Contour/{updateContourSets.js → vtkContour/updateVTKContourSets.js} +4 -4
  119. package/dist/cjs/tools/displayTools/Contour/vtkContour/updateVTKContourSets.js.map +1 -0
  120. package/dist/cjs/tools/displayTools/Contour/{utils.d.ts → vtkContour/utils.d.ts} +2 -2
  121. package/dist/cjs/tools/displayTools/Contour/vtkContour/utils.js.map +1 -0
  122. package/dist/cjs/tools/displayTools/Labelmap/addLabelmapToElement.js +1 -1
  123. package/dist/cjs/tools/displayTools/Labelmap/addLabelmapToElement.js.map +1 -1
  124. package/dist/cjs/tools/displayTools/Labelmap/index.d.ts +2 -1
  125. package/dist/cjs/tools/displayTools/Labelmap/index.js +4 -1
  126. package/dist/cjs/tools/displayTools/Labelmap/index.js.map +1 -1
  127. package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js +20 -2
  128. package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
  129. package/dist/cjs/tools/displayTools/Labelmap/validateLabelmap.d.ts +4 -0
  130. package/dist/cjs/tools/displayTools/Labelmap/validateLabelmap.js +38 -0
  131. package/dist/cjs/tools/displayTools/Labelmap/validateLabelmap.js.map +1 -0
  132. package/dist/cjs/tools/displayTools/Surface/addOrUpdateSurfaceToElement.d.ts +3 -0
  133. package/dist/cjs/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js +112 -0
  134. package/dist/cjs/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js.map +1 -0
  135. package/dist/cjs/tools/displayTools/Surface/surfaceConfig.d.ts +3 -0
  136. package/dist/cjs/tools/displayTools/Surface/surfaceConfig.js +11 -0
  137. package/dist/cjs/tools/displayTools/Surface/surfaceConfig.js.map +1 -0
  138. package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.d.ts +7 -0
  139. package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.js +173 -27
  140. package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.js.map +1 -1
  141. package/dist/cjs/tools/displayTools/registerDisplayToolsWorker.d.ts +1 -0
  142. package/dist/cjs/tools/displayTools/registerDisplayToolsWorker.js +27 -0
  143. package/dist/cjs/tools/displayTools/registerDisplayToolsWorker.js.map +1 -0
  144. package/dist/cjs/tools/segmentation/BrushTool.js +1 -1
  145. package/dist/cjs/tools/segmentation/BrushTool.js.map +1 -1
  146. package/dist/cjs/tools/segmentation/CircleScissorsTool.js +1 -1
  147. package/dist/cjs/tools/segmentation/CircleScissorsTool.js.map +1 -1
  148. package/dist/cjs/tools/segmentation/PaintFillTool.js +1 -1
  149. package/dist/cjs/tools/segmentation/PaintFillTool.js.map +1 -1
  150. package/dist/cjs/tools/segmentation/RectangleScissorsTool.js +1 -1
  151. package/dist/cjs/tools/segmentation/RectangleScissorsTool.js.map +1 -1
  152. package/dist/cjs/tools/segmentation/SegmentSelectTool.d.ts +6 -2
  153. package/dist/cjs/tools/segmentation/SegmentSelectTool.js +45 -35
  154. package/dist/cjs/tools/segmentation/SegmentSelectTool.js.map +1 -1
  155. package/dist/cjs/tools/segmentation/SphereScissorsTool.js +1 -1
  156. package/dist/cjs/tools/segmentation/SphereScissorsTool.js.map +1 -1
  157. package/dist/cjs/tools/segmentation/strategies/BrushStrategy.js +7 -5
  158. package/dist/cjs/tools/segmentation/strategies/BrushStrategy.js.map +1 -1
  159. package/dist/cjs/tools/segmentation/strategies/compositions/regionFill.js +1 -1
  160. package/dist/cjs/tools/segmentation/strategies/compositions/regionFill.js.map +1 -1
  161. package/dist/cjs/tools/segmentation/strategies/fillSphere.js +14 -5
  162. package/dist/cjs/tools/segmentation/strategies/fillSphere.js.map +1 -1
  163. package/dist/cjs/tools/segmentation/strategies/utils/getStrategyData.js +21 -9
  164. package/dist/cjs/tools/segmentation/strategies/utils/getStrategyData.js.map +1 -1
  165. package/dist/cjs/tools/segmentation/strategies/utils/stackVolumeCheck.d.ts +5 -5
  166. package/dist/cjs/tools/segmentation/strategies/utils/stackVolumeCheck.js +15 -8
  167. package/dist/cjs/tools/segmentation/strategies/utils/stackVolumeCheck.js.map +1 -1
  168. package/dist/cjs/types/ContourSegmentationAnnotation.d.ts +0 -1
  169. package/dist/cjs/types/LabelmapTypes.d.ts +5 -1
  170. package/dist/cjs/types/PolySeg.d.ts +6 -0
  171. package/dist/cjs/types/PolySeg.js +3 -0
  172. package/dist/cjs/types/PolySeg.js.map +1 -0
  173. package/dist/cjs/types/SegmentationStateTypes.d.ts +12 -2
  174. package/dist/cjs/types/SurfaceTypes.d.ts +1 -1
  175. package/dist/cjs/types/index.d.ts +2 -1
  176. package/dist/cjs/utilities/boundingBox/getBoundingBoxAroundShape.js +6 -6
  177. package/dist/cjs/utilities/boundingBox/getBoundingBoxAroundShape.js.map +1 -1
  178. package/dist/cjs/utilities/contourSegmentation/addContourSegmentationAnnotation.d.ts +2 -0
  179. package/dist/cjs/utilities/contourSegmentation/addContourSegmentationAnnotation.js +20 -0
  180. package/dist/cjs/utilities/contourSegmentation/addContourSegmentationAnnotation.js.map +1 -0
  181. package/dist/cjs/utilities/contourSegmentation/areSameSegment.js +0 -2
  182. package/dist/cjs/utilities/contourSegmentation/areSameSegment.js.map +1 -1
  183. package/dist/cjs/utilities/contourSegmentation/index.d.ts +2 -0
  184. package/dist/cjs/utilities/contourSegmentation/index.js +5 -1
  185. package/dist/cjs/utilities/contourSegmentation/index.js.map +1 -1
  186. package/dist/cjs/utilities/contourSegmentation/removeContourSegmentationAnnotation.d.ts +2 -0
  187. package/dist/cjs/utilities/contourSegmentation/removeContourSegmentationAnnotation.js +19 -0
  188. package/dist/cjs/utilities/contourSegmentation/removeContourSegmentationAnnotation.js.map +1 -0
  189. package/dist/cjs/utilities/contours/detectContourHoles.js.map +1 -1
  190. package/dist/cjs/utilities/contours/generateContourSetsFromLabelmap.js +2 -2
  191. package/dist/cjs/utilities/contours/generateContourSetsFromLabelmap.js.map +1 -1
  192. package/dist/cjs/utilities/contours/getDeduplicatedVTKPolyDataPoints.d.ts +11 -0
  193. package/dist/cjs/utilities/contours/getDeduplicatedVTKPolyDataPoints.js +50 -0
  194. package/dist/cjs/utilities/contours/getDeduplicatedVTKPolyDataPoints.js.map +1 -0
  195. package/dist/cjs/utilities/contours/index.d.ts +2 -2
  196. package/dist/cjs/utilities/contours/index.js +3 -3
  197. package/dist/cjs/utilities/contours/index.js.map +1 -1
  198. package/dist/cjs/utilities/index.d.ts +3 -1
  199. package/dist/cjs/utilities/index.js +5 -1
  200. package/dist/cjs/utilities/index.js.map +1 -1
  201. package/dist/cjs/utilities/math/polyline/containsPoint.js.map +1 -1
  202. package/dist/cjs/utilities/math/polyline/index.d.ts +2 -1
  203. package/dist/cjs/utilities/math/polyline/index.js +3 -1
  204. package/dist/cjs/utilities/math/polyline/index.js.map +1 -1
  205. package/dist/cjs/utilities/math/polyline/isPointInsidePolyline3D.d.ts +2 -0
  206. package/dist/cjs/utilities/math/polyline/isPointInsidePolyline3D.js +34 -0
  207. package/dist/cjs/utilities/math/polyline/isPointInsidePolyline3D.js.map +1 -0
  208. package/dist/cjs/utilities/segmentation/contourAndFindLargestBidirectional.js +0 -1
  209. package/dist/cjs/utilities/segmentation/contourAndFindLargestBidirectional.js.map +1 -1
  210. package/dist/cjs/utilities/segmentation/getHoveredContourSegmentationAnnotation.d.ts +1 -0
  211. package/dist/cjs/utilities/segmentation/getHoveredContourSegmentationAnnotation.js +18 -0
  212. package/dist/cjs/utilities/segmentation/getHoveredContourSegmentationAnnotation.js.map +1 -0
  213. package/dist/cjs/utilities/segmentation/getSegmentAtLabelmapBorder.d.ts +7 -0
  214. package/dist/cjs/utilities/segmentation/getSegmentAtLabelmapBorder.js +77 -0
  215. package/dist/cjs/utilities/segmentation/getSegmentAtLabelmapBorder.js.map +1 -0
  216. package/dist/cjs/utilities/segmentation/getSegmentAtWorldPoint.d.ts +11 -0
  217. package/dist/cjs/utilities/segmentation/getSegmentAtWorldPoint.js +82 -0
  218. package/dist/cjs/utilities/segmentation/getSegmentAtWorldPoint.js.map +1 -0
  219. package/dist/cjs/utilities/segmentation/getUniqueSegmentIndices.d.ts +2 -0
  220. package/dist/cjs/utilities/segmentation/getUniqueSegmentIndices.js +59 -0
  221. package/dist/cjs/utilities/segmentation/getUniqueSegmentIndices.js.map +1 -0
  222. package/dist/cjs/utilities/segmentation/index.d.ts +5 -1
  223. package/dist/cjs/utilities/segmentation/index.js +9 -1
  224. package/dist/cjs/utilities/segmentation/index.js.map +1 -1
  225. package/dist/cjs/utilities/triggerAnnotationRenderForToolGroupIds.d.ts +2 -0
  226. package/dist/cjs/utilities/triggerAnnotationRenderForToolGroupIds.js +32 -0
  227. package/dist/cjs/utilities/triggerAnnotationRenderForToolGroupIds.js.map +1 -0
  228. package/dist/cjs/workers/clippingPlaneWorker.d.ts +1 -0
  229. package/dist/cjs/workers/clippingPlaneWorker.js +63 -0
  230. package/dist/cjs/workers/clippingPlaneWorker.js.map +1 -0
  231. package/dist/cjs/workers/polySegConverters.d.ts +1 -0
  232. package/dist/cjs/workers/polySegConverters.js +267 -0
  233. package/dist/cjs/workers/polySegConverters.js.map +1 -0
  234. package/dist/esm/enums/WorkerTypes.js +10 -0
  235. package/dist/esm/enums/WorkerTypes.js.map +1 -0
  236. package/dist/esm/enums/index.js +2 -1
  237. package/dist/esm/enums/index.js.map +1 -1
  238. package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js +7 -12
  239. package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js.map +1 -1
  240. package/dist/esm/eventListeners/segmentation/imageChangeEventListener.js +3 -3
  241. package/dist/esm/eventListeners/segmentation/imageChangeEventListener.js.map +1 -1
  242. package/dist/esm/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js +59 -45
  243. package/dist/esm/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js.map +1 -1
  244. package/dist/esm/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.js +5 -0
  245. package/dist/esm/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.js.map +1 -1
  246. package/dist/esm/stateManagement/annotation/annotationState.js +5 -1
  247. package/dist/esm/stateManagement/annotation/annotationState.js.map +1 -1
  248. package/dist/esm/stateManagement/segmentation/SegmentationStateManager.js +4 -1
  249. package/dist/esm/stateManagement/segmentation/SegmentationStateManager.js.map +1 -1
  250. package/dist/esm/stateManagement/segmentation/addRepresentationData.js +30 -0
  251. package/dist/esm/stateManagement/segmentation/addRepresentationData.js.map +1 -0
  252. package/dist/esm/stateManagement/segmentation/addSegmentationRepresentation.js +32 -15
  253. package/dist/esm/stateManagement/segmentation/addSegmentationRepresentation.js.map +1 -1
  254. package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js +1 -46
  255. package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js.map +1 -1
  256. package/dist/esm/stateManagement/segmentation/convertStackToVolumeSegmentation.js +42 -27
  257. package/dist/esm/stateManagement/segmentation/convertStackToVolumeSegmentation.js.map +1 -1
  258. package/dist/esm/stateManagement/segmentation/convertVolumeToStackSegmentation.js +49 -25
  259. package/dist/esm/stateManagement/segmentation/convertVolumeToStackSegmentation.js.map +1 -1
  260. package/dist/esm/stateManagement/segmentation/helpers/validateSegmentationInput.js +6 -6
  261. package/dist/esm/stateManagement/segmentation/helpers/validateSegmentationInput.js.map +1 -1
  262. package/dist/esm/stateManagement/segmentation/index.js +3 -1
  263. package/dist/esm/stateManagement/segmentation/index.js.map +1 -1
  264. package/dist/esm/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js +4 -0
  265. package/dist/esm/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js.map +1 -0
  266. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.js +7 -0
  267. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.js.map +1 -0
  268. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js +142 -0
  269. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js.map +1 -0
  270. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js +53 -0
  271. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js.map +1 -0
  272. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js +108 -0
  273. package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js.map +1 -0
  274. package/dist/esm/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.js +8 -0
  275. package/dist/esm/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.js.map +1 -0
  276. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js +37 -0
  277. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js.map +1 -0
  278. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js +45 -0
  279. package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js.map +1 -0
  280. package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js +41 -0
  281. package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js.map +1 -0
  282. package/dist/esm/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.js +78 -0
  283. package/dist/esm/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.js.map +1 -0
  284. package/dist/esm/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js +59 -0
  285. package/dist/esm/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js.map +1 -0
  286. package/dist/esm/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js +68 -0
  287. package/dist/esm/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js.map +1 -0
  288. package/dist/esm/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js +47 -0
  289. package/dist/esm/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js.map +1 -0
  290. package/dist/esm/stateManagement/segmentation/polySeg/index.js +6 -0
  291. package/dist/esm/stateManagement/segmentation/polySeg/index.js.map +1 -0
  292. package/dist/esm/stateManagement/segmentation/polySeg/registerPolySegWorker.js +23 -0
  293. package/dist/esm/stateManagement/segmentation/polySeg/registerPolySegWorker.js.map +1 -0
  294. package/dist/esm/stateManagement/segmentation/segmentIndex.js +4 -0
  295. package/dist/esm/stateManagement/segmentation/segmentIndex.js.map +1 -1
  296. package/dist/esm/stateManagement/segmentation/segmentationState.js +28 -1
  297. package/dist/esm/stateManagement/segmentation/segmentationState.js.map +1 -1
  298. package/dist/esm/tools/ScaleOverlayTool.js +2 -1
  299. package/dist/esm/tools/ScaleOverlayTool.js.map +1 -1
  300. package/dist/esm/tools/annotation/PlanarFreehandContourSegmentationTool.js +0 -11
  301. package/dist/esm/tools/annotation/PlanarFreehandContourSegmentationTool.js.map +1 -1
  302. package/dist/esm/tools/annotation/PlanarFreehandROITool.js +1 -2
  303. package/dist/esm/tools/annotation/PlanarFreehandROITool.js.map +1 -1
  304. package/dist/esm/tools/annotation/ProbeTool.js +3 -0
  305. package/dist/esm/tools/annotation/ProbeTool.js.map +1 -1
  306. package/dist/esm/tools/annotation/planarFreehandROITool/drawLoop.js +1 -1
  307. package/dist/esm/tools/annotation/planarFreehandROITool/drawLoop.js.map +1 -1
  308. package/dist/esm/tools/annotation/planarFreehandROITool/openContourEndEditLoop.js +1 -1
  309. package/dist/esm/tools/annotation/planarFreehandROITool/openContourEndEditLoop.js.map +1 -1
  310. package/dist/esm/tools/base/AnnotationTool.js +1 -1
  311. package/dist/esm/tools/base/AnnotationTool.js.map +1 -1
  312. package/dist/esm/tools/base/BaseTool.js +1 -1
  313. package/dist/esm/tools/base/BaseTool.js.map +1 -1
  314. package/dist/esm/tools/base/ContourSegmentationBaseTool.js +24 -24
  315. package/dist/esm/tools/base/ContourSegmentationBaseTool.js.map +1 -1
  316. package/dist/esm/tools/displayTools/Contour/contourDisplay.js +10 -7
  317. package/dist/esm/tools/displayTools/Contour/contourDisplay.js.map +1 -1
  318. package/dist/esm/tools/displayTools/Contour/removeContourFromElement.js.map +1 -1
  319. package/dist/esm/tools/displayTools/Contour/vtkContour/addContourSetsToElement.js.map +1 -0
  320. package/dist/esm/tools/displayTools/Contour/{addOrUpdateContourSets.js → vtkContour/addOrUpdateVTKContourSets.js} +4 -4
  321. package/dist/esm/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.js.map +1 -0
  322. package/dist/esm/tools/displayTools/Contour/vtkContour/contourConfigCache.js.map +1 -0
  323. package/dist/esm/tools/displayTools/Contour/{updateContourSets.js → vtkContour/updateVTKContourSets.js} +2 -2
  324. package/dist/esm/tools/displayTools/Contour/vtkContour/updateVTKContourSets.js.map +1 -0
  325. package/dist/esm/tools/displayTools/Contour/vtkContour/utils.js.map +1 -0
  326. package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.js +1 -1
  327. package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.js.map +1 -1
  328. package/dist/esm/tools/displayTools/Labelmap/index.js +2 -1
  329. package/dist/esm/tools/displayTools/Labelmap/index.js.map +1 -1
  330. package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js +20 -2
  331. package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
  332. package/dist/esm/tools/displayTools/Labelmap/validateLabelmap.js +33 -0
  333. package/dist/esm/tools/displayTools/Labelmap/validateLabelmap.js.map +1 -0
  334. package/dist/esm/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js +106 -0
  335. package/dist/esm/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js.map +1 -0
  336. package/dist/esm/tools/displayTools/Surface/surfaceConfig.js +9 -0
  337. package/dist/esm/tools/displayTools/Surface/surfaceConfig.js.map +1 -0
  338. package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js +162 -28
  339. package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js.map +1 -1
  340. package/dist/esm/tools/displayTools/registerDisplayToolsWorker.js +23 -0
  341. package/dist/esm/tools/displayTools/registerDisplayToolsWorker.js.map +1 -0
  342. package/dist/esm/tools/segmentation/BrushTool.js +1 -1
  343. package/dist/esm/tools/segmentation/BrushTool.js.map +1 -1
  344. package/dist/esm/tools/segmentation/CircleScissorsTool.js +1 -1
  345. package/dist/esm/tools/segmentation/CircleScissorsTool.js.map +1 -1
  346. package/dist/esm/tools/segmentation/PaintFillTool.js +1 -1
  347. package/dist/esm/tools/segmentation/PaintFillTool.js.map +1 -1
  348. package/dist/esm/tools/segmentation/RectangleScissorsTool.js +1 -1
  349. package/dist/esm/tools/segmentation/RectangleScissorsTool.js.map +1 -1
  350. package/dist/esm/tools/segmentation/SegmentSelectTool.js +47 -37
  351. package/dist/esm/tools/segmentation/SegmentSelectTool.js.map +1 -1
  352. package/dist/esm/tools/segmentation/SphereScissorsTool.js +1 -1
  353. package/dist/esm/tools/segmentation/SphereScissorsTool.js.map +1 -1
  354. package/dist/esm/tools/segmentation/strategies/BrushStrategy.js +7 -5
  355. package/dist/esm/tools/segmentation/strategies/BrushStrategy.js.map +1 -1
  356. package/dist/esm/tools/segmentation/strategies/compositions/regionFill.js +1 -1
  357. package/dist/esm/tools/segmentation/strategies/compositions/regionFill.js.map +1 -1
  358. package/dist/esm/tools/segmentation/strategies/fillSphere.js +14 -5
  359. package/dist/esm/tools/segmentation/strategies/fillSphere.js.map +1 -1
  360. package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.js +21 -9
  361. package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.js.map +1 -1
  362. package/dist/esm/tools/segmentation/strategies/utils/stackVolumeCheck.js +15 -7
  363. package/dist/esm/tools/segmentation/strategies/utils/stackVolumeCheck.js.map +1 -1
  364. package/dist/esm/types/PolySeg.js +2 -0
  365. package/dist/esm/types/PolySeg.js.map +1 -0
  366. package/dist/esm/utilities/boundingBox/getBoundingBoxAroundShape.js +3 -2
  367. package/dist/esm/utilities/boundingBox/getBoundingBoxAroundShape.js.map +1 -1
  368. package/dist/esm/utilities/contourSegmentation/addContourSegmentationAnnotation.js +16 -0
  369. package/dist/esm/utilities/contourSegmentation/addContourSegmentationAnnotation.js.map +1 -0
  370. package/dist/esm/utilities/contourSegmentation/areSameSegment.js +0 -2
  371. package/dist/esm/utilities/contourSegmentation/areSameSegment.js.map +1 -1
  372. package/dist/esm/utilities/contourSegmentation/index.js +2 -0
  373. package/dist/esm/utilities/contourSegmentation/index.js.map +1 -1
  374. package/dist/esm/utilities/contourSegmentation/removeContourSegmentationAnnotation.js +15 -0
  375. package/dist/esm/utilities/contourSegmentation/removeContourSegmentationAnnotation.js.map +1 -0
  376. package/dist/esm/utilities/contours/detectContourHoles.js.map +1 -1
  377. package/dist/esm/utilities/contours/generateContourSetsFromLabelmap.js +2 -2
  378. package/dist/esm/utilities/contours/generateContourSetsFromLabelmap.js.map +1 -1
  379. package/dist/esm/utilities/contours/getDeduplicatedVTKPolyDataPoints.js +46 -0
  380. package/dist/esm/utilities/contours/getDeduplicatedVTKPolyDataPoints.js.map +1 -0
  381. package/dist/esm/utilities/contours/index.js +2 -2
  382. package/dist/esm/utilities/contours/index.js.map +1 -1
  383. package/dist/esm/utilities/index.js +3 -1
  384. package/dist/esm/utilities/index.js.map +1 -1
  385. package/dist/esm/utilities/math/polyline/containsPoint.js.map +1 -1
  386. package/dist/esm/utilities/math/polyline/index.js +2 -1
  387. package/dist/esm/utilities/math/polyline/index.js.map +1 -1
  388. package/dist/esm/utilities/math/polyline/isPointInsidePolyline3D.js +27 -0
  389. package/dist/esm/utilities/math/polyline/isPointInsidePolyline3D.js.map +1 -0
  390. package/dist/esm/utilities/segmentation/contourAndFindLargestBidirectional.js +0 -1
  391. package/dist/esm/utilities/segmentation/contourAndFindLargestBidirectional.js.map +1 -1
  392. package/dist/esm/utilities/segmentation/getHoveredContourSegmentationAnnotation.js +14 -0
  393. package/dist/esm/utilities/segmentation/getHoveredContourSegmentationAnnotation.js.map +1 -0
  394. package/dist/esm/utilities/segmentation/getSegmentAtLabelmapBorder.js +73 -0
  395. package/dist/esm/utilities/segmentation/getSegmentAtLabelmapBorder.js.map +1 -0
  396. package/dist/esm/utilities/segmentation/getSegmentAtWorldPoint.js +75 -0
  397. package/dist/esm/utilities/segmentation/getSegmentAtWorldPoint.js.map +1 -0
  398. package/dist/esm/utilities/segmentation/getUniqueSegmentIndices.js +55 -0
  399. package/dist/esm/utilities/segmentation/getUniqueSegmentIndices.js.map +1 -0
  400. package/dist/esm/utilities/segmentation/index.js +5 -1
  401. package/dist/esm/utilities/segmentation/index.js.map +1 -1
  402. package/dist/esm/utilities/triggerAnnotationRenderForToolGroupIds.js +25 -0
  403. package/dist/esm/utilities/triggerAnnotationRenderForToolGroupIds.js.map +1 -0
  404. package/dist/esm/workers/clippingPlaneWorker.js +58 -0
  405. package/dist/esm/workers/clippingPlaneWorker.js.map +1 -0
  406. package/dist/esm/workers/polySegConverters.js +241 -0
  407. package/dist/esm/workers/polySegConverters.js.map +1 -0
  408. package/dist/types/enums/WorkerTypes.d.ts +9 -0
  409. package/dist/types/enums/WorkerTypes.d.ts.map +1 -0
  410. package/dist/types/enums/index.d.ts +2 -1
  411. package/dist/types/eventListeners/segmentation/imageChangeEventListener.d.ts.map +1 -1
  412. package/dist/types/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.d.ts.map +1 -1
  413. package/dist/types/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.d.ts +1 -0
  414. package/dist/types/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.d.ts.map +1 -1
  415. package/dist/types/stateManagement/annotation/annotationState.d.ts +2 -1
  416. package/dist/types/stateManagement/annotation/annotationState.d.ts.map +1 -1
  417. package/dist/types/stateManagement/segmentation/SegmentationStateManager.d.ts.map +1 -1
  418. package/dist/types/stateManagement/segmentation/addRepresentationData.d.ts +13 -0
  419. package/dist/types/stateManagement/segmentation/addRepresentationData.d.ts.map +1 -0
  420. package/dist/types/stateManagement/segmentation/addSegmentationRepresentation.d.ts.map +1 -1
  421. package/dist/types/stateManagement/segmentation/config/segmentationVisibility.d.ts.map +1 -1
  422. package/dist/types/stateManagement/segmentation/convertStackToVolumeSegmentation.d.ts +9 -2
  423. package/dist/types/stateManagement/segmentation/convertStackToVolumeSegmentation.d.ts.map +1 -1
  424. package/dist/types/stateManagement/segmentation/convertVolumeToStackSegmentation.d.ts +13 -0
  425. package/dist/types/stateManagement/segmentation/convertVolumeToStackSegmentation.d.ts.map +1 -1
  426. package/dist/types/stateManagement/segmentation/helpers/validateSegmentationInput.d.ts.map +1 -1
  427. package/dist/types/stateManagement/segmentation/index.d.ts +3 -1
  428. package/dist/types/stateManagement/segmentation/index.d.ts.map +1 -1
  429. package/dist/types/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts +3 -0
  430. package/dist/types/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts.map +1 -0
  431. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.d.ts +3 -0
  432. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.d.ts.map +1 -0
  433. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.d.ts +8 -0
  434. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.d.ts.map +1 -0
  435. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.d.ts +7 -0
  436. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.d.ts.map +1 -0
  437. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.d.ts +7 -0
  438. package/dist/types/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.d.ts.map +1 -0
  439. package/dist/types/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.d.ts +5 -0
  440. package/dist/types/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.d.ts.map +1 -0
  441. package/dist/types/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.d.ts +4 -0
  442. package/dist/types/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.d.ts.map +1 -0
  443. package/dist/types/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.d.ts +4 -0
  444. package/dist/types/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.d.ts.map +1 -0
  445. package/dist/types/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.d.ts +6 -0
  446. package/dist/types/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.d.ts.map +1 -0
  447. package/dist/types/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.d.ts +13 -0
  448. package/dist/types/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.d.ts.map +1 -0
  449. package/dist/types/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.d.ts +2 -0
  450. package/dist/types/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.d.ts.map +1 -0
  451. package/dist/types/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.d.ts +3 -0
  452. package/dist/types/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.d.ts.map +1 -0
  453. package/dist/types/stateManagement/segmentation/polySeg/computeAndAddRepresentation.d.ts +4 -0
  454. package/dist/types/stateManagement/segmentation/polySeg/computeAndAddRepresentation.d.ts.map +1 -0
  455. package/dist/types/stateManagement/segmentation/polySeg/index.d.ts +6 -0
  456. package/dist/types/stateManagement/segmentation/polySeg/index.d.ts.map +1 -0
  457. package/dist/types/stateManagement/segmentation/polySeg/registerPolySegWorker.d.ts +2 -0
  458. package/dist/types/stateManagement/segmentation/polySeg/registerPolySegWorker.d.ts.map +1 -0
  459. package/dist/types/stateManagement/segmentation/segmentIndex.d.ts.map +1 -1
  460. package/dist/types/stateManagement/segmentation/segmentationState.d.ts +6 -1
  461. package/dist/types/stateManagement/segmentation/segmentationState.d.ts.map +1 -1
  462. package/dist/types/tools/ScaleOverlayTool.d.ts.map +1 -1
  463. package/dist/types/tools/annotation/PlanarFreehandContourSegmentationTool.d.ts +1 -2
  464. package/dist/types/tools/annotation/PlanarFreehandContourSegmentationTool.d.ts.map +1 -1
  465. package/dist/types/tools/annotation/PlanarFreehandROITool.d.ts.map +1 -1
  466. package/dist/types/tools/annotation/ProbeTool.d.ts.map +1 -1
  467. package/dist/types/tools/base/BaseTool.d.ts.map +1 -1
  468. package/dist/types/tools/base/ContourSegmentationBaseTool.d.ts +1 -2
  469. package/dist/types/tools/base/ContourSegmentationBaseTool.d.ts.map +1 -1
  470. package/dist/types/tools/displayTools/Contour/contourDisplay.d.ts.map +1 -1
  471. package/dist/types/tools/displayTools/Contour/removeContourFromElement.d.ts.map +1 -1
  472. package/dist/types/tools/displayTools/Contour/{addContourSetsToElement.d.ts → vtkContour/addContourSetsToElement.d.ts} +1 -1
  473. package/dist/types/tools/displayTools/Contour/vtkContour/addContourSetsToElement.d.ts.map +1 -0
  474. package/dist/types/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.d.ts +4 -0
  475. package/dist/types/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.d.ts.map +1 -0
  476. package/dist/types/tools/displayTools/Contour/vtkContour/contourConfigCache.d.ts.map +1 -0
  477. package/dist/types/tools/displayTools/Contour/vtkContour/updateVTKContourSets.d.ts +4 -0
  478. package/dist/types/tools/displayTools/Contour/vtkContour/updateVTKContourSets.d.ts.map +1 -0
  479. package/dist/types/tools/displayTools/Contour/{utils.d.ts → vtkContour/utils.d.ts} +2 -2
  480. package/dist/types/tools/displayTools/Contour/vtkContour/utils.d.ts.map +1 -0
  481. package/dist/types/tools/displayTools/Labelmap/index.d.ts +2 -1
  482. package/dist/types/tools/displayTools/Labelmap/index.d.ts.map +1 -1
  483. package/dist/types/tools/displayTools/Labelmap/labelmapDisplay.d.ts.map +1 -1
  484. package/dist/types/tools/displayTools/Labelmap/validateLabelmap.d.ts +5 -0
  485. package/dist/types/tools/displayTools/Labelmap/validateLabelmap.d.ts.map +1 -0
  486. package/dist/types/tools/displayTools/Surface/addOrUpdateSurfaceToElement.d.ts +4 -0
  487. package/dist/types/tools/displayTools/Surface/addOrUpdateSurfaceToElement.d.ts.map +1 -0
  488. package/dist/types/tools/displayTools/Surface/surfaceConfig.d.ts +4 -0
  489. package/dist/types/tools/displayTools/Surface/surfaceConfig.d.ts.map +1 -0
  490. package/dist/types/tools/displayTools/Surface/surfaceDisplay.d.ts +7 -0
  491. package/dist/types/tools/displayTools/Surface/surfaceDisplay.d.ts.map +1 -1
  492. package/dist/types/tools/displayTools/registerDisplayToolsWorker.d.ts +2 -0
  493. package/dist/types/tools/displayTools/registerDisplayToolsWorker.d.ts.map +1 -0
  494. package/dist/types/tools/segmentation/CircleScissorsTool.d.ts.map +1 -1
  495. package/dist/types/tools/segmentation/RectangleScissorsTool.d.ts.map +1 -1
  496. package/dist/types/tools/segmentation/SegmentSelectTool.d.ts +6 -2
  497. package/dist/types/tools/segmentation/SegmentSelectTool.d.ts.map +1 -1
  498. package/dist/types/tools/segmentation/SphereScissorsTool.d.ts.map +1 -1
  499. package/dist/types/tools/segmentation/strategies/BrushStrategy.d.ts.map +1 -1
  500. package/dist/types/tools/segmentation/strategies/fillSphere.d.ts.map +1 -1
  501. package/dist/types/tools/segmentation/strategies/utils/getStrategyData.d.ts.map +1 -1
  502. package/dist/types/tools/segmentation/strategies/utils/stackVolumeCheck.d.ts +5 -5
  503. package/dist/types/tools/segmentation/strategies/utils/stackVolumeCheck.d.ts.map +1 -1
  504. package/dist/types/types/ContourSegmentationAnnotation.d.ts +0 -1
  505. package/dist/types/types/ContourSegmentationAnnotation.d.ts.map +1 -1
  506. package/dist/types/types/LabelmapTypes.d.ts +5 -1
  507. package/dist/types/types/LabelmapTypes.d.ts.map +1 -1
  508. package/dist/types/types/PolySeg.d.ts +7 -0
  509. package/dist/types/types/PolySeg.d.ts.map +1 -0
  510. package/dist/types/types/SegmentationStateTypes.d.ts +12 -2
  511. package/dist/types/types/SegmentationStateTypes.d.ts.map +1 -1
  512. package/dist/types/types/SurfaceTypes.d.ts +1 -1
  513. package/dist/types/types/SurfaceTypes.d.ts.map +1 -1
  514. package/dist/types/types/index.d.ts +2 -1
  515. package/dist/types/types/index.d.ts.map +1 -1
  516. package/dist/types/utilities/boundingBox/getBoundingBoxAroundShape.d.ts.map +1 -1
  517. package/dist/types/utilities/contourSegmentation/addContourSegmentationAnnotation.d.ts +3 -0
  518. package/dist/types/utilities/contourSegmentation/addContourSegmentationAnnotation.d.ts.map +1 -0
  519. package/dist/types/utilities/contourSegmentation/areSameSegment.d.ts.map +1 -1
  520. package/dist/types/utilities/contourSegmentation/index.d.ts +2 -0
  521. package/dist/types/utilities/contourSegmentation/index.d.ts.map +1 -1
  522. package/dist/types/utilities/contourSegmentation/removeContourSegmentationAnnotation.d.ts +3 -0
  523. package/dist/types/utilities/contourSegmentation/removeContourSegmentationAnnotation.d.ts.map +1 -0
  524. package/dist/types/utilities/contours/detectContourHoles.d.ts.map +1 -1
  525. package/dist/types/utilities/contours/getDeduplicatedVTKPolyDataPoints.d.ts +12 -0
  526. package/dist/types/utilities/contours/getDeduplicatedVTKPolyDataPoints.d.ts.map +1 -0
  527. package/dist/types/utilities/contours/index.d.ts +2 -2
  528. package/dist/types/utilities/contours/index.d.ts.map +1 -1
  529. package/dist/types/utilities/index.d.ts +3 -1
  530. package/dist/types/utilities/index.d.ts.map +1 -1
  531. package/dist/types/utilities/math/polyline/containsPoint.d.ts.map +1 -1
  532. package/dist/types/utilities/math/polyline/index.d.ts +2 -1
  533. package/dist/types/utilities/math/polyline/index.d.ts.map +1 -1
  534. package/dist/types/utilities/math/polyline/isPointInsidePolyline3D.d.ts +3 -0
  535. package/dist/types/utilities/math/polyline/isPointInsidePolyline3D.d.ts.map +1 -0
  536. package/dist/types/utilities/segmentation/contourAndFindLargestBidirectional.d.ts.map +1 -1
  537. package/dist/types/utilities/segmentation/getHoveredContourSegmentationAnnotation.d.ts +2 -0
  538. package/dist/types/utilities/segmentation/getHoveredContourSegmentationAnnotation.d.ts.map +1 -0
  539. package/dist/types/utilities/segmentation/getSegmentAtLabelmapBorder.d.ts +8 -0
  540. package/dist/types/utilities/segmentation/getSegmentAtLabelmapBorder.d.ts.map +1 -0
  541. package/dist/types/utilities/segmentation/getSegmentAtWorldPoint.d.ts +12 -0
  542. package/dist/types/utilities/segmentation/getSegmentAtWorldPoint.d.ts.map +1 -0
  543. package/dist/types/utilities/segmentation/getUniqueSegmentIndices.d.ts +3 -0
  544. package/dist/types/utilities/segmentation/getUniqueSegmentIndices.d.ts.map +1 -0
  545. package/dist/types/utilities/segmentation/index.d.ts +5 -1
  546. package/dist/types/utilities/segmentation/index.d.ts.map +1 -1
  547. package/dist/types/utilities/triggerAnnotationRenderForToolGroupIds.d.ts +3 -0
  548. package/dist/types/utilities/triggerAnnotationRenderForToolGroupIds.d.ts.map +1 -0
  549. package/dist/types/workers/clippingPlaneWorker.d.ts +2 -0
  550. package/dist/types/workers/clippingPlaneWorker.d.ts.map +1 -0
  551. package/dist/types/workers/polySegConverters.d.ts +2 -0
  552. package/dist/types/workers/polySegConverters.d.ts.map +1 -0
  553. package/dist/umd/17dd54813d5acc10bf8f.wasm +0 -0
  554. package/dist/umd/444.index.js +3 -0
  555. package/dist/umd/444.index.js.LICENSE.txt +5 -0
  556. package/dist/umd/444.index.js.map +1 -0
  557. package/dist/umd/78.index.js +3 -0
  558. package/dist/umd/78.index.js.LICENSE.txt +5 -0
  559. package/dist/umd/78.index.js.map +1 -0
  560. package/dist/umd/985.index.js +2 -0
  561. package/dist/umd/985.index.js.map +1 -0
  562. package/dist/umd/index.js +1 -1
  563. package/dist/umd/index.js.map +1 -1
  564. package/package.json +5 -3
  565. package/src/enums/WorkerTypes.ts +16 -0
  566. package/src/enums/index.js +2 -0
  567. package/src/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.ts +10 -17
  568. package/src/eventListeners/segmentation/imageChangeEventListener.ts +3 -4
  569. package/src/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.ts +97 -69
  570. package/src/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.ts +11 -0
  571. package/src/stateManagement/annotation/annotationState.ts +6 -0
  572. package/src/stateManagement/segmentation/SegmentationStateManager.ts +4 -1
  573. package/src/stateManagement/segmentation/addRepresentationData.ts +71 -0
  574. package/src/stateManagement/segmentation/addSegmentationRepresentation.ts +39 -16
  575. package/src/stateManagement/segmentation/config/segmentationVisibility.ts +1 -59
  576. package/src/stateManagement/segmentation/convertStackToVolumeSegmentation.ts +74 -37
  577. package/src/stateManagement/segmentation/convertVolumeToStackSegmentation.ts +102 -38
  578. package/src/stateManagement/segmentation/helpers/validateSegmentationInput.ts +13 -8
  579. package/src/stateManagement/segmentation/index.ts +9 -2
  580. package/src/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.ts +17 -0
  581. package/src/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.ts +25 -0
  582. package/src/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.ts +273 -0
  583. package/src/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.ts +89 -0
  584. package/src/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.ts +193 -0
  585. package/src/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.ts +26 -0
  586. package/src/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.ts +62 -0
  587. package/src/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.ts +81 -0
  588. package/src/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.ts +81 -0
  589. package/src/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.ts +167 -0
  590. package/src/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.ts +95 -0
  591. package/src/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.ts +123 -0
  592. package/src/stateManagement/segmentation/polySeg/computeAndAddRepresentation.ts +97 -0
  593. package/src/stateManagement/segmentation/polySeg/index.ts +12 -0
  594. package/src/stateManagement/segmentation/polySeg/registerPolySegWorker.ts +34 -0
  595. package/src/stateManagement/segmentation/segmentIndex.ts +5 -0
  596. package/src/stateManagement/segmentation/segmentationState.ts +62 -0
  597. package/src/tools/ScaleOverlayTool.ts +4 -1
  598. package/src/tools/annotation/PlanarFreehandContourSegmentationTool.ts +1 -22
  599. package/src/tools/annotation/PlanarFreehandROITool.ts +2 -4
  600. package/src/tools/annotation/ProbeTool.ts +4 -0
  601. package/src/tools/annotation/SplineROITool.ts +1 -1
  602. package/src/tools/annotation/planarFreehandROITool/drawLoop.ts +2 -2
  603. package/src/tools/annotation/planarFreehandROITool/openContourEndEditLoop.ts +1 -1
  604. package/src/tools/base/AnnotationTool.ts +1 -1
  605. package/src/tools/base/BaseTool.ts +1 -6
  606. package/src/tools/base/ContourBaseTool.ts +1 -1
  607. package/src/tools/base/ContourSegmentationBaseTool.ts +45 -42
  608. package/src/tools/displayTools/Contour/contourDisplay.ts +82 -9
  609. package/src/tools/displayTools/Contour/removeContourFromElement.ts +2 -0
  610. package/src/tools/displayTools/Contour/{addContourSetsToElement.ts → vtkContour/addContourSetsToElement.ts} +1 -1
  611. package/src/tools/displayTools/Contour/{addOrUpdateContourSets.ts → vtkContour/addOrUpdateVTKContourSets.ts} +4 -4
  612. package/src/tools/displayTools/Contour/{updateContourSets.ts → vtkContour/updateVTKContourSets.ts} +2 -2
  613. package/src/tools/displayTools/Contour/{utils.ts → vtkContour/utils.ts} +1 -1
  614. package/src/tools/displayTools/Labelmap/addLabelmapToElement.ts +1 -1
  615. package/src/tools/displayTools/Labelmap/index.ts +10 -1
  616. package/src/tools/displayTools/Labelmap/labelmapDisplay.ts +39 -4
  617. package/src/tools/displayTools/Labelmap/validateLabelmap.ts +71 -0
  618. package/src/tools/displayTools/Surface/addOrUpdateSurfaceToElement.ts +172 -0
  619. package/src/tools/displayTools/Surface/surfaceConfig.ts +12 -0
  620. package/src/tools/displayTools/Surface/surfaceDisplay.ts +275 -35
  621. package/src/tools/displayTools/registerDisplayToolsWorker.ts +34 -0
  622. package/src/tools/segmentation/BrushTool.ts +1 -1
  623. package/src/tools/segmentation/CircleScissorsTool.ts +3 -1
  624. package/src/tools/segmentation/PaintFillTool.ts +1 -1
  625. package/src/tools/segmentation/RectangleScissorsTool.ts +3 -1
  626. package/src/tools/segmentation/SegmentSelectTool.ts +70 -75
  627. package/src/tools/segmentation/SphereScissorsTool.ts +3 -1
  628. package/src/tools/segmentation/strategies/BrushStrategy.ts +12 -9
  629. package/src/tools/segmentation/strategies/compositions/regionFill.ts +1 -1
  630. package/src/tools/segmentation/strategies/fillSphere.ts +13 -5
  631. package/src/tools/segmentation/strategies/utils/getStrategyData.ts +30 -15
  632. package/src/tools/segmentation/strategies/utils/stackVolumeCheck.ts +24 -17
  633. package/src/types/ContourSegmentationAnnotation.ts +0 -1
  634. package/src/types/LabelmapTypes.ts +7 -1
  635. package/src/types/PolySeg.ts +7 -0
  636. package/src/types/SegmentationStateTypes.ts +20 -4
  637. package/src/types/SurfaceTypes.ts +1 -1
  638. package/src/types/index.ts +3 -0
  639. package/src/utilities/boundingBox/getBoundingBoxAroundShape.ts +4 -2
  640. package/src/utilities/contourSegmentation/addContourSegmentationAnnotation.ts +29 -0
  641. package/src/utilities/contourSegmentation/areSameSegment.ts +0 -2
  642. package/src/utilities/contourSegmentation/index.ts +2 -0
  643. package/src/utilities/contourSegmentation/removeContourSegmentationAnnotation.ts +30 -0
  644. package/src/utilities/contours/detectContourHoles.ts +2 -0
  645. package/src/utilities/contours/generateContourSetsFromLabelmap.ts +2 -2
  646. package/src/utilities/contours/getDeduplicatedVTKPolyDataPoints.ts +66 -0
  647. package/src/utilities/contours/index.ts +2 -2
  648. package/src/utilities/index.ts +4 -0
  649. package/src/utilities/math/polyline/containsPoint.ts +3 -1
  650. package/src/utilities/math/polyline/index.ts +2 -0
  651. package/src/utilities/math/polyline/isPointInsidePolyline3D.ts +56 -0
  652. package/src/utilities/segmentation/contourAndFindLargestBidirectional.ts +0 -1
  653. package/src/utilities/segmentation/getHoveredContourSegmentationAnnotation.ts +25 -0
  654. package/src/utilities/segmentation/getSegmentAtLabelmapBorder.ts +179 -0
  655. package/src/utilities/segmentation/getSegmentAtWorldPoint.ts +173 -0
  656. package/src/utilities/segmentation/getUniqueSegmentIndices.ts +76 -0
  657. package/src/utilities/segmentation/index.ts +8 -0
  658. package/src/utilities/triggerAnnotationRenderForToolGroupIds.ts +38 -0
  659. package/src/workers/clippingPlaneWorker.js +87 -0
  660. package/src/workers/polySegConverters.js +467 -0
  661. package/dist/cjs/tools/displayTools/Contour/addContourSetsToElement.js.map +0 -1
  662. package/dist/cjs/tools/displayTools/Contour/addOrUpdateContourSets.d.ts +0 -3
  663. package/dist/cjs/tools/displayTools/Contour/addOrUpdateContourSets.js +0 -14
  664. package/dist/cjs/tools/displayTools/Contour/addOrUpdateContourSets.js.map +0 -1
  665. package/dist/cjs/tools/displayTools/Contour/contourConfigCache.js.map +0 -1
  666. package/dist/cjs/tools/displayTools/Contour/updateContourSets.d.ts +0 -3
  667. package/dist/cjs/tools/displayTools/Contour/updateContourSets.js.map +0 -1
  668. package/dist/cjs/tools/displayTools/Contour/utils.js.map +0 -1
  669. package/dist/cjs/tools/displayTools/Labelmap/validateRepresentationData.d.ts +0 -3
  670. package/dist/cjs/tools/displayTools/Labelmap/validateRepresentationData.js +0 -20
  671. package/dist/cjs/tools/displayTools/Labelmap/validateRepresentationData.js.map +0 -1
  672. package/dist/cjs/tools/displayTools/Surface/addSurfaceToElement.d.ts +0 -2
  673. package/dist/cjs/tools/displayTools/Surface/addSurfaceToElement.js +0 -84
  674. package/dist/cjs/tools/displayTools/Surface/addSurfaceToElement.js.map +0 -1
  675. package/dist/cjs/utilities/contours/mergePoints.d.ts +0 -8
  676. package/dist/cjs/utilities/contours/mergePoints.js +0 -77
  677. package/dist/cjs/utilities/contours/mergePoints.js.map +0 -1
  678. package/dist/esm/tools/displayTools/Contour/addContourSetsToElement.js.map +0 -1
  679. package/dist/esm/tools/displayTools/Contour/addOrUpdateContourSets.js.map +0 -1
  680. package/dist/esm/tools/displayTools/Contour/contourConfigCache.js.map +0 -1
  681. package/dist/esm/tools/displayTools/Contour/updateContourSets.js.map +0 -1
  682. package/dist/esm/tools/displayTools/Contour/utils.js.map +0 -1
  683. package/dist/esm/tools/displayTools/Labelmap/validateRepresentationData.js +0 -18
  684. package/dist/esm/tools/displayTools/Labelmap/validateRepresentationData.js.map +0 -1
  685. package/dist/esm/tools/displayTools/Surface/addSurfaceToElement.js +0 -79
  686. package/dist/esm/tools/displayTools/Surface/addSurfaceToElement.js.map +0 -1
  687. package/dist/esm/utilities/contours/mergePoints.js +0 -73
  688. package/dist/esm/utilities/contours/mergePoints.js.map +0 -1
  689. package/dist/types/tools/displayTools/Contour/addContourSetsToElement.d.ts.map +0 -1
  690. package/dist/types/tools/displayTools/Contour/addOrUpdateContourSets.d.ts +0 -4
  691. package/dist/types/tools/displayTools/Contour/addOrUpdateContourSets.d.ts.map +0 -1
  692. package/dist/types/tools/displayTools/Contour/contourConfigCache.d.ts.map +0 -1
  693. package/dist/types/tools/displayTools/Contour/updateContourSets.d.ts +0 -4
  694. package/dist/types/tools/displayTools/Contour/updateContourSets.d.ts.map +0 -1
  695. package/dist/types/tools/displayTools/Contour/utils.d.ts.map +0 -1
  696. package/dist/types/tools/displayTools/Labelmap/validateRepresentationData.d.ts +0 -4
  697. package/dist/types/tools/displayTools/Labelmap/validateRepresentationData.d.ts.map +0 -1
  698. package/dist/types/tools/displayTools/Surface/addSurfaceToElement.d.ts +0 -3
  699. package/dist/types/tools/displayTools/Surface/addSurfaceToElement.d.ts.map +0 -1
  700. package/dist/types/utilities/contours/mergePoints.d.ts +0 -9
  701. package/dist/types/utilities/contours/mergePoints.d.ts.map +0 -1
  702. package/src/tools/displayTools/Labelmap/validateRepresentationData.ts +0 -36
  703. package/src/tools/displayTools/Surface/addSurfaceToElement.ts +0 -115
  704. package/src/utilities/contours/mergePoints.ts +0 -108
  705. /package/dist/cjs/tools/displayTools/Contour/{addContourSetsToElement.js → vtkContour/addContourSetsToElement.js} +0 -0
  706. /package/dist/cjs/tools/displayTools/Contour/{contourConfigCache.d.ts → vtkContour/contourConfigCache.d.ts} +0 -0
  707. /package/dist/cjs/tools/displayTools/Contour/{contourConfigCache.js → vtkContour/contourConfigCache.js} +0 -0
  708. /package/dist/cjs/tools/displayTools/Contour/{utils.js → vtkContour/utils.js} +0 -0
  709. /package/dist/esm/tools/displayTools/Contour/{addContourSetsToElement.js → vtkContour/addContourSetsToElement.js} +0 -0
  710. /package/dist/esm/tools/displayTools/Contour/{contourConfigCache.js → vtkContour/contourConfigCache.js} +0 -0
  711. /package/dist/esm/tools/displayTools/Contour/{utils.js → vtkContour/utils.js} +0 -0
  712. /package/dist/types/tools/displayTools/Contour/{contourConfigCache.d.ts → vtkContour/contourConfigCache.d.ts} +0 -0
  713. /package/src/tools/displayTools/Contour/{contourConfigCache.ts → vtkContour/contourConfigCache.ts} +0 -0
@@ -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,CA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C,CAAC,KAAK,CAAC,EAAE;oBAChB,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC;iBAChB;gBACD,OAAO,IAAI,CAAC;YACd,CAAC,CAAC,CAAC;SACJ;aAAM;YACL,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC;YAClC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACnB,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;gBACtB,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE;oBAChB,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC;iBACnB;gBACD,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE;oBAChB,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC;iBACnB;gBACD,OAAO,IAAI,CAAC;YACd,CAAC,CAAC,CAAC;SACJ;KACF;IAED,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC;IAEhE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAChD,CAAC;AAED,eAAe,EAAE,gCAAgC,EAAE,CAAC"}
@@ -1,6 +1,6 @@
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';
@@ -10,5 +10,5 @@ import updateContourPolyline from './updateContourPolyline';
10
10
  import acceptAutogeneratedInterpolations from './interpolation/acceptAutogeneratedInterpolations';
11
11
  import * as interpolation from './interpolation';
12
12
  import findHandlePolylineIndex from './findHandlePolylineIndex';
13
- export { areCoplanarContours, contourFinder, mergePoints, detectContourHoles, generateContourSetsFromLabelmap, AnnotationToPointData, getContourHolesDataWorld, getContourHolesDataCanvas, updateContourPolyline, interpolation, acceptAutogeneratedInterpolations, findHandlePolylineIndex, };
13
+ export { areCoplanarContours, contourFinder, getDeduplicatedVTKPolyDataPoints, detectContourHoles, generateContourSetsFromLabelmap, AnnotationToPointData, getContourHolesDataWorld, getContourHolesDataCanvas, updateContourPolyline, interpolation, acceptAutogeneratedInterpolations, findHandlePolylineIndex, };
14
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,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,WAAW,EACX,kBAAkB,EAClB,+BAA+B,EAC/B,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,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"}
@@ -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,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C;AAG1C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EACL,IAAI,EACJ,MAAM,EACN,eAAe,EACf,OAAO,EACP,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,kBAAkB,EAClB,YAAY,EACZ,QAAQ,EACR,qCAAqC,EACrC,sCAAsC,EACtC,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,sCAAsC,EACtC,WAAW,EACX,gCAAgC,EAChC,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,MAAM,EACN,WAAW,EACX,aAAa,EACb,aAAa,EACb,GAAG,EACH,oBAAoB,EACpB,mBAAmB,GACpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"containsPoint.js","sourceRoot":"","sources":["../../../../../src/utilities/math/polyline/containsPoint.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAalC,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,QAAwB,EACxB,KAAmB,EACnB,MAAgB;IAEhB,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QACvB,OAAO,KAAK,CAAC;KACd;IAED,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC1C,IAAI,gBAAgB,GAAG,CAAC,CAAC;IAGzB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC1E,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CA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AAC,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"}
@@ -17,5 +17,6 @@ import getSubPixelSpacingAndXYDirections from './getSubPixelSpacingAndXYDirectio
17
17
  import pointsAreWithinCloseContourProximity from './pointsAreWithinCloseContourProximity';
18
18
  import addCanvasPointsToArray from './addCanvasPointsToArray';
19
19
  import pointCanProjectOnLine from './pointCanProjectOnLine';
20
- export { isClosed, containsPoint, containsPoints, getAABB, getArea, getSignedArea, getWindingDirection, 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, };
21
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,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;AAE5D,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,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=isPointInsidePolyline3D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isPointInsidePolyline3D.js","sourceRoot":"","sources":["../../../../../src/utilities/math/polyline/isPointInsidePolyline3D.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAa5C,MAAM,UAAU,uBAAuB,CACrC,KAAmB,EACnB,QAAwB;IAOxB,IAAI,oBAAoB,CAAC;IAEzB,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QAC1B,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YACvE,oBAAoB,GAAG,CAAC,CAAC;YACzB,MAAM;SACP;KACF;IAED,IAAI,oBAAoB,KAAK,SAAS,EAAE;QACtC,MAAM,IAAI,KAAK,CACb,2EAA2E,CAC5E,CAAC;KACH;IAGD,MAAM,QAAQ,GAAG,EAAoB,CAAC;IAEtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,QAAQ,CAAC,IAAI,CAAC;YACZ,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,oBAAoB,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;YAC3C,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,oBAAoB,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;SAC5C,CAAC,CAAC;KACJ;IAED,MAAM,OAAO,GAAG;QACd,KAAK,CAAC,CAAC,oBAAoB,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACrC,KAAK,CAAC,CAAC,oBAAoB,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;KACtB,CAAC;IAElB,OAAO,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { generateContourSetsFromLabelmap } from '../contours';
2
2
  import SegmentationRepresentations from '../../enums/SegmentationRepresentations';
3
3
  import findLargestBidirectional from './findLargestBidirectional';
4
- const EPSILON = 1e-2;
5
4
  const { Labelmap } = SegmentationRepresentations;
6
5
  export default function contourAndFindLargestBidirectional(segmentation) {
7
6
  const contours = generateContourSetsFromLabelmap({
@@ -1 +1 @@
1
- {"version":3,"file":"contourAndFindLargestBidirectional.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/contourAndFindLargestBidirectional.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,2BAA2B,MAAM,yCAAyC,CAAC;AAClF,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAElE,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,MAAM,EAAE,QAAQ,EAAE,GAAG,2BAA2B,CAAC;AAYjD,MAAM,CAAC,OAAO,UAAU,kCAAkC,CAAC,YAAY;IACrE,MAAM,QAAQ,GAAG,+BAA+B,CAAC;QAC/C,aAAa,EAAE,YAAY;KAC5B,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE;QAC1D,OAAO;KACR;IAED,MAAM,EACJ,kBAAkB,EAClB,QAAQ,GAAG;QACT,IAAI;QACJ,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE;KACrE,GACF,GAAG,YAAY,CAAC;IACjB,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAE/D,MAAM,YAAY,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACtD,IAAI,YAAY,KAAK,CAAC,CAAC,EAAE;QACvB,OAAO;KACR;IACD,QAAQ,CAAC,YAAY,CAAC,CAAC,YAAY,GAAG,YAAY,CAAC;IACnD,OAAO,wBAAwB,CAC7B,QAAQ,CAAC,CAAC,CAAC,EACX,WAAW,EACX,QAAQ,CAAC,YAAY,CAAC,CACvB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"contourAndFindLargestBidirectional.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/contourAndFindLargestBidirectional.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,2BAA2B,MAAM,yCAAyC,CAAC;AAClF,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAElE,MAAM,EAAE,QAAQ,EAAE,GAAG,2BAA2B,CAAC;AAYjD,MAAM,CAAC,OAAO,UAAU,kCAAkC,CAAC,YAAY;IACrE,MAAM,QAAQ,GAAG,+BAA+B,CAAC;QAC/C,aAAa,EAAE,YAAY;KAC5B,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE;QAC1D,OAAO;KACR;IAED,MAAM,EACJ,kBAAkB,EAClB,QAAQ,GAAG;QACT,IAAI;QACJ,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE;KACrE,GACF,GAAG,YAAY,CAAC;IACjB,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAE/D,MAAM,YAAY,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACtD,IAAI,YAAY,KAAK,CAAC,CAAC,EAAE;QACvB,OAAO;KACR;IACD,QAAQ,CAAC,YAAY,CAAC,CAAC,YAAY,GAAG,YAAY,CAAC;IACnD,OAAO,wBAAwB,CAC7B,QAAQ,CAAC,CAAC,CAAC,EACX,WAAW,EACX,QAAQ,CAAC,YAAY,CAAC,CACvB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { getAnnotation } from '../../stateManagement';
2
+ import { getSegmentation } from '../../stateManagement/segmentation/segmentationState';
3
+ export function getHoveredContourSegmentationAnnotation(segmentationId) {
4
+ const segmentation = getSegmentation(segmentationId);
5
+ const { annotationUIDsMap } = segmentation.representationData.CONTOUR;
6
+ for (const [segmentIndex, annotationUIDs] of annotationUIDsMap.entries()) {
7
+ const highlightedAnnotationUID = Array.from(annotationUIDs).find((annotationUID) => getAnnotation(annotationUID).highlighted);
8
+ if (highlightedAnnotationUID) {
9
+ return segmentIndex;
10
+ }
11
+ }
12
+ return undefined;
13
+ }
14
+ //# sourceMappingURL=getHoveredContourSegmentationAnnotation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getHoveredContourSegmentationAnnotation.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/getHoveredContourSegmentationAnnotation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,sDAAsD,CAAC;AAQvF,MAAM,UAAU,uCAAuC,CAAC,cAAc;IACpE,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IACrD,MAAM,EAAE,iBAAiB,EAAE,GAAG,YAAY,CAAC,kBAAkB,CAAC,OAAO,CAAC;IAEtE,KAAK,MAAM,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,iBAAiB,CAAC,OAAO,EAAE,EAAE;QACxE,MAAM,wBAAwB,GAAG,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,IAAI,CAC9D,CAAC,aAAa,EAAE,EAAE,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,WAAW,CAC5D,CAAC;QAEF,IAAI,wBAAwB,EAAE;YAC5B,OAAO,YAAY,CAAC;SACrB;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,73 @@
1
+ import { cache, utilities } from '@cornerstonejs/core';
2
+ import { getSegmentation, getSegmentationIdRepresentations, } from '../../stateManagement/segmentation/segmentationState';
3
+ import { isVolumeSegmentation } from '../../tools/segmentation/strategies/utils/stackVolumeCheck';
4
+ export function getSegmentAtLabelmapBorder(segmentationId, worldPoint, { viewport, searchRadius }) {
5
+ const segmentation = getSegmentation(segmentationId);
6
+ const labelmapData = segmentation.representationData.LABELMAP;
7
+ if (isVolumeSegmentation(labelmapData)) {
8
+ const { volumeId } = labelmapData;
9
+ const segmentationVolume = cache.getVolume(volumeId);
10
+ if (!segmentationVolume) {
11
+ return;
12
+ }
13
+ const imageData = segmentationVolume.imageData;
14
+ const segmentIndex = imageData.getScalarValueFromWorld(worldPoint);
15
+ const canvasPoint = viewport.worldToCanvas(worldPoint);
16
+ const onEdge = isSegmentOnEdgeCanvas(canvasPoint, segmentIndex, viewport, imageData, searchRadius);
17
+ return onEdge ? segmentIndex : undefined;
18
+ }
19
+ const { imageIdReferenceMap } = labelmapData;
20
+ const currentImageId = viewport.getCurrentImageId();
21
+ const segmentationImageId = imageIdReferenceMap.get(currentImageId);
22
+ const image = cache.getImage(segmentationImageId);
23
+ if (!image) {
24
+ return;
25
+ }
26
+ const segmentationRepresentations = getSegmentationIdRepresentations(segmentation.segmentationId);
27
+ const { segmentationRepresentationUID } = segmentationRepresentations[0];
28
+ const segmentationActor = viewport.getActor(segmentationRepresentationUID);
29
+ const imageData = segmentationActor?.actor.getMapper().getInputData();
30
+ const indexIJK = utilities.transformWorldToIndex(imageData, worldPoint);
31
+ const dimensions = imageData.getDimensions();
32
+ const voxelManager = utilities.VoxelManager.createVolumeVoxelManager(dimensions, imageData.getPointData().getScalars().getData());
33
+ const segmentIndex = voxelManager.getAtIJK(...indexIJK);
34
+ const onEdge = isSegmentOnEdgeIJK(indexIJK, dimensions, voxelManager, segmentIndex);
35
+ return onEdge ? segmentIndex : undefined;
36
+ }
37
+ function isSegmentOnEdge(getNeighborIndex, segmentIndex, searchRadius = 1) {
38
+ const neighborRange = Array.from({ length: 2 * searchRadius + 1 }, (_, i) => i - searchRadius);
39
+ for (const deltaI of neighborRange) {
40
+ for (const deltaJ of neighborRange) {
41
+ for (const deltaK of neighborRange) {
42
+ if (deltaI === 0 && deltaJ === 0 && deltaK === 0) {
43
+ continue;
44
+ }
45
+ const neighborIndex = getNeighborIndex(deltaI, deltaJ, deltaK);
46
+ if (neighborIndex !== undefined && segmentIndex !== neighborIndex) {
47
+ return true;
48
+ }
49
+ }
50
+ }
51
+ }
52
+ return false;
53
+ }
54
+ function isSegmentOnEdgeIJK(indexIJK, dimensions, voxelManager, segmentIndex, searchRadius) {
55
+ const getNeighborIndex = (deltaI, deltaJ, deltaK) => {
56
+ const neighborIJK = [
57
+ indexIJK[0] + deltaI,
58
+ indexIJK[1] + deltaJ,
59
+ indexIJK[2] + deltaK,
60
+ ];
61
+ return voxelManager.getAtIJK(...neighborIJK);
62
+ };
63
+ return isSegmentOnEdge(getNeighborIndex, segmentIndex, searchRadius);
64
+ }
65
+ function isSegmentOnEdgeCanvas(canvasPoint, segmentIndex, viewport, imageData, searchRadius) {
66
+ const getNeighborIndex = (deltaI, deltaJ) => {
67
+ const neighborCanvas = [canvasPoint[0] + deltaI, canvasPoint[1] + deltaJ];
68
+ const worldPoint = viewport.canvasToWorld(neighborCanvas);
69
+ return imageData.getScalarValueFromWorld(worldPoint);
70
+ };
71
+ return isSegmentOnEdge(getNeighborIndex, segmentIndex, searchRadius);
72
+ }
73
+ //# sourceMappingURL=getSegmentAtLabelmapBorder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSegmentAtLabelmapBorder.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/getSegmentAtLabelmapBorder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EACL,eAAe,EACf,gCAAgC,GACjC,MAAM,sDAAsD,CAAC;AAK9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAiBlG,MAAM,UAAU,0BAA0B,CACxC,cAAsB,EACtB,UAAwB,EACxB,EAAE,QAAQ,EAAE,YAAY,EAAW;IAEnC,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAErD,MAAM,YAAY,GAAG,YAAY,CAAC,kBAAkB,CAAC,QAAQ,CAAC;IAE9D,IAAI,oBAAoB,CAAC,YAAY,CAAC,EAAE;QACtC,MAAM,EAAE,QAAQ,EAAE,GAAG,YAA8C,CAAC;QACpE,MAAM,kBAAkB,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAErD,IAAI,CAAC,kBAAkB,EAAE;YACvB,OAAO;SACR;QAED,MAAM,SAAS,GAAG,kBAAkB,CAAC,SAAS,CAAC;QAE/C,MAAM,YAAY,GAAG,SAAS,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;QAEnE,MAAM,WAAW,GAAG,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AC/C,CAAC,CAAC;IAEF,OAAO,eAAe,CAAC,gBAAgB,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AACvE,CAAC;AAED,SAAS,qBAAqB,CAC5B,WAAyB,EACzB,YAAoB,EACpB,QAAyB,EACzB,SAAc,EACd,YAAqB;IAErB,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAE,MAAc,EAAE,EAAE;QAC1D,MAAM,cAAc,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;QAE1E,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,cAA8B,CAAC,CAAC;QAC1E,OAAO,SAAS,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC,CAAC;IAEF,OAAO,eAAe,CAAC,gBAAgB,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AACvE,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { cache, utilities } from '@cornerstonejs/core';
2
+ import { SegmentationRepresentations } from '../../enums';
3
+ import { getSegmentation, getSegmentationIdRepresentations, } from '../../stateManagement/segmentation/segmentationState';
4
+ import { isVolumeSegmentation } from '../../tools/segmentation/strategies/utils/stackVolumeCheck';
5
+ import { getAnnotation } from '../../stateManagement';
6
+ import { isPointInsidePolyline3D } from '../math/polyline';
7
+ export function getSegmentAtWorldPoint(segmentationId, worldPoint, options = {}) {
8
+ const segmentation = getSegmentation(segmentationId);
9
+ const representationData = segmentation.representationData;
10
+ const desiredRepresentation = options?.representationType ?? Object.keys(representationData)[0];
11
+ if (!desiredRepresentation) {
12
+ throw new Error(`Segmentation ${segmentationId} does not have any representations`);
13
+ }
14
+ switch (desiredRepresentation) {
15
+ case SegmentationRepresentations.Labelmap:
16
+ return getSegmentAtWorldForLabelmap(segmentation, worldPoint, options);
17
+ case SegmentationRepresentations.Contour:
18
+ return getSegmentAtWorldForContour(segmentation, worldPoint, options);
19
+ default:
20
+ return;
21
+ }
22
+ }
23
+ export function getSegmentAtWorldForLabelmap(segmentation, worldPoint, { viewport }) {
24
+ const labelmapData = segmentation.representationData.LABELMAP;
25
+ if (isVolumeSegmentation(labelmapData)) {
26
+ const { volumeId } = labelmapData;
27
+ const segmentationVolume = cache.getVolume(volumeId);
28
+ if (!segmentationVolume) {
29
+ return;
30
+ }
31
+ const segmentIndex = segmentationVolume.imageData.getScalarValueFromWorld(worldPoint);
32
+ return segmentIndex;
33
+ }
34
+ const { imageIdReferenceMap } = labelmapData;
35
+ const currentImageId = viewport.getCurrentImageId();
36
+ const segmentationImageId = imageIdReferenceMap.get(currentImageId);
37
+ const image = cache.getImage(segmentationImageId);
38
+ if (!image) {
39
+ return;
40
+ }
41
+ const segmentationRepresentations = getSegmentationIdRepresentations(segmentation.segmentationId);
42
+ const { segmentationRepresentationUID } = segmentationRepresentations[0];
43
+ const segmentationActor = viewport.getActor(segmentationRepresentationUID);
44
+ const imageData = segmentationActor?.actor.getMapper().getInputData();
45
+ const indexIJK = utilities.transformWorldToIndex(imageData, worldPoint);
46
+ const dimensions = imageData.getDimensions();
47
+ const voxelManager = utilities.VoxelManager.createVolumeVoxelManager(dimensions, imageData.getPointData().getScalars().getData());
48
+ const segmentIndex = voxelManager.getAtIJK(...indexIJK);
49
+ return segmentIndex;
50
+ }
51
+ export function getSegmentAtWorldForContour(segmentation, worldPoint, { viewport }) {
52
+ const contourData = segmentation.representationData.CONTOUR;
53
+ const segmentIndices = Array.from(contourData.annotationUIDsMap.keys());
54
+ const { viewPlaneNormal } = viewport.getCamera();
55
+ for (const segmentIndex of segmentIndices) {
56
+ const annotationsSet = contourData.annotationUIDsMap.get(segmentIndex);
57
+ if (!annotationsSet) {
58
+ continue;
59
+ }
60
+ for (const annotationUID of annotationsSet) {
61
+ const annotation = getAnnotation(annotationUID);
62
+ if (!annotation) {
63
+ continue;
64
+ }
65
+ const { polyline } = annotation.data.contour;
66
+ if (!utilities.isEqual(viewPlaneNormal, annotation.metadata.viewPlaneNormal)) {
67
+ continue;
68
+ }
69
+ if (isPointInsidePolyline3D(worldPoint, polyline)) {
70
+ return Number(segmentIndex);
71
+ }
72
+ }
73
+ }
74
+ }
75
+ //# sourceMappingURL=getSegmentAtWorldPoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSegmentAtWorldPoint.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/getSegmentAtWorldPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EACL,eAAe,EACf,gCAAgC,GACjC,MAAM,sDAAsD,CAAC;AAK9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAElG,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAc3D,MAAM,UAAU,sBAAsB,CACpC,cAAsB,EACtB,UAAwB,EACxB,UAAU,EAAa;IAEvB,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAErD,MAAM,kBAAkB,GAAG,YAAY,CAAC,kBAAkB,CAAC;IAG3D,MAAM,qBAAqB,GACzB,OAAO,EAAE,kBAAkB,IAAI,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpE,IAAI,CAAC,qBAAqB,EAAE;QAC1B,MAAM,IAAI,KAAK,CACb,gBAAgB,cAAc,oCAAoC,CACnE,CAAC;KACH;IAED,QAAQ,qBAAqB,EAAE;QAC7B,KAAK,2BAA2B,CAAC,QAAQ;YACvC,OAAO,4BAA4B,CAAC,YAAY,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACzE,KAAK,2BAA2B,CAAC,OAAO;YACtC,OAAO,2BAA2B,CAAC,YAAY,EAAE,UAAU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,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { cache } from '@cornerstonejs/core';
2
+ import { SegmentationRepresentations } from '../../enums';
3
+ import { getSegmentation } from '../../stateManagement/segmentation/segmentationState';
4
+ import { isVolumeSegmentation } from '../../tools/segmentation/strategies/utils/stackVolumeCheck';
5
+ function getUniqueSegmentIndices(segmentationId) {
6
+ const segmentation = getSegmentation(segmentationId);
7
+ if (segmentation.type === SegmentationRepresentations.Labelmap) {
8
+ const labelmapData = segmentation.representationData[SegmentationRepresentations.Labelmap];
9
+ const keySet = new Set();
10
+ if (isVolumeSegmentation(labelmapData)) {
11
+ const volume = cache.getVolume(segmentationId);
12
+ const scalarData = volume.getScalarData();
13
+ for (let i = 0; i < scalarData.length; i++) {
14
+ const segmentIndex = scalarData[i];
15
+ if (segmentIndex !== 0) {
16
+ keySet.add(segmentIndex);
17
+ }
18
+ }
19
+ }
20
+ else {
21
+ labelmapData.imageIdReferenceMap.forEach((segmentationImageId) => {
22
+ const image = cache.getImage(segmentationImageId);
23
+ const scalarData = image.getPixelData();
24
+ for (let i = 0; i < scalarData.length; i++) {
25
+ const segmentIndex = scalarData[i];
26
+ if (segmentIndex !== 0) {
27
+ keySet.add(segmentIndex);
28
+ }
29
+ }
30
+ });
31
+ }
32
+ return Array.from(keySet)
33
+ .map((it) => parseInt(it))
34
+ .sort();
35
+ }
36
+ else if (segmentation.type === SegmentationRepresentations.Contour) {
37
+ const annotationUIDsMap = segmentation.representationData.CONTOUR?.annotationUIDsMap;
38
+ const indices = new Set(annotationUIDsMap.keys());
39
+ const geometryIds = segmentation.representationData.CONTOUR?.geometryIds;
40
+ if (!geometryIds) {
41
+ throw new Error(`No geometryIds found for segmentationId ${segmentationId}`);
42
+ }
43
+ geometryIds.forEach((geometryId) => {
44
+ const geometry = cache.getGeometry(geometryId);
45
+ indices.add(geometry.data.getSegmentIndex());
46
+ });
47
+ return Array.from(indices.values()).sort();
48
+ }
49
+ else if (segmentation.type === SegmentationRepresentations.Surface) {
50
+ const geometryIds = segmentation.representationData.SURFACE?.geometryIds ?? [];
51
+ return Array.from(geometryIds.keys());
52
+ }
53
+ }
54
+ export { getUniqueSegmentIndices };
55
+ //# sourceMappingURL=getUniqueSegmentIndices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUniqueSegmentIndices.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/getUniqueSegmentIndices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,sDAAsD,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AASlG,SAAS,uBAAuB,CAAC,cAAc;IAC7C,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAErD,IAAI,YAAY,CAAC,IAAI,KAAK,2BAA2B,CAAC,QAAQ,EAAE;QAC9D,MAAM,YAAY,GAChB,YAAY,CAAC,kBAAkB,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;QAExE,MAAM,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QAEzB,IAAI,oBAAoB,CAAC,YAAY,CAAC,EAAE;YACtC,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;YAC/C,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;YAE1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC1C,MAAM,YAAY,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;gBACnC,IAAI,YAAY,KAAK,CAAC,EAAE;oBACtB,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;iBAC1B;aACF;SACF;aAAM;YACL,YAAY,CAAC,mBAAmB,CAAC,OAAO,CAAC,C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,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;KAC5C;SAAM,IAAI,YAAY,CAAC,IAAI,KAAK,2BAA2B,CAAC,OAAO,EAAE;QACpE,MAAM,WAAW,GACf,YAAY,CAAC,kBAAkB,CAAC,OAAO,EAAE,WAAW,IAAI,EAAE,CAAC;QAE7D,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;KACvC;AACH,CAAC;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
@@ -14,5 +14,9 @@ import contourAndFindLargestBidirectional from './contourAndFindLargestBidirecti
14
14
  import createBidirectionalToolData from './createBidirectionalToolData';
15
15
  import segmentContourAction from './segmentContourAction';
16
16
  import { invalidateBrushCursor } from './invalidateBrushCursor';
17
- export { thresholdVolumeByRange, createMergedLabelmapForIndex, isValidRepresentationConfig, getDefaultRepresentationConfig, createLabelmapVolumeForViewport, rectangleROIThresholdVolumeByRange, triggerSegmentationRender, floodFill, getBrushSizeForToolGroup, setBrushSizeForToolGroup, getBrushThresholdForToolGroup, setBrushThresholdForToolGroup, thresholdSegmentationByRange, createImageIdReferenceMap, contourAndFindLargestBidirectional, createBidirectionalToolData, segmentContourAction, invalidateBrushCursor, };
17
+ import { getUniqueSegmentIndices } from './getUniqueSegmentIndices';
18
+ import { getSegmentAtWorldPoint } from './getSegmentAtWorldPoint';
19
+ import { getSegmentAtLabelmapBorder } from './getSegmentAtLabelmapBorder';
20
+ import { getHoveredContourSegmentationAnnotation } from './getHoveredContourSegmentationAnnotation';
21
+ export { thresholdVolumeByRange, createMergedLabelmapForIndex, isValidRepresentationConfig, getDefaultRepresentationConfig, createLabelmapVolumeForViewport, rectangleROIThresholdVolumeByRange, triggerSegmentationRender, floodFill, getBrushSizeForToolGroup, setBrushSizeForToolGroup, getBrushThresholdForToolGroup, setBrushThresholdForToolGroup, thresholdSegmentationByRange, createImageIdReferenceMap, contourAndFindLargestBidirectional, createBidirectionalToolData, segmentContourAction, invalidateBrushCursor, getUniqueSegmentIndices, getSegmentAtWorldPoint, getSegmentAtLabelmapBorder, getHoveredContourSegmentationAnnotation, };
18
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,kCAAkC,MAAM,sCAAsC,CAAC;AACtF,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AACxE,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAC9E,OAAO,+BAA+B,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,kCAAkC,MAAM,sCAAsC,CAAC;AACtF,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AACxE,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,2BAA2B,EAC3B,8BAA8B,EAC9B,+BAA+B,EAC/B,kCAAkC,EAClC,yBAAyB,EACzB,SAAS,EACT,wBAAwB,EACxB,wBAAwB,EACxB,6BAA6B,EAC7B,6BAA6B,EAC7B,4BAA4B,EAC5B,yBAAyB,EACzB,kCAAkC,EAClC,2BAA2B,EAC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EACxB,6BAA6B,EAC7B,6BAA6B,EAC7B,4BAA4B,EAC5B,yBAAyB,EACzB,kCAAkC,EAClC,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,uCAAuC,GACxC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { getRenderingEngine } from '@cornerstonejs/core';
2
+ import triggerAnnotationRender from './triggerAnnotationRender';
3
+ import { getToolGroup } from '../store/ToolGroupManager';
4
+ export function triggerAnnotationRenderForToolGroupIds(toolGroupIds) {
5
+ toolGroupIds.forEach((toolGroupId) => {
6
+ const toolGroup = getToolGroup(toolGroupId);
7
+ if (!toolGroup) {
8
+ console.warn(`ToolGroup not available for ${toolGroupId}`);
9
+ return;
10
+ }
11
+ const viewportsInfo = toolGroup.getViewportsInfo();
12
+ viewportsInfo.forEach((viewportInfo) => {
13
+ const { renderingEngineId, viewportId } = viewportInfo;
14
+ const renderingEngine = getRenderingEngine(renderingEngineId);
15
+ if (!renderingEngine) {
16
+ console.warn(`RenderingEngine not available for ${renderingEngineId}`);
17
+ return;
18
+ }
19
+ const viewport = renderingEngine.getViewport(viewportId);
20
+ triggerAnnotationRender(viewport.element);
21
+ });
22
+ });
23
+ }
24
+ export default triggerAnnotationRenderForToolGroupIds;
25
+ //# sourceMappingURL=triggerAnnotationRenderForToolGroupIds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triggerAnnotationRenderForToolGroupIds.js","sourceRoot":"","sources":["../../../src/utilities/triggerAnnotationRenderForToolGroupIds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAc,MAAM,qBAAqB,CAAC;AACrE,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAOzD,MAAM,UAAU,sCAAsC,CACpD,YAAsB;IAEtB,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;QACnC,MAAM,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;QAE5C,IAAI,CAAC,SAAS,EAAE;YACd,OAAO,CAAC,IAAI,CAAC,+BAA+B,WAAW,EAAE,CAAC,CAAC;YAC3D,OAAO;SACR;QAED,MAAM,aAAa,GAAG,SAAS,CAAC,gBAAgB,EAAE,CAAC;QAEnD,aAAa,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;YACrC,MAAM,EAAE,iBAAiB,EAAE,UAAU,EAAE,GAAG,YAAY,CAAC;YAEvD,MAAM,eAAe,GAAG,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;YAC9D,IAAI,CAAC,eAAe,EAAE;gBACpB,OAAO,CAAC,IAAI,CAAC,qCAAqC,iBAAiB,EAAE,CAAC,CAAC;gBACvE,OAAO;aACR;YAED,MAAM,QAAQ,GAAG,eAAe,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;YACzD,uBAAuB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,eAAe,sCAAsC,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { expose } from 'comlink';
2
+ import vtkPlane from '@kitware/vtk.js/Common/DataModel/Plane';
3
+ import vtkClipClosedSurface from '@kitware/vtk.js/Filters/General/ClipClosedSurface';
4
+ import vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData';
5
+ const obj = {
6
+ clipSurfaceWithPlanes({ planesInfo, pointsAndPolys }, progressCallback, updateCacheCallback) {
7
+ const numberOfPlanes = planesInfo.length;
8
+ const clippingFilter = vtkClipClosedSurface.newInstance({
9
+ clippingPlanes: [],
10
+ activePlaneId: 2,
11
+ passPointData: false,
12
+ });
13
+ clippingFilter.setGenerateOutline(true);
14
+ clippingFilter.setGenerateFaces(false);
15
+ const plane1 = vtkPlane.newInstance();
16
+ const plane2 = vtkPlane.newInstance();
17
+ try {
18
+ for (const [index, planeInfo] of planesInfo.entries()) {
19
+ const { sliceIndex, planes } = planeInfo;
20
+ const polyDataResults = new Map();
21
+ for (const polyDataInfo of pointsAndPolys) {
22
+ const { points, polys, id } = polyDataInfo;
23
+ const surfacePolyData = vtkPolyData.newInstance();
24
+ surfacePolyData.getPoints().setData(points, 3);
25
+ surfacePolyData.getPolys().setData(polys, 3);
26
+ clippingFilter.setInputData(surfacePolyData);
27
+ const clippingPlanes = [plane1, plane2];
28
+ plane1.setOrigin(planes[0].origin);
29
+ plane1.setNormal(planes[0].normal);
30
+ plane2.setOrigin(planes[1].origin);
31
+ plane2.setNormal(planes[1].normal);
32
+ clippingFilter.setClippingPlanes(clippingPlanes);
33
+ clippingFilter.update();
34
+ const polyData = clippingFilter.getOutputData();
35
+ if (polyData) {
36
+ polyDataResults.set(id, {
37
+ points: polyData.getPoints().getData(),
38
+ lines: polyData.getLines().getData(),
39
+ });
40
+ }
41
+ }
42
+ progressCallback({ progress: (index + 1) / numberOfPlanes });
43
+ updateCacheCallback({ sliceIndex, polyDataResults });
44
+ }
45
+ }
46
+ catch (e) {
47
+ console.error('Error during processing', e);
48
+ }
49
+ finally {
50
+ pointsAndPolys = null;
51
+ clippingFilter.delete();
52
+ plane1.delete();
53
+ plane2.delete();
54
+ }
55
+ },
56
+ };
57
+ expose(obj);
58
+ //# sourceMappingURL=clippingPlaneWorker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clippingPlaneWorker.js","sourceRoot":"","sources":["../../../src/workers/clippingPlaneWorker.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,QAAQ,MAAM,wCAAwC,CAAC;AAC9D,OAAO,oBAAoB,MAAM,mDAAmD,CAAC;AACrF,OAAO,WAAW,MAAM,2CAA2C,CAAC;AAEpE,MAAM,GAAG,GAAG;IAYV,qBAAqB,CACnB,EAAE,UAAU,EAAE,cAAc,EAAE,EAC9B,gBAAgB,EAChB,mBAAmB;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