@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,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSegmentAtWorldForContour = exports.getSegmentAtWorldForLabelmap = exports.getSegmentAtWorldPoint = void 0;
4
+ const core_1 = require("@cornerstonejs/core");
5
+ const enums_1 = require("../../enums");
6
+ const segmentationState_1 = require("../../stateManagement/segmentation/segmentationState");
7
+ const stackVolumeCheck_1 = require("../../tools/segmentation/strategies/utils/stackVolumeCheck");
8
+ const stateManagement_1 = require("../../stateManagement");
9
+ const polyline_1 = require("../math/polyline");
10
+ function getSegmentAtWorldPoint(segmentationId, worldPoint, options = {}) {
11
+ var _a;
12
+ const segmentation = (0, segmentationState_1.getSegmentation)(segmentationId);
13
+ const representationData = segmentation.representationData;
14
+ const desiredRepresentation = (_a = options === null || options === void 0 ? void 0 : options.representationType) !== null && _a !== void 0 ? _a : Object.keys(representationData)[0];
15
+ if (!desiredRepresentation) {
16
+ throw new Error(`Segmentation ${segmentationId} does not have any representations`);
17
+ }
18
+ switch (desiredRepresentation) {
19
+ case enums_1.SegmentationRepresentations.Labelmap:
20
+ return getSegmentAtWorldForLabelmap(segmentation, worldPoint, options);
21
+ case enums_1.SegmentationRepresentations.Contour:
22
+ return getSegmentAtWorldForContour(segmentation, worldPoint, options);
23
+ default:
24
+ return;
25
+ }
26
+ }
27
+ exports.getSegmentAtWorldPoint = getSegmentAtWorldPoint;
28
+ function getSegmentAtWorldForLabelmap(segmentation, worldPoint, { viewport }) {
29
+ const labelmapData = segmentation.representationData.LABELMAP;
30
+ if ((0, stackVolumeCheck_1.isVolumeSegmentation)(labelmapData)) {
31
+ const { volumeId } = labelmapData;
32
+ const segmentationVolume = core_1.cache.getVolume(volumeId);
33
+ if (!segmentationVolume) {
34
+ return;
35
+ }
36
+ const segmentIndex = segmentationVolume.imageData.getScalarValueFromWorld(worldPoint);
37
+ return segmentIndex;
38
+ }
39
+ const { imageIdReferenceMap } = labelmapData;
40
+ const currentImageId = viewport.getCurrentImageId();
41
+ const segmentationImageId = imageIdReferenceMap.get(currentImageId);
42
+ const image = core_1.cache.getImage(segmentationImageId);
43
+ if (!image) {
44
+ return;
45
+ }
46
+ const segmentationRepresentations = (0, segmentationState_1.getSegmentationIdRepresentations)(segmentation.segmentationId);
47
+ const { segmentationRepresentationUID } = segmentationRepresentations[0];
48
+ const segmentationActor = viewport.getActor(segmentationRepresentationUID);
49
+ const imageData = segmentationActor === null || segmentationActor === void 0 ? void 0 : segmentationActor.actor.getMapper().getInputData();
50
+ const indexIJK = core_1.utilities.transformWorldToIndex(imageData, worldPoint);
51
+ const dimensions = imageData.getDimensions();
52
+ const voxelManager = core_1.utilities.VoxelManager.createVolumeVoxelManager(dimensions, imageData.getPointData().getScalars().getData());
53
+ const segmentIndex = voxelManager.getAtIJK(...indexIJK);
54
+ return segmentIndex;
55
+ }
56
+ exports.getSegmentAtWorldForLabelmap = getSegmentAtWorldForLabelmap;
57
+ function getSegmentAtWorldForContour(segmentation, worldPoint, { viewport }) {
58
+ const contourData = segmentation.representationData.CONTOUR;
59
+ const segmentIndices = Array.from(contourData.annotationUIDsMap.keys());
60
+ const { viewPlaneNormal } = viewport.getCamera();
61
+ for (const segmentIndex of segmentIndices) {
62
+ const annotationsSet = contourData.annotationUIDsMap.get(segmentIndex);
63
+ if (!annotationsSet) {
64
+ continue;
65
+ }
66
+ for (const annotationUID of annotationsSet) {
67
+ const annotation = (0, stateManagement_1.getAnnotation)(annotationUID);
68
+ if (!annotation) {
69
+ continue;
70
+ }
71
+ const { polyline } = annotation.data.contour;
72
+ if (!core_1.utilities.isEqual(viewPlaneNormal, annotation.metadata.viewPlaneNormal)) {
73
+ continue;
74
+ }
75
+ if ((0, polyline_1.isPointInsidePolyline3D)(worldPoint, polyline)) {
76
+ return Number(segmentIndex);
77
+ }
78
+ }
79
+ }
80
+ }
81
+ exports.getSegmentAtWorldForContour = getSegmentAtWorldForContour;
82
+ //# sourceMappingURL=getSegmentAtWorldPoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSegmentAtWorldPoint.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/getSegmentAtWorld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,kBAAkB,CAAC,OAAO,CAAC;IAE5D,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC;IACxE,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;IAEjD,KAAK,MAAM,YAAY,IAAI,cAAc,EAAE;QACzC,MAAM,cAAc,GAAG,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAEvE,IAAI,CAAC,cAAc,EAAE;YACnB,SAAS;SACV;QAED,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE;YAC1C,MAAM,UAAU,GAAG,IAAA,+BAAa,EAC9B,aAAa,CACmB,CAAC;YAEnC,IAAI,CAAC,UAAU,EAAE;gBACf,SAAS;aACV;YAED,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC;YAE7C,IACE,CAAC,gBAAS,CAAC,OAAO,CAAC,eAAe,EAAE,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC,EACxE;gBACA,SAAS;aACV;YAKD,IAAI,IAAA,kCAAuB,EAAC,UAAU,EAAE,QAAQ,CAAC,EAAE;gBACjD,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC;aAC7B;SACF;KACF;AACH,CAAC;AA1CD,kEA0CC"}
@@ -0,0 +1,2 @@
1
+ declare function getUniqueSegmentIndices(segmentationId: any): number[];
2
+ export { getUniqueSegmentIndices };
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getUniqueSegmentIndices = void 0;
4
+ const core_1 = require("@cornerstonejs/core");
5
+ const enums_1 = require("../../enums");
6
+ const segmentationState_1 = require("../../stateManagement/segmentation/segmentationState");
7
+ const stackVolumeCheck_1 = require("../../tools/segmentation/strategies/utils/stackVolumeCheck");
8
+ function getUniqueSegmentIndices(segmentationId) {
9
+ var _a, _b, _c, _d;
10
+ const segmentation = (0, segmentationState_1.getSegmentation)(segmentationId);
11
+ if (segmentation.type === enums_1.SegmentationRepresentations.Labelmap) {
12
+ const labelmapData = segmentation.representationData[enums_1.SegmentationRepresentations.Labelmap];
13
+ const keySet = new Set();
14
+ if ((0, stackVolumeCheck_1.isVolumeSegmentation)(labelmapData)) {
15
+ const volume = core_1.cache.getVolume(segmentationId);
16
+ const scalarData = volume.getScalarData();
17
+ for (let i = 0; i < scalarData.length; i++) {
18
+ const segmentIndex = scalarData[i];
19
+ if (segmentIndex !== 0) {
20
+ keySet.add(segmentIndex);
21
+ }
22
+ }
23
+ }
24
+ else {
25
+ labelmapData.imageIdReferenceMap.forEach((segmentationImageId) => {
26
+ const image = core_1.cache.getImage(segmentationImageId);
27
+ const scalarData = image.getPixelData();
28
+ for (let i = 0; i < scalarData.length; i++) {
29
+ const segmentIndex = scalarData[i];
30
+ if (segmentIndex !== 0) {
31
+ keySet.add(segmentIndex);
32
+ }
33
+ }
34
+ });
35
+ }
36
+ return Array.from(keySet)
37
+ .map((it) => parseInt(it))
38
+ .sort();
39
+ }
40
+ else if (segmentation.type === enums_1.SegmentationRepresentations.Contour) {
41
+ const annotationUIDsMap = (_a = segmentation.representationData.CONTOUR) === null || _a === void 0 ? void 0 : _a.annotationUIDsMap;
42
+ const indices = new Set(annotationUIDsMap.keys());
43
+ const geometryIds = (_b = segmentation.representationData.CONTOUR) === null || _b === void 0 ? void 0 : _b.geometryIds;
44
+ if (!geometryIds) {
45
+ throw new Error(`No geometryIds found for segmentationId ${segmentationId}`);
46
+ }
47
+ geometryIds.forEach((geometryId) => {
48
+ const geometry = core_1.cache.getGeometry(geometryId);
49
+ indices.add(geometry.data.getSegmentIndex());
50
+ });
51
+ return Array.from(indices.values()).sort();
52
+ }
53
+ else if (segmentation.type === enums_1.SegmentationRepresentations.Surface) {
54
+ const geometryIds = (_d = (_c = segmentation.representationData.SURFACE) === null || _c === void 0 ? void 0 : _c.geometryIds) !== null && _d !== void 0 ? _d : [];
55
+ return Array.from(geometryIds.keys());
56
+ }
57
+ }
58
+ exports.getUniqueSegmentIndices = getUniqueSegmentIndices;
59
+ //# sourceMappingURL=getUniqueSegmentIndices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUniqueSegmentIndices.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/getUniqueSegmentIndices.ts"],"names":[],"mappings":";;;AAAA,8CAAmD;AACnD,uCAA0D;AAC1D,4FAAuF;AACvF,iGAAkG;AASlG,SAAS,uBAAuB,CAAC,cAAc;;IAC7C,MAAM,YAAY,GAAG,IAAA,mCAAe,EAAC,cAAc,CAAC,CAAC;IAErD,IAAI,YAAY,CAAC,IAAI,KAAK,mCAA2B,CAAC,QAAQ,EAAE;QAC9D,MAAM,YAAY,GAChB,YAAY,CAAC,kBAAkB,CAAC,mCAA2B,CAAC,QAAQ,CAAC,CAAC;QAExE,MAAM,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QAEzB,IAAI,IAAA,uCAAoB,EAAC,YAAY,CAAC,EAAE;YACtC,MAAM,MAAM,GAAG,YAAK,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,CAAC,mBAAmB,EAAE,EAAE;gBAC/D,MAAM,KAAK,GAAG,YAAK,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;gBAClD,MAAM,UAAU,GAAG,KAAK,CAAC,YAAY,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AAC,OAAO,EAAE;QACpE,MAAM,WAAW,GACf,MAAA,MAAA,YAAY,CAAC,kBAAkB,CAAC,OAAO,0CAAE,WAAW,mCAAI,EAAE,CAAC;QAE7D,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;KACvC;AACH,CAAC;AAEQ,0DAAuB"}
@@ -14,4 +14,8 @@ 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, };
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.invalidateBrushCursor = exports.segmentContourAction = exports.createBidirectionalToolData = exports.contourAndFindLargestBidirectional = exports.createImageIdReferenceMap = exports.thresholdSegmentationByRange = exports.setBrushThresholdForToolGroup = exports.getBrushThresholdForToolGroup = exports.setBrushSizeForToolGroup = exports.getBrushSizeForToolGroup = exports.floodFill = exports.triggerSegmentationRender = exports.rectangleROIThresholdVolumeByRange = exports.createLabelmapVolumeForViewport = exports.getDefaultRepresentationConfig = exports.isValidRepresentationConfig = exports.createMergedLabelmapForIndex = exports.thresholdVolumeByRange = void 0;
6
+ exports.getHoveredContourSegmentationAnnotation = exports.getSegmentAtLabelmapBorder = exports.getSegmentAtWorldPoint = exports.getUniqueSegmentIndices = exports.invalidateBrushCursor = exports.segmentContourAction = exports.createBidirectionalToolData = exports.contourAndFindLargestBidirectional = exports.createImageIdReferenceMap = exports.thresholdSegmentationByRange = exports.setBrushThresholdForToolGroup = exports.getBrushThresholdForToolGroup = exports.setBrushSizeForToolGroup = exports.getBrushSizeForToolGroup = exports.floodFill = exports.triggerSegmentationRender = exports.rectangleROIThresholdVolumeByRange = exports.createLabelmapVolumeForViewport = exports.getDefaultRepresentationConfig = exports.isValidRepresentationConfig = exports.createMergedLabelmapForIndex = exports.thresholdVolumeByRange = void 0;
7
7
  const thresholdVolumeByRange_1 = __importDefault(require("./thresholdVolumeByRange"));
8
8
  exports.thresholdVolumeByRange = thresholdVolumeByRange_1.default;
9
9
  const rectangleROIThresholdVolumeByRange_1 = __importDefault(require("./rectangleROIThresholdVolumeByRange"));
@@ -38,4 +38,12 @@ const segmentContourAction_1 = __importDefault(require("./segmentContourAction")
38
38
  exports.segmentContourAction = segmentContourAction_1.default;
39
39
  const invalidateBrushCursor_1 = require("./invalidateBrushCursor");
40
40
  Object.defineProperty(exports, "invalidateBrushCursor", { enumerable: true, get: function () { return invalidateBrushCursor_1.invalidateBrushCursor; } });
41
+ const getUniqueSegmentIndices_1 = require("./getUniqueSegmentIndices");
42
+ Object.defineProperty(exports, "getUniqueSegmentIndices", { enumerable: true, get: function () { return getUniqueSegmentIndices_1.getUniqueSegmentIndices; } });
43
+ const getSegmentAtWorldPoint_1 = require("./getSegmentAtWorldPoint");
44
+ Object.defineProperty(exports, "getSegmentAtWorldPoint", { enumerable: true, get: function () { return getSegmentAtWorldPoint_1.getSegmentAtWorldPoint; } });
45
+ const getSegmentAtLabelmapBorder_1 = require("./getSegmentAtLabelmapBorder");
46
+ Object.defineProperty(exports, "getSegmentAtLabelmapBorder", { enumerable: true, get: function () { return getSegmentAtLabelmapBorder_1.getSegmentAtLabelmapBorder; } });
47
+ const getHoveredContourSegmentationAnnotation_1 = require("./getHoveredContourSegmentationAnnotation");
48
+ Object.defineProperty(exports, "getHoveredContourSegmentationAnnotation", { enumerable: true, get: function () { return getHoveredContourSegmentationAnnotation_1.getHoveredContourSegmentationAnnotation; } });
41
49
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/index.ts"],"names":[],"mappings":";;;;;;AAAA,sFAA8D;AAwB5D,iCAxBK,gCAAsB,CAwBL;AAvBxB,8GAAsF;AA4BpF,6CA5BK,4CAAkC,CA4BL;AA3BpC,kGAA0E;AAuBxE,uCAvBK,sCAA4B,CAuBL;AAtB9B,gGAAwE;AAuBtE,sCAvBK,qCAA2B,CAuBL;AAtB7B,sGAA8E;AAuB5E,yCAvBK,wCAA8B,CAuBL;AAtBhC,wGAAgF;AAuB9E,0CAvBK,yCAA+B,CAuBL;AAtBjC,2EAAwE;AAwBtE,0GAxBO,qDAAyB,OAwBP;AAvB3B,4DAAoC;AAwBlC,oBAxBK,mBAAS,CAwBL;AAvBX,mEAGiC;AAqB/B,yGAvBA,gDAAwB,OAuBA;AACxB,yGAvBA,gD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xD,+BAxBK,8BAAoB,CAwBL;AAvBtB,mEAAgE;AAwB9D,sGAxBO,6CAAqB,OAwBP;AAvBvB,uEAAoE;AAwBlE,wGAxBO,iDAAuB,OAwBP;AAvBzB,qEAAkE;AAwBhE,uGAxBO,+CAAsB,OAwBP;AAvBxB,6EAA0E;AAwBxE,2GAxBO,uDAA0B,OAwBP;AAvB5B,uGAAoG;AAwBlG,wHAxBO,iFAAuC,OAwBP"}
@@ -0,0 +1,2 @@
1
+ export declare function triggerAnnotationRenderForToolGroupIds(toolGroupIds: string[]): void;
2
+ export default triggerAnnotationRenderForToolGroupIds;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.triggerAnnotationRenderForToolGroupIds = void 0;
7
+ const core_1 = require("@cornerstonejs/core");
8
+ const triggerAnnotationRender_1 = __importDefault(require("./triggerAnnotationRender"));
9
+ const ToolGroupManager_1 = require("../store/ToolGroupManager");
10
+ function triggerAnnotationRenderForToolGroupIds(toolGroupIds) {
11
+ toolGroupIds.forEach((toolGroupId) => {
12
+ const toolGroup = (0, ToolGroupManager_1.getToolGroup)(toolGroupId);
13
+ if (!toolGroup) {
14
+ console.warn(`ToolGroup not available for ${toolGroupId}`);
15
+ return;
16
+ }
17
+ const viewportsInfo = toolGroup.getViewportsInfo();
18
+ viewportsInfo.forEach((viewportInfo) => {
19
+ const { renderingEngineId, viewportId } = viewportInfo;
20
+ const renderingEngine = (0, core_1.getRenderingEngine)(renderingEngineId);
21
+ if (!renderingEngine) {
22
+ console.warn(`RenderingEngine not available for ${renderingEngineId}`);
23
+ return;
24
+ }
25
+ const viewport = renderingEngine.getViewport(viewportId);
26
+ (0, triggerAnnotationRender_1.default)(viewport.element);
27
+ });
28
+ });
29
+ }
30
+ exports.triggerAnnotationRenderForToolGroupIds = triggerAnnotationRenderForToolGroupIds;
31
+ exports.default = triggerAnnotationRenderForToolGroupIds;
32
+ //# sourceMappingURL=triggerAnnotationRenderForToolGroupIds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triggerAnnotationRenderForToolGroupIds.js","sourceRoot":"","sources":["../../../src/utilities/triggerAnnotationRenderForToolGroupIds.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqE;AACrE,wFAAgE;AAChE,gEAAyD;AAOzD,SAAgB,sCAAsC,CACpD,YAAsB;IAEtB,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;QACnC,MAAM,SAAS,GAAG,IAAA,+BAAY,EAAC,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,IAAA,yBAAkB,EAAC,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,IAAA,iCAAuB,EAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AA1BD,wFA0BC;AAED,kBAAe,sCAAsC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const comlink_1 = require("comlink");
7
+ const Plane_1 = __importDefault(require("@kitware/vtk.js/Common/DataModel/Plane"));
8
+ const ClipClosedSurface_1 = __importDefault(require("@kitware/vtk.js/Filters/General/ClipClosedSurface"));
9
+ const PolyData_1 = __importDefault(require("@kitware/vtk.js/Common/DataModel/PolyData"));
10
+ const obj = {
11
+ clipSurfaceWithPlanes({ planesInfo, pointsAndPolys }, progressCallback, updateCacheCallback) {
12
+ const numberOfPlanes = planesInfo.length;
13
+ const clippingFilter = ClipClosedSurface_1.default.newInstance({
14
+ clippingPlanes: [],
15
+ activePlaneId: 2,
16
+ passPointData: false,
17
+ });
18
+ clippingFilter.setGenerateOutline(true);
19
+ clippingFilter.setGenerateFaces(false);
20
+ const plane1 = Plane_1.default.newInstance();
21
+ const plane2 = Plane_1.default.newInstance();
22
+ try {
23
+ for (const [index, planeInfo] of planesInfo.entries()) {
24
+ const { sliceIndex, planes } = planeInfo;
25
+ const polyDataResults = new Map();
26
+ for (const polyDataInfo of pointsAndPolys) {
27
+ const { points, polys, id } = polyDataInfo;
28
+ const surfacePolyData = PolyData_1.default.newInstance();
29
+ surfacePolyData.getPoints().setData(points, 3);
30
+ surfacePolyData.getPolys().setData(polys, 3);
31
+ clippingFilter.setInputData(surfacePolyData);
32
+ const clippingPlanes = [plane1, plane2];
33
+ plane1.setOrigin(planes[0].origin);
34
+ plane1.setNormal(planes[0].normal);
35
+ plane2.setOrigin(planes[1].origin);
36
+ plane2.setNormal(planes[1].normal);
37
+ clippingFilter.setClippingPlanes(clippingPlanes);
38
+ clippingFilter.update();
39
+ const polyData = clippingFilter.getOutputData();
40
+ if (polyData) {
41
+ polyDataResults.set(id, {
42
+ points: polyData.getPoints().getData(),
43
+ lines: polyData.getLines().getData(),
44
+ });
45
+ }
46
+ }
47
+ progressCallback({ progress: (index + 1) / numberOfPlanes });
48
+ updateCacheCallback({ sliceIndex, polyDataResults });
49
+ }
50
+ }
51
+ catch (e) {
52
+ console.error('Error during processing', e);
53
+ }
54
+ finally {
55
+ pointsAndPolys = null;
56
+ clippingFilter.delete();
57
+ plane1.delete();
58
+ plane2.delete();
59
+ }
60
+ },
61
+ };
62
+ (0, comlink_1.expose)(obj);
63
+ //# sourceMappingURL=clippingPlaneWorker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clippingPlaneWorker.js","sourceRoot":"","sources":["../../../src/workers/clippingPlaneWorker.js"],"names":[],"mappings":";;;;;AAAA,qCAAiC;AACjC,mFAA8D;AAC9D,0GAAqF;AACrF,yFAAoE;AAEpE,MAAM,GAAG,GAAG;IAYV,qBAAqB,CACnB,EAAE,UAAU,EAAE,cAAc,EAAE,EAC9B,gBAAgB,EAChB,mBAAmB;QAEnB,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;QACzC,MAAM,cAAc,GAAG,2BAAoB,CAAC,WAAW,CAAC;YACtD,cAAc,EAAE,EAAE;YAClB,aAAa,EAAE,CAAC;YAChB,aAAa,EAAE,KAAK;SACrB,CAAC,CAAC;QACH,cAAc,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACxC,cAAc,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAEvC,MAAM,MAAM,GAAG,eAAQ,CAAC,WAAW,EAAE,CAAC;QACtC,MAAM,MAAM,GAAG,eAAQ,CAAC,WAAW,EAAE,CAAC;QAEtC,IAAI;YACF,KAAK,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,UAAU,CAAC,OAAO,EAAE,EAAE;gBACrD,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;gBAEzC,MAAM,eAAe,GAAG,IAAI,GAAG,EAAE,CAAC;gBAClC,KAAK,MAAM,YAAY,IAAI,cAAc,EAAE;oBACzC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,YAAY,CAAC;oBAE3C,MA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,KAAK,CAAC,yBAAyB,EAAE,CAAC,CAAC,CAAC;SAC7C;gBAAS;YAER,cAAc,GAAG,IAAI,CAAC;YACtB,cAAc,CAAC,MAAM,EAAE,CAAC;YACxB,MAAM,CAAC,MAAM,EAAE,CAAC;YAChB,MAAM,CAAC,MAAM,EAAE,CAAC;SACjB;IACH,CAAC;CACF,CAAC;AAEF,IAAA,gBAAM,EAAC,GAAG,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,267 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const comlink_1 = require("comlink");
16
+ const ImageData_1 = __importDefault(require("@kitware/vtk.js/Common/DataModel/ImageData"));
17
+ const DataArray_1 = __importDefault(require("@kitware/vtk.js/Common/Core/DataArray"));
18
+ const polyseg_wasm_1 = __importDefault(require("@icr/polyseg-wasm"));
19
+ const core_1 = require("@cornerstonejs/core");
20
+ const boundingBox_1 = require("../utilities/boundingBox");
21
+ const utilities_1 = require("../utilities");
22
+ const polyline_1 = require("../utilities/math/polyline");
23
+ const polySegConverters = {
24
+ polySeg: null,
25
+ polySegInitializing: false,
26
+ polySegInitializingPromise: null,
27
+ initializePolySeg(progressCallback) {
28
+ var _a;
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ if (this.polySegInitializing) {
31
+ yield this.polySegInitializingPromise;
32
+ return;
33
+ }
34
+ if ((_a = this.polySeg) === null || _a === void 0 ? void 0 : _a.instance) {
35
+ return;
36
+ }
37
+ this.polySegInitializing = true;
38
+ this.polySegInitializingPromise = new Promise((resolve) => {
39
+ this.polySeg = new polyseg_wasm_1.default();
40
+ this.polySeg
41
+ .initialize({
42
+ updateProgress: progressCallback,
43
+ })
44
+ .then(() => {
45
+ this.polySegInitializing = false;
46
+ resolve();
47
+ });
48
+ });
49
+ yield this.polySegInitializingPromise;
50
+ });
51
+ },
52
+ convertContourToSurface(args, ...callbacks) {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ const { polylines, numPointsArray } = args;
55
+ const [progressCallback] = callbacks;
56
+ yield this.initializePolySeg(progressCallback);
57
+ const results = yield this.polySeg.instance.convertContourRoiToSurface(polylines, numPointsArray);
58
+ return results;
59
+ });
60
+ },
61
+ convertLabelmapToSurface(args, ...callbacks) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const [progressCallback] = callbacks;
64
+ yield this.initializePolySeg(progressCallback);
65
+ const results = this.polySeg.instance.convertLabelmapToSurface(args.scalarData, args.dimensions, args.spacing, args.direction, args.origin, [args.segmentIndex]);
66
+ return results;
67
+ });
68
+ },
69
+ convertContourToVolumeLabelmap(args, ...callbacks) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ const [progressCallback] = callbacks;
72
+ const polySeg = yield new polyseg_wasm_1.default();
73
+ yield polySeg.initialize({
74
+ updateProgress: progressCallback,
75
+ });
76
+ const { segmentIndices, scalarData, annotationUIDsInSegmentMap, dimensions, origin, direction, spacing, } = args;
77
+ const segmentationVoxelManager = core_1.utilities.VoxelManager.createVolumeVoxelManager(dimensions, scalarData);
78
+ const imageData = ImageData_1.default.newInstance();
79
+ imageData.setDimensions(dimensions);
80
+ imageData.setOrigin(origin);
81
+ imageData.setDirection(direction);
82
+ imageData.setSpacing(spacing);
83
+ const scalarArray = DataArray_1.default.newInstance({
84
+ name: 'Pixels',
85
+ numberOfComponents: 1,
86
+ values: scalarData,
87
+ });
88
+ imageData.getPointData().setScalars(scalarArray);
89
+ imageData.modified();
90
+ for (const index of segmentIndices) {
91
+ const annotations = annotationUIDsInSegmentMap.get(index);
92
+ for (const annotation of annotations) {
93
+ const bounds = (0, boundingBox_1.getBoundingBoxAroundShapeWorld)(annotation.data.contour.polyline);
94
+ const [iMin, jMin, kMin] = core_1.utilities.transformWorldToIndex(imageData, [
95
+ bounds[0][0],
96
+ bounds[1][0],
97
+ bounds[2][0],
98
+ ]);
99
+ const [iMax, jMax, kMax] = core_1.utilities.transformWorldToIndex(imageData, [
100
+ bounds[0][1],
101
+ bounds[1][1],
102
+ bounds[2][1],
103
+ ]);
104
+ (0, utilities_1.pointInShapeCallback)(imageData, (pointLPS) => {
105
+ return (0, polyline_1.isPointInsidePolyline3D)(pointLPS, annotation.data.contour.polyline);
106
+ }, ({ pointIJK }) => {
107
+ segmentationVoxelManager.setAtIJKPoint(pointIJK, index);
108
+ }, [
109
+ [iMin, iMax],
110
+ [jMin, jMax],
111
+ [kMin, kMax],
112
+ ]);
113
+ }
114
+ }
115
+ return segmentationVoxelManager.scalarData;
116
+ });
117
+ },
118
+ convertContourToStackLabelmap(args, ...callbacks) {
119
+ return __awaiter(this, void 0, void 0, function* () {
120
+ const [progressCallback] = callbacks;
121
+ const polySeg = yield new polyseg_wasm_1.default();
122
+ yield polySeg.initialize({
123
+ updateProgress: progressCallback,
124
+ });
125
+ const { segmentationsInfo, annotationUIDsInSegmentMap, segmentIndices } = args;
126
+ const segmentationVoxelManagers = new Map();
127
+ segmentationsInfo.forEach((segmentationInfo, referencedImageId) => {
128
+ const { dimensions, scalarData, direction, spacing, origin } = segmentationInfo;
129
+ const manager = core_1.utilities.VoxelManager.createVolumeVoxelManager(dimensions, scalarData);
130
+ const imageData = ImageData_1.default.newInstance();
131
+ imageData.setDimensions(dimensions);
132
+ imageData.setOrigin(origin);
133
+ imageData.setDirection(direction);
134
+ imageData.setSpacing(spacing);
135
+ const scalarArray = DataArray_1.default.newInstance({
136
+ name: 'Pixels',
137
+ numberOfComponents: 1,
138
+ values: scalarData,
139
+ });
140
+ imageData.getPointData().setScalars(scalarArray);
141
+ imageData.modified();
142
+ segmentationVoxelManagers.set(referencedImageId, { manager, imageData });
143
+ });
144
+ for (const index of segmentIndices) {
145
+ const annotations = annotationUIDsInSegmentMap.get(index);
146
+ for (const annotation of annotations) {
147
+ if (!(annotation === null || annotation === void 0 ? void 0 : annotation.data)) {
148
+ continue;
149
+ }
150
+ const bounds = (0, boundingBox_1.getBoundingBoxAroundShapeWorld)(annotation.data.contour.polyline);
151
+ const { referencedImageId } = annotation.metadata;
152
+ const { manager: segmentationVoxelManager, imageData } = segmentationVoxelManagers.get(referencedImageId);
153
+ const [iMin, jMin, kMin] = core_1.utilities.transformWorldToIndex(imageData, [
154
+ bounds[0][0],
155
+ bounds[1][0],
156
+ bounds[2][0],
157
+ ]);
158
+ const [iMax, jMax, kMax] = core_1.utilities.transformWorldToIndex(imageData, [
159
+ bounds[0][1],
160
+ bounds[1][1],
161
+ bounds[2][1],
162
+ ]);
163
+ (0, utilities_1.pointInShapeCallback)(imageData, (pointLPS) => {
164
+ return (0, polyline_1.isPointInsidePolyline3D)(pointLPS, annotation.data.contour.polyline);
165
+ }, ({ pointIJK }) => {
166
+ segmentationVoxelManager.setAtIJKPoint(pointIJK, index);
167
+ }, [
168
+ [iMin, iMax],
169
+ [jMin, jMax],
170
+ [kMin, kMax],
171
+ ]);
172
+ }
173
+ }
174
+ segmentationsInfo.forEach((segmentationInfo, referencedImageId) => {
175
+ const { manager: segmentationVoxelManager } = segmentationVoxelManagers.get(referencedImageId);
176
+ segmentationInfo.scalarData = segmentationVoxelManager.scalarData;
177
+ });
178
+ return segmentationsInfo;
179
+ });
180
+ },
181
+ convertSurfaceToVolumeLabelmap(args, ...callbacks) {
182
+ return __awaiter(this, void 0, void 0, function* () {
183
+ const [progressCallback] = callbacks;
184
+ yield this.initializePolySeg(progressCallback);
185
+ const results = this.polySeg.instance.convertSurfaceToLabelmap(args.points, args.polys, args.dimensions, args.spacing, args.direction, args.origin);
186
+ return results;
187
+ });
188
+ },
189
+ convertSurfacesToVolumeLabelmap(args, ...callbacks) {
190
+ return __awaiter(this, void 0, void 0, function* () {
191
+ const [progressCallback] = callbacks;
192
+ yield this.initializePolySeg(progressCallback);
193
+ const { segmentsInfo } = args;
194
+ const promises = Array.from(segmentsInfo.keys()).map((segmentIndex) => {
195
+ const { points, polys } = segmentsInfo.get(segmentIndex);
196
+ const result = this.polySeg.instance.convertSurfaceToLabelmap(points, polys, args.dimensions, args.spacing, args.direction, args.origin);
197
+ return Object.assign(Object.assign({}, result), { segmentIndex });
198
+ });
199
+ const results = yield Promise.all(promises);
200
+ const targetImageData = ImageData_1.default.newInstance();
201
+ targetImageData.setDimensions(args.dimensions);
202
+ targetImageData.setOrigin(args.origin);
203
+ targetImageData.setSpacing(args.spacing);
204
+ targetImageData.setDirection(args.direction);
205
+ const totalSize = args.dimensions[0] * args.dimensions[1] * args.dimensions[2];
206
+ const scalarArray = DataArray_1.default.newInstance({
207
+ name: 'Pixels',
208
+ numberOfComponents: 1,
209
+ values: new Uint8Array(totalSize),
210
+ });
211
+ targetImageData.getPointData().setScalars(scalarArray);
212
+ targetImageData.modified();
213
+ const segmentationVoxelManager = core_1.utilities.VoxelManager.createVolumeVoxelManager(args.dimensions, targetImageData.getPointData().getScalars().getData());
214
+ const outputVolumesInfo = results.map((result) => {
215
+ const { data, dimensions, direction, origin, spacing } = result;
216
+ const volume = ImageData_1.default.newInstance();
217
+ volume.setDimensions(dimensions);
218
+ volume.setOrigin(origin);
219
+ volume.setSpacing(spacing);
220
+ volume.setDirection(direction);
221
+ const scalarArray = DataArray_1.default.newInstance({
222
+ name: 'Pixels',
223
+ numberOfComponents: 1,
224
+ values: data,
225
+ });
226
+ volume.getPointData().setScalars(scalarArray);
227
+ volume.modified();
228
+ const voxelManager = core_1.utilities.VoxelManager.createVolumeVoxelManager(dimensions, data);
229
+ const extent = volume.getExtent();
230
+ return {
231
+ volume,
232
+ voxelManager,
233
+ extent,
234
+ scalarData: data,
235
+ segmentIndex: result.segmentIndex,
236
+ };
237
+ });
238
+ (0, utilities_1.pointInShapeCallback)(targetImageData, () => true, ({ pointIJK, pointLPS }) => {
239
+ try {
240
+ for (const volumeInfo of outputVolumesInfo) {
241
+ const { volume, extent, voxelManager, segmentIndex } = volumeInfo;
242
+ const index = volume.worldToIndex(pointLPS);
243
+ if (index[0] < extent[0] ||
244
+ index[0] > extent[1] ||
245
+ index[1] < extent[2] ||
246
+ index[1] > extent[3] ||
247
+ index[2] < extent[4] ||
248
+ index[2] > extent[5]) {
249
+ continue;
250
+ }
251
+ const roundedIndex = index.map(Math.round);
252
+ const value = voxelManager.getAtIJK(...roundedIndex);
253
+ if (value > 0) {
254
+ segmentationVoxelManager.setAtIJKPoint(pointIJK, segmentIndex);
255
+ break;
256
+ }
257
+ }
258
+ }
259
+ catch (error) {
260
+ }
261
+ });
262
+ return segmentationVoxelManager.scalarData;
263
+ });
264
+ },
265
+ };
266
+ (0, comlink_1.expose)(polySegConverters);
267
+ //# sourceMappingURL=polySegConverters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polySegConverters.js","sourceRoot":"","sources":["../../../src/workers/polySegConverters.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAiC;AACjC,2FAAsE;AACtE,sFAAiE;AACjE,qEAA2C;AAC3C,8CAAgD;AAChD,0DAA0E;AAC1E,4CAAoD;AACpD,yDAAqE;AAYrE,MAAM,iBAAiB,GAAG;IAIxB,OAAO,EAAE,IAAI;IAKb,mBAAmB,EAAE,KAAK;IAC1B,0BAA0B,EAAE,IAAI;IAI1B,iBAAiB,CAAC,gBAAgB;;;YACtC,IAAI,IAAI,CAAC,mBAAmB,EAAE;gBAC5B,MAAM,IAAI,CAAC,0BAA0B,CAAC;gBACtC,OAAO;aACR;YAED,IAAI,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AC1C,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC;wBAElE,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;wBAG5C,IACE,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;4BACpB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;4BACpB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;4BACpB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;4BACpB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;4BACpB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EACpB;4BACA,SAAS;yBACV;wBAED,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;wBAC3C,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC,CAAC;wBACrD,IAAI,KAAK,GAAG,CAAC,EAAE;4BACb,wBAAwB,CAAC,aAAa,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;4BAC/D,MAAM;yBACP;qBACF;iBACF;gBAAC,OAAO,KAAK,EAAE;iBAEf;YACH,CAAC,CACF,CAAC;YAEF,OAAO,wBAAwB,CAAC,UAAU,CAAC;QAC7C,CAAC;KAAA;CACF,CAAC;AAEF,IAAA,gBAAM,EAAC,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ var ChangeTypes;
2
+ (function (ChangeTypes) {
3
+ ChangeTypes["POLYSEG_CONTOUR_TO_LABELMAP"] = "polySeg/convertContourToVolumeLabelmap";
4
+ ChangeTypes["POLYSEG_SURFACE_TO_LABELMAP"] = "polySeg/convertSurfacesToVolumeLabelmap";
5
+ ChangeTypes["POLYSEG_CONTOUR_TO_SURFACE"] = "polySeg/convertContourToSurface";
6
+ ChangeTypes["POLYSEG_LABELMAP_TO_SURFACE"] = "polySeg/convertLabelmapToSurface";
7
+ ChangeTypes["DISPLAY_TOOL_CLIP_SURFACE"] = "displayTool/clipSurface";
8
+ })(ChangeTypes || (ChangeTypes = {}));
9
+ export default ChangeTypes;
10
+ //# sourceMappingURL=WorkerTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkerTypes.js","sourceRoot":"","sources":["../../../src/enums/WorkerTypes.ts"],"names":[],"mappings":"AAGA,IAAK,WAUJ;AAVD,WAAK,WAAW;IACd,qFAAsE,CAAA;IAEtE,sFAAuE,CAAA;IAEvE,6EAA8D,CAAA;IAE9D,+EAAgE,CAAA;IAEhE,oEAAqD,CAAA;AACvD,CAAC,EAVI,WAAW,KAAX,WAAW,QAUf;AAED,eAAe,WAAW,CAAC"}