@cornerstonejs/tools 0.2.0 → 0.4.3

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 (257) hide show
  1. package/dist/cjs/cursors/SVGCursorDescriptor.js +5 -5
  2. package/dist/cjs/eventDispatchers/keyboardEventHandlers/keyDown.js +1 -1
  3. package/dist/cjs/eventDispatchers/keyboardEventHandlers/keyDown.js.map +1 -1
  4. package/dist/cjs/eventDispatchers/keyboardEventHandlers/keyUp.js +1 -1
  5. package/dist/cjs/eventDispatchers/keyboardEventHandlers/keyUp.js.map +1 -1
  6. package/dist/cjs/eventDispatchers/mouseEventHandlers/mouseMove.js +9 -0
  7. package/dist/cjs/eventDispatchers/mouseEventHandlers/mouseMove.js.map +1 -1
  8. package/dist/cjs/eventDispatchers/shared/customCallbackHandler.js +1 -1
  9. package/dist/cjs/eventDispatchers/shared/customCallbackHandler.js.map +1 -1
  10. package/dist/cjs/eventDispatchers/shared/getActiveToolForKeyboardEvent.js +1 -1
  11. package/dist/cjs/eventDispatchers/shared/getActiveToolForKeyboardEvent.js.map +1 -1
  12. package/dist/cjs/eventDispatchers/shared/getActiveToolForMouseEvent.js +1 -1
  13. package/dist/cjs/eventDispatchers/shared/getActiveToolForMouseEvent.js.map +1 -1
  14. package/dist/cjs/eventDispatchers/shared/getToolsWithModesForMouseEvent.js +1 -1
  15. package/dist/cjs/eventDispatchers/shared/getToolsWithModesForMouseEvent.js.map +1 -1
  16. package/dist/cjs/eventListeners/segmentation/segmentationDataModifiedEventListener.js +12 -6
  17. package/dist/cjs/eventListeners/segmentation/segmentationDataModifiedEventListener.js.map +1 -1
  18. package/dist/cjs/index.d.ts +2 -2
  19. package/dist/cjs/index.js +6 -5
  20. package/dist/cjs/index.js.map +1 -1
  21. package/dist/cjs/stateManagement/segmentation/SegmentationStateManager.d.ts +2 -2
  22. package/dist/cjs/stateManagement/segmentation/SegmentationStateManager.js.map +1 -1
  23. package/dist/cjs/stateManagement/segmentation/addSegmentationRepresentations.js +1 -1
  24. package/dist/cjs/stateManagement/segmentation/addSegmentationRepresentations.js.map +1 -1
  25. package/dist/cjs/stateManagement/segmentation/createNewSegmentationForToolGroup.js +1 -1
  26. package/dist/cjs/stateManagement/segmentation/createNewSegmentationForToolGroup.js.map +1 -1
  27. package/dist/cjs/stateManagement/segmentation/helpers/normalizeSegmentationInput.js +1 -1
  28. package/dist/cjs/stateManagement/segmentation/helpers/normalizeSegmentationInput.js.map +1 -1
  29. package/dist/cjs/stateManagement/segmentation/helpers/validateSegmentationInput.js +1 -1
  30. package/dist/cjs/stateManagement/segmentation/helpers/validateSegmentationInput.js.map +1 -1
  31. package/dist/cjs/stateManagement/segmentation/segmentationState.d.ts +2 -2
  32. package/dist/cjs/stateManagement/segmentation/segmentationState.js.map +1 -1
  33. package/dist/cjs/stateManagement/segmentation/triggerSegmentationEvents.d.ts +1 -1
  34. package/dist/cjs/stateManagement/segmentation/triggerSegmentationEvents.js +2 -1
  35. package/dist/cjs/stateManagement/segmentation/triggerSegmentationEvents.js.map +1 -1
  36. package/dist/cjs/store/SynchronizerManager/destroySynchronizer.d.ts +2 -0
  37. package/dist/cjs/store/SynchronizerManager/{destroySynchronizerById.js → destroySynchronizer.js} +3 -3
  38. package/dist/cjs/store/SynchronizerManager/destroySynchronizer.js.map +1 -0
  39. package/dist/cjs/store/SynchronizerManager/getSynchronizer.d.ts +3 -0
  40. package/dist/cjs/store/SynchronizerManager/{getSynchronizerById.js → getSynchronizer.js} +3 -3
  41. package/dist/cjs/store/SynchronizerManager/getSynchronizer.js.map +1 -0
  42. package/dist/cjs/store/SynchronizerManager/getSynchronizersForViewport.d.ts +3 -0
  43. package/dist/cjs/store/SynchronizerManager/{getSynchronizers.js → getSynchronizersForViewport.js} +3 -3
  44. package/dist/cjs/store/SynchronizerManager/getSynchronizersForViewport.js.map +1 -0
  45. package/dist/cjs/store/SynchronizerManager/index.d.ts +4 -4
  46. package/dist/cjs/store/SynchronizerManager/index.js +7 -7
  47. package/dist/cjs/store/SynchronizerManager/index.js.map +1 -1
  48. package/dist/cjs/store/ToolGroupManager/destroy.js +2 -2
  49. package/dist/cjs/store/ToolGroupManager/destroy.js.map +1 -1
  50. package/dist/cjs/store/ToolGroupManager/destroyToolGroup.d.ts +2 -0
  51. package/dist/cjs/store/ToolGroupManager/{destroyToolGroupById.js → destroyToolGroup.js} +3 -3
  52. package/dist/cjs/store/ToolGroupManager/destroyToolGroup.js.map +1 -0
  53. package/dist/cjs/store/ToolGroupManager/getToolGroup.d.ts +1 -1
  54. package/dist/cjs/store/ToolGroupManager/getToolGroup.js +2 -11
  55. package/dist/cjs/store/ToolGroupManager/getToolGroup.js.map +1 -1
  56. package/dist/cjs/store/ToolGroupManager/getToolGroupForViewport.d.ts +3 -0
  57. package/dist/cjs/store/ToolGroupManager/getToolGroupForViewport.js +17 -0
  58. package/dist/cjs/store/ToolGroupManager/getToolGroupForViewport.js.map +1 -0
  59. package/dist/cjs/store/ToolGroupManager/index.d.ts +3 -3
  60. package/dist/cjs/store/ToolGroupManager/index.js +5 -5
  61. package/dist/cjs/store/ToolGroupManager/index.js.map +1 -1
  62. package/dist/cjs/store/removeEnabledElement.js +4 -4
  63. package/dist/cjs/store/removeEnabledElement.js.map +1 -1
  64. package/dist/cjs/tools/annotation/{EllipticalRoiTool.d.ts → EllipticalROITool.d.ts} +6 -6
  65. package/dist/cjs/tools/annotation/{EllipticalRoiTool.js → EllipticalROITool.js} +14 -14
  66. package/dist/cjs/tools/annotation/{EllipticalRoiTool.js.map → EllipticalROITool.js.map} +1 -1
  67. package/dist/cjs/tools/annotation/{RectangleRoiTool.d.ts → RectangleROITool.d.ts} +8 -8
  68. package/dist/cjs/tools/annotation/{RectangleRoiTool.js → RectangleROITool.js} +14 -14
  69. package/dist/cjs/tools/annotation/{RectangleRoiTool.js.map → RectangleROITool.js.map} +1 -1
  70. package/dist/cjs/tools/base/AnnotationTool.d.ts +1 -1
  71. package/dist/cjs/tools/base/AnnotationTool.js +3 -0
  72. package/dist/cjs/tools/base/AnnotationTool.js.map +1 -1
  73. package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js +4 -4
  74. package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
  75. package/dist/cjs/tools/displayTools/SegmentationDisplayTool.js +1 -1
  76. package/dist/cjs/tools/displayTools/SegmentationDisplayTool.js.map +1 -1
  77. package/dist/cjs/tools/index.d.ts +6 -5
  78. package/dist/cjs/tools/index.js +11 -9
  79. package/dist/cjs/tools/index.js.map +1 -1
  80. package/dist/cjs/tools/segmentation/BrushTool.d.ts +17 -0
  81. package/dist/cjs/tools/segmentation/BrushTool.js +285 -0
  82. package/dist/cjs/tools/segmentation/BrushTool.js.map +1 -0
  83. package/dist/cjs/tools/segmentation/CircleScissorsTool.d.ts +1 -1
  84. package/dist/cjs/tools/segmentation/CircleScissorsTool.js +4 -3
  85. package/dist/cjs/tools/segmentation/CircleScissorsTool.js.map +1 -1
  86. package/dist/{esm/tools/segmentation/RectangleRoiStartEndThresholdTool.d.ts → cjs/tools/segmentation/RectangleROIStartEndThresholdTool.d.ts} +4 -4
  87. package/dist/cjs/tools/segmentation/{RectangleRoiStartEndThresholdTool.js → RectangleROIStartEndThresholdTool.js} +12 -12
  88. package/dist/cjs/tools/segmentation/{RectangleRoiStartEndThresholdTool.js.map → RectangleROIStartEndThresholdTool.js.map} +1 -1
  89. package/dist/{esm/tools/segmentation/RectangleRoiThresholdTool.d.ts → cjs/tools/segmentation/RectangleROIThresholdTool.d.ts} +3 -3
  90. package/dist/cjs/tools/segmentation/{RectangleRoiThresholdTool.js → RectangleROIThresholdTool.js} +12 -12
  91. package/dist/cjs/tools/segmentation/{RectangleRoiThresholdTool.js.map → RectangleROIThresholdTool.js.map} +1 -1
  92. package/dist/cjs/tools/segmentation/RectangleScissorsTool.d.ts +1 -1
  93. package/dist/cjs/tools/segmentation/RectangleScissorsTool.js +7 -6
  94. package/dist/cjs/tools/segmentation/RectangleScissorsTool.js.map +1 -1
  95. package/dist/cjs/tools/segmentation/SphereScissorsTool.d.ts +1 -1
  96. package/dist/cjs/tools/segmentation/SphereScissorsTool.js +4 -3
  97. package/dist/cjs/tools/segmentation/SphereScissorsTool.js.map +1 -1
  98. package/dist/cjs/tools/segmentation/strategies/fillCircle.js +5 -2
  99. package/dist/cjs/tools/segmentation/strategies/fillCircle.js.map +1 -1
  100. package/dist/cjs/types/EventTypes.d.ts +1 -0
  101. package/dist/cjs/types/LabelmapTypes.d.ts +1 -1
  102. package/dist/cjs/types/SegmentationStateTypes.d.ts +6 -5
  103. package/dist/cjs/utilities/getAnnotationNearPoint.js +1 -1
  104. package/dist/cjs/utilities/getAnnotationNearPoint.js.map +1 -1
  105. package/dist/cjs/utilities/getToolsWithModesForElement.js +1 -1
  106. package/dist/cjs/utilities/getToolsWithModesForElement.js.map +1 -1
  107. package/dist/cjs/utilities/segmentation/getBoundingBoxUtils.js +3 -3
  108. package/dist/cjs/utilities/segmentation/getBoundingBoxUtils.js.map +1 -1
  109. package/dist/cjs/utilities/segmentation/thresholdVolumeByRange.js +2 -2
  110. package/dist/cjs/utilities/segmentation/thresholdVolumeByRange.js.map +1 -1
  111. package/dist/cjs/utilities/triggerSegmentationRender.js +2 -2
  112. package/dist/cjs/utilities/triggerSegmentationRender.js.map +1 -1
  113. package/dist/cjs/utilities/viewportFilters/filterViewportsWithToolEnabled.js +1 -1
  114. package/dist/cjs/utilities/viewportFilters/filterViewportsWithToolEnabled.js.map +1 -1
  115. package/dist/esm/cursors/SVGCursorDescriptor.js +5 -5
  116. package/dist/esm/eventDispatchers/keyboardEventHandlers/keyDown.js +1 -1
  117. package/dist/esm/eventDispatchers/keyboardEventHandlers/keyDown.js.map +1 -1
  118. package/dist/esm/eventDispatchers/keyboardEventHandlers/keyUp.js +1 -1
  119. package/dist/esm/eventDispatchers/keyboardEventHandlers/keyUp.js.map +1 -1
  120. package/dist/esm/eventDispatchers/mouseEventHandlers/mouseMove.js +9 -0
  121. package/dist/esm/eventDispatchers/mouseEventHandlers/mouseMove.js.map +1 -1
  122. package/dist/esm/eventDispatchers/shared/customCallbackHandler.js +1 -1
  123. package/dist/esm/eventDispatchers/shared/customCallbackHandler.js.map +1 -1
  124. package/dist/esm/eventDispatchers/shared/getActiveToolForKeyboardEvent.js +1 -1
  125. package/dist/esm/eventDispatchers/shared/getActiveToolForKeyboardEvent.js.map +1 -1
  126. package/dist/esm/eventDispatchers/shared/getActiveToolForMouseEvent.js +1 -1
  127. package/dist/esm/eventDispatchers/shared/getActiveToolForMouseEvent.js.map +1 -1
  128. package/dist/esm/eventDispatchers/shared/getToolsWithModesForMouseEvent.js +1 -1
  129. package/dist/esm/eventDispatchers/shared/getToolsWithModesForMouseEvent.js.map +1 -1
  130. package/dist/esm/eventListeners/segmentation/segmentationDataModifiedEventListener.js +12 -6
  131. package/dist/esm/eventListeners/segmentation/segmentationDataModifiedEventListener.js.map +1 -1
  132. package/dist/esm/index.d.ts +2 -2
  133. package/dist/esm/index.js +2 -2
  134. package/dist/esm/index.js.map +1 -1
  135. package/dist/esm/stateManagement/segmentation/SegmentationStateManager.d.ts +2 -2
  136. package/dist/esm/stateManagement/segmentation/SegmentationStateManager.js.map +1 -1
  137. package/dist/esm/stateManagement/segmentation/addSegmentationRepresentations.js +2 -2
  138. package/dist/esm/stateManagement/segmentation/addSegmentationRepresentations.js.map +1 -1
  139. package/dist/esm/stateManagement/segmentation/createNewSegmentationForToolGroup.js +2 -2
  140. package/dist/esm/stateManagement/segmentation/createNewSegmentationForToolGroup.js.map +1 -1
  141. package/dist/esm/stateManagement/segmentation/helpers/normalizeSegmentationInput.js +1 -1
  142. package/dist/esm/stateManagement/segmentation/helpers/normalizeSegmentationInput.js.map +1 -1
  143. package/dist/esm/stateManagement/segmentation/helpers/validateSegmentationInput.js +1 -1
  144. package/dist/esm/stateManagement/segmentation/helpers/validateSegmentationInput.js.map +1 -1
  145. package/dist/esm/stateManagement/segmentation/segmentationState.d.ts +2 -2
  146. package/dist/esm/stateManagement/segmentation/segmentationState.js +1 -1
  147. package/dist/esm/stateManagement/segmentation/segmentationState.js.map +1 -1
  148. package/dist/esm/stateManagement/segmentation/triggerSegmentationEvents.d.ts +1 -1
  149. package/dist/esm/stateManagement/segmentation/triggerSegmentationEvents.js +2 -1
  150. package/dist/esm/stateManagement/segmentation/triggerSegmentationEvents.js.map +1 -1
  151. package/dist/esm/store/SynchronizerManager/destroySynchronizer.d.ts +2 -0
  152. package/dist/esm/store/SynchronizerManager/{destroySynchronizerById.js → destroySynchronizer.js} +3 -3
  153. package/dist/esm/store/SynchronizerManager/destroySynchronizer.js.map +1 -0
  154. package/dist/esm/store/SynchronizerManager/getSynchronizer.d.ts +3 -0
  155. package/dist/esm/store/SynchronizerManager/getSynchronizer.js +6 -0
  156. package/dist/esm/store/SynchronizerManager/getSynchronizer.js.map +1 -0
  157. package/dist/esm/store/SynchronizerManager/getSynchronizersForViewport.d.ts +3 -0
  158. package/dist/esm/store/SynchronizerManager/{getSynchronizers.js → getSynchronizersForViewport.js} +3 -3
  159. package/dist/esm/store/SynchronizerManager/getSynchronizersForViewport.js.map +1 -0
  160. package/dist/esm/store/SynchronizerManager/index.d.ts +4 -4
  161. package/dist/esm/store/SynchronizerManager/index.js +4 -4
  162. package/dist/esm/store/SynchronizerManager/index.js.map +1 -1
  163. package/dist/esm/store/ToolGroupManager/destroy.js +2 -2
  164. package/dist/esm/store/ToolGroupManager/destroy.js.map +1 -1
  165. package/dist/esm/store/ToolGroupManager/destroyToolGroup.d.ts +2 -0
  166. package/dist/esm/store/ToolGroupManager/{destroyToolGroupById.js → destroyToolGroup.js} +3 -3
  167. package/dist/esm/store/ToolGroupManager/destroyToolGroup.js.map +1 -0
  168. package/dist/esm/store/ToolGroupManager/getToolGroup.d.ts +1 -1
  169. package/dist/esm/store/ToolGroupManager/getToolGroup.js +2 -11
  170. package/dist/esm/store/ToolGroupManager/getToolGroup.js.map +1 -1
  171. package/dist/esm/store/ToolGroupManager/getToolGroupForViewport.d.ts +3 -0
  172. package/dist/esm/store/ToolGroupManager/getToolGroupForViewport.js +15 -0
  173. package/dist/esm/store/ToolGroupManager/getToolGroupForViewport.js.map +1 -0
  174. package/dist/esm/store/ToolGroupManager/index.d.ts +3 -3
  175. package/dist/esm/store/ToolGroupManager/index.js +3 -3
  176. package/dist/esm/store/ToolGroupManager/index.js.map +1 -1
  177. package/dist/esm/store/removeEnabledElement.js +4 -4
  178. package/dist/esm/store/removeEnabledElement.js.map +1 -1
  179. package/dist/esm/tools/annotation/{EllipticalRoiTool.d.ts → EllipticalROITool.d.ts} +6 -6
  180. package/dist/esm/tools/annotation/{EllipticalRoiTool.js → EllipticalROITool.js} +13 -13
  181. package/dist/esm/tools/annotation/{EllipticalRoiTool.js.map → EllipticalROITool.js.map} +1 -1
  182. package/dist/esm/tools/annotation/{RectangleRoiTool.d.ts → RectangleROITool.d.ts} +8 -8
  183. package/dist/esm/tools/annotation/{RectangleRoiTool.js → RectangleROITool.js} +13 -13
  184. package/dist/esm/tools/annotation/{RectangleRoiTool.js.map → RectangleROITool.js.map} +1 -1
  185. package/dist/esm/tools/base/AnnotationTool.d.ts +1 -1
  186. package/dist/esm/tools/base/AnnotationTool.js +3 -0
  187. package/dist/esm/tools/base/AnnotationTool.js.map +1 -1
  188. package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js +5 -5
  189. package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
  190. package/dist/esm/tools/displayTools/SegmentationDisplayTool.js +2 -2
  191. package/dist/esm/tools/displayTools/SegmentationDisplayTool.js.map +1 -1
  192. package/dist/esm/tools/index.d.ts +6 -5
  193. package/dist/esm/tools/index.js +6 -5
  194. package/dist/esm/tools/index.js.map +1 -1
  195. package/dist/esm/tools/segmentation/BrushTool.d.ts +17 -0
  196. package/dist/esm/tools/segmentation/BrushTool.js +279 -0
  197. package/dist/esm/tools/segmentation/BrushTool.js.map +1 -0
  198. package/dist/esm/tools/segmentation/CircleScissorsTool.d.ts +1 -1
  199. package/dist/esm/tools/segmentation/CircleScissorsTool.js +4 -3
  200. package/dist/esm/tools/segmentation/CircleScissorsTool.js.map +1 -1
  201. package/dist/{cjs/tools/segmentation/RectangleRoiStartEndThresholdTool.d.ts → esm/tools/segmentation/RectangleROIStartEndThresholdTool.d.ts} +4 -4
  202. package/dist/esm/tools/segmentation/{RectangleRoiStartEndThresholdTool.js → RectangleROIStartEndThresholdTool.js} +11 -11
  203. package/dist/esm/tools/segmentation/{RectangleRoiStartEndThresholdTool.js.map → RectangleROIStartEndThresholdTool.js.map} +1 -1
  204. package/dist/{cjs/tools/segmentation/RectangleRoiThresholdTool.d.ts → esm/tools/segmentation/RectangleROIThresholdTool.d.ts} +3 -3
  205. package/dist/esm/tools/segmentation/{RectangleRoiThresholdTool.js → RectangleROIThresholdTool.js} +11 -11
  206. package/dist/esm/tools/segmentation/{RectangleRoiThresholdTool.js.map → RectangleROIThresholdTool.js.map} +1 -1
  207. package/dist/esm/tools/segmentation/RectangleScissorsTool.d.ts +1 -1
  208. package/dist/esm/tools/segmentation/RectangleScissorsTool.js +7 -6
  209. package/dist/esm/tools/segmentation/RectangleScissorsTool.js.map +1 -1
  210. package/dist/esm/tools/segmentation/SphereScissorsTool.d.ts +1 -1
  211. package/dist/esm/tools/segmentation/SphereScissorsTool.js +4 -3
  212. package/dist/esm/tools/segmentation/SphereScissorsTool.js.map +1 -1
  213. package/dist/esm/tools/segmentation/strategies/fillCircle.js +5 -2
  214. package/dist/esm/tools/segmentation/strategies/fillCircle.js.map +1 -1
  215. package/dist/esm/types/EventTypes.d.ts +1 -0
  216. package/dist/esm/types/LabelmapTypes.d.ts +1 -1
  217. package/dist/esm/types/SegmentationStateTypes.d.ts +6 -5
  218. package/dist/esm/utilities/getAnnotationNearPoint.js +1 -1
  219. package/dist/esm/utilities/getAnnotationNearPoint.js.map +1 -1
  220. package/dist/esm/utilities/getToolsWithModesForElement.js +1 -1
  221. package/dist/esm/utilities/getToolsWithModesForElement.js.map +1 -1
  222. package/dist/esm/utilities/segmentation/getBoundingBoxUtils.js +3 -3
  223. package/dist/esm/utilities/segmentation/getBoundingBoxUtils.js.map +1 -1
  224. package/dist/esm/utilities/segmentation/thresholdVolumeByRange.js +2 -2
  225. package/dist/esm/utilities/segmentation/thresholdVolumeByRange.js.map +1 -1
  226. package/dist/esm/utilities/triggerSegmentationRender.js +3 -3
  227. package/dist/esm/utilities/triggerSegmentationRender.js.map +1 -1
  228. package/dist/esm/utilities/viewportFilters/filterViewportsWithToolEnabled.js +1 -1
  229. package/dist/esm/utilities/viewportFilters/filterViewportsWithToolEnabled.js.map +1 -1
  230. package/dist/umd/index.js +1 -1
  231. package/dist/umd/index.js.map +1 -1
  232. package/package.json +7 -6
  233. package/dist/cjs/store/SynchronizerManager/destroySynchronizerById.d.ts +0 -2
  234. package/dist/cjs/store/SynchronizerManager/destroySynchronizerById.js.map +0 -1
  235. package/dist/cjs/store/SynchronizerManager/getSynchronizerById.d.ts +0 -3
  236. package/dist/cjs/store/SynchronizerManager/getSynchronizerById.js.map +0 -1
  237. package/dist/cjs/store/SynchronizerManager/getSynchronizers.d.ts +0 -3
  238. package/dist/cjs/store/SynchronizerManager/getSynchronizers.js.map +0 -1
  239. package/dist/cjs/store/ToolGroupManager/destroyToolGroupById.d.ts +0 -2
  240. package/dist/cjs/store/ToolGroupManager/destroyToolGroupById.js.map +0 -1
  241. package/dist/cjs/store/ToolGroupManager/getToolGroupById.d.ts +0 -3
  242. package/dist/cjs/store/ToolGroupManager/getToolGroupById.js +0 -8
  243. package/dist/cjs/store/ToolGroupManager/getToolGroupById.js.map +0 -1
  244. package/dist/esm/store/SynchronizerManager/destroySynchronizerById.d.ts +0 -2
  245. package/dist/esm/store/SynchronizerManager/destroySynchronizerById.js.map +0 -1
  246. package/dist/esm/store/SynchronizerManager/getSynchronizerById.d.ts +0 -3
  247. package/dist/esm/store/SynchronizerManager/getSynchronizerById.js +0 -6
  248. package/dist/esm/store/SynchronizerManager/getSynchronizerById.js.map +0 -1
  249. package/dist/esm/store/SynchronizerManager/getSynchronizers.d.ts +0 -3
  250. package/dist/esm/store/SynchronizerManager/getSynchronizers.js.map +0 -1
  251. package/dist/esm/store/ToolGroupManager/destroyToolGroupById.d.ts +0 -2
  252. package/dist/esm/store/ToolGroupManager/destroyToolGroupById.js.map +0 -1
  253. package/dist/esm/store/ToolGroupManager/getToolGroupById.d.ts +0 -3
  254. package/dist/esm/store/ToolGroupManager/getToolGroupById.js +0 -6
  255. package/dist/esm/store/ToolGroupManager/getToolGroupById.js.map +0 -1
  256. package/dist/esm/tsdoc-metadata.json +0 -11
  257. package/dist/tools.d.ts +0 -3892
package/dist/tools.d.ts DELETED
@@ -1,3892 +0,0 @@
1
- import type { mat4 } from 'gl-matrix';
2
- import type { vtkColorTransferFunction } from 'vtk.js/Sources/Rendering/Core/ColorTransferFunction';
3
- import type { vtkImageData } from 'vtk.js/Sources/Common/DataModel/ImageData';
4
- import type { vtkPiecewiseFunction } from 'vtk.js/Sources/Common/DataModel/PiecewiseFunction';
5
- import type { vtkVolume } from 'vtk.js/Sources/Rendering/Core/Volume';
6
-
7
- declare namespace activeSegmentation {
8
- export {
9
- getActiveSegmentationRepresentation,
10
- setActiveSegmentationRepresentation
11
- }
12
- }
13
-
14
- /**
15
- * Cornerstone Actor Entry including actor uid, actual volumeActor, and
16
- * slabThickness for the actor. Note: actor (and actorEntry) are not
17
- * the same as volumeActor which is vtkVolume. ActorEntry is the object that
18
- * is retrieved from viewport when calling viewport.getActor(s)
19
- */
20
- declare type ActorEntry = {
21
- uid: string
22
- volumeActor: VolumeActor
23
- slabThickness?: number
24
- }
25
-
26
- declare function addAnnotation(element: HTMLElement, annotation: Annotation): void;
27
-
28
- declare function addColorLUT(colorLut: ColorLut, index: number): void;
29
-
30
- declare function addColorLUT_2(colorLUT: ColorLut, colorLUTIndex: number): void;
31
-
32
- declare function addSegmentation(segmentationInput: SegmentationPublicInput, suppressEvents?: boolean): void;
33
-
34
- declare function addSegmentationRepresentation(toolGroupId: string, segmentationRepresentation: ToolGroupSpecificRepresentation, suppressEvents?: boolean): void;
35
-
36
- declare function addSegmentationRepresentations(toolGroupId: string, representationInputArray: RepresentationPublicInput[], toolGroupSpecificRepresentationConfig?: SegmentationRepresentationConfig): Promise<void>;
37
-
38
- declare function addSegmentations(segmentationInputArray: SegmentationPublicInput[]): void;
39
-
40
- export declare function addTool(ToolClass: any): void;
41
-
42
- declare type Annotation = {
43
- annotationUID?: string;
44
- highlighted?: boolean;
45
- isLocked?: boolean;
46
- invalidated?: boolean;
47
- metadata: {
48
- cameraPosition?: Types_2.Point3;
49
- cameraFocalPoint?: Types_2.Point3;
50
- viewPlaneNormal?: Types_2.Point3;
51
- viewUp?: Types_2.Point3;
52
- FrameOfReferenceUID: string;
53
- toolName: string;
54
- referencedImageId?: string;
55
- volumeId?: string;
56
- };
57
- data: {
58
- handles?: {
59
- points?: Types_2.Point3[];
60
- activeHandleIndex?: number | null;
61
- textBox?: {
62
- hasMoved: boolean;
63
- worldPosition: Types_2.Point3;
64
- worldBoundingBox: {
65
- topLeft: Types_2.Point3;
66
- topRight: Types_2.Point3;
67
- bottomLeft: Types_2.Point3;
68
- bottomRight: Types_2.Point3;
69
- };
70
- };
71
- [key: string]: any;
72
- };
73
- cachedStats?: unknown;
74
- };
75
- };
76
-
77
- declare namespace annotation {
78
- export {
79
- config,
80
- locking,
81
- selection,
82
- state
83
- }
84
- }
85
- export { annotation }
86
-
87
- declare type AnnotationAddedEventDetail = {
88
- viewportId: string;
89
- renderingEngineId: string;
90
- annotation: Annotation;
91
- };
92
-
93
- declare type AnnotationAddedEventType = Types_2.CustomEventType<AnnotationAddedEventDetail>;
94
-
95
- declare type AnnotationForThresholding = {
96
- metadata: {
97
- enabledElement: Types_2.IEnabledElement;
98
- };
99
- data: {
100
- handles: {
101
- points: Types_2.Point3[];
102
- };
103
- cachedStats: {
104
- projectionPoints: Types_2.Point3[][];
105
- };
106
- };
107
- };
108
-
109
- declare type AnnotationHandle = Types_2.Point3;
110
-
111
- declare type AnnotationLockChangeEventDetail = {
112
- added: Array<Annotation>;
113
- removed: Array<Annotation>;
114
- locked: Array<Annotation>;
115
- };
116
-
117
- declare type AnnotationLockChangeEventType = Types_2.CustomEventType<AnnotationLockChangeEventDetail>;
118
-
119
- declare type AnnotationModifiedEventDetail = {
120
- viewportId: string;
121
- renderingEngineId: string;
122
- annotation: Annotation;
123
- };
124
-
125
- declare type AnnotationModifiedEventType = Types_2.CustomEventType<AnnotationModifiedEventDetail>;
126
-
127
- declare type AnnotationRemovedEventDetail = {
128
- viewportId: string;
129
- renderingEngineId: string;
130
- annotation: Annotation;
131
- };
132
-
133
- declare type AnnotationRemovedEventType = Types_2.CustomEventType<AnnotationRemovedEventDetail>;
134
-
135
- declare type AnnotationRenderedEventDetail = {
136
- element: HTMLElement;
137
- viewportId: string;
138
- renderingEngineId: string;
139
- };
140
-
141
- declare type AnnotationRenderedEventType = Types_2.CustomEventType<AnnotationRenderedEventDetail>;
142
-
143
- declare type Annotations = Array<Annotation>;
144
-
145
- declare type AnnotationSelectionChangeEventDetail = {
146
- added: Array<Annotation>;
147
- removed: Array<Annotation>;
148
- selection: Array<Annotation>;
149
- };
150
-
151
- declare type AnnotationSelectionChangeEventType = Types_2.CustomEventType<AnnotationSelectionChangeEventDetail>;
152
-
153
- declare type AnnotationState = {
154
- [key: string]: FrameOfReferenceSpecificAnnotations;
155
- };
156
-
157
- declare enum AnnotationStyleStates {
158
- Default = "",
159
- Highlighted = "Highlighted",
160
- Selected = "Selected",
161
- Locked = "Locked"
162
- }
163
-
164
- export declare abstract class AnnotationTool extends BaseTool {
165
- static toolName: string;
166
- abstract addNewAnnotation(evt: EventTypes_2.MouseDownActivateEventType, interactionType: InteractionTypes): Annotation;
167
- abstract renderAnnotation(enabledElement: Types_2.IEnabledElement, svgDrawingHelper: any): any;
168
- abstract cancel(element: HTMLElement): any;
169
- abstract handleSelectedCallback(evt: EventTypes_2.MouseDownEventType, annotation: Annotation, handle: ToolHandle, interactionType: InteractionTypes): void;
170
- abstract toolSelectedCallback(evt: EventTypes_2.MouseDownEventType, annotation: Annotation, interactionType: InteractionTypes): void;
171
- abstract isPointNearTool(element: HTMLElement, annotation: Annotation, canvasCoords: Types_2.Point2, proximity: number, interactionType: string): boolean;
172
- filterInteractableAnnotationsForElement(element: HTMLElement, annotations: Annotations): Annotations | undefined;
173
- mouseMoveCallback: (evt: EventTypes_2.MouseMoveEventType, filteredAnnotations: Annotations) => boolean;
174
- onImageSpacingCalibrated: (evt: Types_2.EventTypes.ImageSpacingCalibratedEvent) => void;
175
- getHandleNearImagePoint(element: HTMLElement, annotation: Annotation, canvasCoords: Types_2.Point2, proximity: number): ToolHandle | undefined;
176
- getStyle(settings: Settings, property: string, annotation?: Annotation): unknown;
177
- getLinkedTextBoxStyle(settings: Settings, annotation?: Annotation): Record<string, unknown>;
178
- private _imagePointNearToolOrHandle;
179
- }
180
-
181
- export declare abstract class BaseTool implements IBaseTool {
182
- static toolName: string;
183
- supportedInteractionTypes: InteractionTypes[];
184
- configuration: Record<string, any>;
185
- toolGroupId: string;
186
- mode: ToolModes;
187
- constructor(toolProps: PublicToolProps, defaultToolProps: ToolProps);
188
- getToolName(): string;
189
- applyActiveStrategy(enabledElement: Types_2.IEnabledElement, operationData: unknown): any;
190
- setConfiguration(newConfiguration: Record<string, any>): void;
191
- setActiveStrategy(strategyName: string): void;
192
- private getTargetVolumeId;
193
- protected getTargetIdViewportAndImage(targetId: string, renderingEngine: Types_2.IRenderingEngine): {
194
- viewport: Types_2.IViewport;
195
- image: Types_2.IImageData;
196
- };
197
- protected getTargetId(viewport: Types_2.IViewport): string | undefined;
198
- }
199
-
200
- declare interface BidirectionalAnnotation extends Annotation {
201
- data: {
202
- handles: {
203
- points: Types_2.Point3[];
204
- activeHandleIndex: number | null;
205
- textBox: {
206
- hasMoved: boolean;
207
- worldPosition: Types_2.Point3;
208
- worldBoundingBox: {
209
- topLeft: Types_2.Point3;
210
- topRight: Types_2.Point3;
211
- bottomLeft: Types_2.Point3;
212
- bottomRight: Types_2.Point3;
213
- };
214
- };
215
- };
216
- label: string;
217
- cachedStats: {
218
- [targetId: string]: {
219
- length: number;
220
- width: number;
221
- };
222
- };
223
- };
224
- }
225
-
226
- export declare class BidirectionalTool extends AnnotationTool {
227
- static toolName: string;
228
- touchDragCallback: any;
229
- mouseDragCallback: any;
230
- _throttledCalculateCachedStats: any;
231
- editData: {
232
- annotation: any;
233
- viewportIdsToRender: string[];
234
- handleIndex?: number;
235
- movingTextBox: boolean;
236
- newAnnotation?: boolean;
237
- hasMoved?: boolean;
238
- } | null;
239
- isDrawing: boolean;
240
- isHandleOutsideImage: boolean;
241
- preventHandleOutsideImage: boolean;
242
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
243
- addNewAnnotation(evt: EventTypes_2.MouseDownActivateEventType): BidirectionalAnnotation;
244
- isPointNearTool: (element: HTMLElement, annotation: BidirectionalAnnotation, canvasCoords: Types_2.Point2, proximity: number) => boolean;
245
- toolSelectedCallback: (evt: EventTypes_2.MouseDownEventType, annotation: BidirectionalAnnotation, interactionType: InteractionTypes) => void;
246
- handleSelectedCallback: (evt: EventTypes_2.MouseDownEventType, annotation: BidirectionalAnnotation, handle: ToolHandle, interactionType?: string) => void;
247
- _mouseUpCallback: (evt: EventTypes_2.MouseUpEventType | EventTypes_2.MouseClickEventType) => void;
248
- _mouseDragDrawCallback: (evt: MouseMoveEventType | MouseDragEventType) => void;
249
- _mouseDragModifyCallback: (evt: MouseDragEventType) => void;
250
- _mouseDragModifyHandle: (evt: any) => void;
251
- cancel: (element: HTMLElement) => any;
252
- _activateDraw: (element: any) => void;
253
- _deactivateDraw: (element: any) => void;
254
- _activateModify: (element: any) => void;
255
- _deactivateModify: (element: any) => void;
256
- renderAnnotation: (enabledElement: Types_2.IEnabledElement, svgDrawingHelper: any) => void;
257
- _movingLongAxisWouldPutItThroughShortAxis: (proposedFirstLineSegment: any, secondLineSegment: any) => boolean;
258
- _getTextLines: (data: any, targetId: any) => string[];
259
- _calculateLength(pos1: any, pos2: any): number;
260
- _calculateCachedStats: (annotation: any, renderingEngine: any, enabledElement: any) => any;
261
- _isInsideVolume: (index1: any, index2: any, index3: any, index4: any, dimensions: any) => boolean;
262
- }
263
-
264
- /**
265
- * Enums for blendModes for viewport images based on vtk.js
266
- *
267
- * It should be noted that if crosshairs are enabled and can modify the slab thickness,
268
- * then it will not show any difference unless MAXIMUM_INTENSITY_BLEND is set on the viewport
269
- * as the blend.
270
- */
271
- declare enum BlendModes {
272
- /** composite blending - suitable for compositing multiple images */
273
- COMPOSITE = BlendMode.COMPOSITE,
274
- /** maximum intensity projection */
275
- MAXIMUM_INTENSITY_BLEND = BlendMode.MAXIMUM_INTENSITY_BLEND,
276
- /** minimum intensity projection */
277
- MINIMUM_INTENSITY_BLEND = BlendMode.MINIMUM_INTENSITY_BLEND,
278
- /** average intensity projection */
279
- AVERAGE_INTENSITY_BLEND = BlendMode.AVERAGE_INTENSITY_BLEND,
280
- }
281
-
282
- declare type BoundsIJK = [Types_2.Point2, Types_2.Point2, Types_2.Point2];
283
-
284
- declare function calibrateImageSpacing(imageId: string, renderingEngine: Types_2.IRenderingEngine, rowPixelSpacing: number, columnPixelSpacing: number): void;
285
-
286
- /**
287
- * CameraModified Event type
288
- */
289
- declare type CameraModifiedEvent = CustomEvent_2<CameraModifiedEventDetail>
290
-
291
- /**
292
- * CAMERA_MODIFIED Event's data
293
- */
294
- declare type CameraModifiedEventDetail = {
295
- /** Previous camera properties */
296
- previousCamera: ICamera
297
- /** Current camera properties */
298
- camera: ICamera
299
- /** Viewport HTML element in the DOM */
300
- element: HTMLElement
301
- /** Viewport Unique ID in the renderingEngine */
302
- viewportId: string
303
- /** Unique ID for the renderingEngine */
304
- renderingEngineId: string
305
- }
306
-
307
- export declare function cancelActiveManipulations(element: HTMLElement): string | undefined;
308
-
309
- declare type canvasCoordinates = [
310
- Types_2.Point2,
311
- Types_2.Point2,
312
- Types_2.Point2,
313
- Types_2.Point2
314
- ];
315
-
316
- declare function checkAndDefineIsLockedProperty(annotation: Annotation): void;
317
-
318
- export declare class CircleScissorsTool extends BaseTool {
319
- static toolName: string;
320
- editData: {
321
- annotation: any;
322
- segmentation: any;
323
- segmentIndex: number;
324
- segmentationId: string;
325
- segmentsLocked: number[];
326
- segmentColor: [number, number, number, number];
327
- viewportIdsToRender: string[];
328
- handleIndex?: number;
329
- movingTextBox: boolean;
330
- newAnnotation?: boolean;
331
- hasMoved?: boolean;
332
- centerCanvas?: Array<number>;
333
- } | null;
334
- isDrawing: boolean;
335
- isHandleOutsideImage: boolean;
336
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
337
- addNewAnnotation: (evt: EventTypes_2.MouseDownActivateEventType) => void;
338
- _mouseDragCallback: (evt: EventTypes_2.MouseDragEventType) => void;
339
- _mouseUpCallback: (evt: EventTypes_2.MouseUpEventType | EventTypes_2.MouseClickEventType) => void;
340
- _activateDraw: (element: any) => void;
341
- _deactivateDraw: (element: any) => void;
342
- renderAnnotation: (enabledElement: Types_2.IEnabledElement, svgDrawingHelper: any) => void;
343
- }
344
-
345
- declare function clip(a: any, b: any, box: any, da?: any, db?: any): 0 | 1;
346
-
347
- declare type Color = [number, number, number, number];
348
-
349
- declare type ColorLut = Array<Color>;
350
-
351
- declare namespace config {
352
- export {
353
- getState,
354
- getStyle,
355
- getFont,
356
- setAnnotationStyle,
357
- setGlobalStyle,
358
- setToolStyle
359
- }
360
- }
361
-
362
- declare namespace CONSTANTS {
363
- export {
364
- CORNERSTONE_COLOR_LUT as COLOR_LUT
365
- }
366
- }
367
- export { CONSTANTS }
368
-
369
- declare const CORNERSTONE_COLOR_LUT: number[][];
370
-
371
- declare interface CPUFallbackColormap {
372
- /** Get id of colormap */
373
- getId: () => string
374
- getColorSchemeName: () => string
375
- setColorSchemeName: (name: string) => void
376
- getNumberOfColors: () => number
377
- setNumberOfColors: (numColors: number) => void
378
- getColor: (index: number) => Point4
379
- getColorRepeating: (index: number) => Point4
380
- setColor: (index: number, rgba: Point4) => void
381
- addColor: (rgba: Point4) => void
382
- insertColor: (index: number, rgba: Point4) => void
383
- removeColor: (index: number) => void
384
- clearColors: () => void
385
- buildLookupTable: (lut: CPUFallbackLookupTable) => void
386
- createLookupTable: () => CPUFallbackLookupTable
387
- isValidIndex: (index: number) => boolean
388
- }
389
-
390
- declare type CPUFallbackColormapData = {
391
- name: string;
392
- numOfColors?: number;
393
- colors?: Point4[];
394
- segmentedData?: unknown;
395
- numColors?: number;
396
- gamma?: number;
397
- };
398
-
399
- declare type CPUFallbackColormapsData = {
400
- [key: string]: CPUFallbackColormapData;
401
- };
402
-
403
- declare interface CPUFallbackEnabledElement {
404
- scale?: number
405
- pan?: Point2
406
- zoom?: number
407
- rotation?: number
408
- image?: IImage
409
- canvas?: HTMLCanvasElement
410
- viewport?: CPUFallbackViewport
411
- colormap?: CPUFallbackColormap
412
- options?: {
413
- [key: string]: unknown
414
- colormap?: CPUFallbackColormap
415
- }
416
- renderingTools?: CPUFallbackRenderingTools
417
- transform?: CPUFallbackTransform
418
- invalid?: boolean
419
- needsRedraw?: boolean
420
- metadata?: {
421
- direction?: Float32Array
422
- /** Last index is always 1 for CPU */
423
- dimensions?: Point3
424
- /** Last spacing is always EPSILON for CPU */
425
- spacing?: Point3
426
- origin?: Point3
427
- imagePlaneModule?: {
428
- frameOfReferenceUID: string
429
- rows: number
430
- columns: number
431
- imageOrientationPatient: number[]
432
- rowCosines: Point3
433
- columnCosines: Point3
434
- imagePositionPatient: number[]
435
- sliceThickness?: number
436
- sliceLocation?: number
437
- pixelSpacing: Point2
438
- rowPixelSpacing: number
439
- columnPixelSpacing: number
440
- }
441
- imagePixelModule?: {
442
- samplesPerPixel: number
443
- photometricInterpretation: string
444
- rows: number
445
- columns: number
446
- bitsAllocated: number
447
- bitsStored: number
448
- highBit: number
449
- pixelRepresentation: number
450
- planarConfiguration?: number
451
- pixelAspectRatio?: number
452
- smallestPixelValue?: number
453
- largestPixelValue?: number
454
- redPaletteColorLookupTableDescriptor?: number[]
455
- greenPaletteColorLookupTableDescriptor?: number[]
456
- bluePaletteColorLookupTableDescriptor?: number[]
457
- redPaletteColorLookupTableData: number[]
458
- greenPaletteColorLookupTableData: number[]
459
- bluePaletteColorLookupTableData: number[]
460
- }
461
- }
462
- }
463
-
464
- declare interface CPUFallbackLookupTable {
465
- setNumberOfTableValues: (number: number) => void;
466
- setRamp: (ramp: string) => void;
467
- setTableRange: (start: number, end: number) => void;
468
- setHueRange: (start: number, end: number) => void;
469
- setSaturationRange: (start: number, end: number) => void;
470
- setValueRange: (start: number, end: number) => void;
471
- setRange: (start: number, end: number) => void;
472
- setAlphaRange: (start: number, end: number) => void;
473
- getColor: (scalar: number) => Point4;
474
- build: (force: boolean) => void;
475
- setTableValue(index: number, rgba: Point4);
476
- }
477
-
478
- declare type CPUFallbackLUT = {
479
- lut: number[];
480
- };
481
-
482
- declare type CPUFallbackRenderingTools = {
483
- renderCanvas?: HTMLCanvasElement;
484
- lastRenderedIsColor?: boolean;
485
- lastRenderedImageId?: string;
486
- lastRenderedViewport?: {
487
- windowWidth: number | number[];
488
- windowCenter: number | number[];
489
- invert: boolean;
490
- rotation: number;
491
- hflip: boolean;
492
- vflip: boolean;
493
- modalityLUT: CPUFallbackLUT;
494
- voiLUT: CPUFallbackLUT;
495
- colormap: unknown;
496
- };
497
- renderCanvasContext?: {
498
- putImageData: (
499
- renderCanvasData: unknown,
500
- dx: number,
501
- dy: number
502
- ) => unknown;
503
- };
504
- colormapId?: string;
505
- colorLut?: CPUFallbackLookupTable;
506
- renderCanvasData?: {
507
- data: Uint8ClampedArray;
508
- };
509
- };
510
-
511
- declare interface CPUFallbackTransform {
512
- reset: () => void;
513
- clone: () => CPUFallbackTransform;
514
- multiply: (matrix: TransformMatrix2D) => void;
515
- getMatrix: () => TransformMatrix2D;
516
- invert: () => void;
517
- rotate: (rad: number) => void;
518
- translate: (x: number, y: number) => void;
519
- scale: (sx: number, sy: number) => void;
520
- transformPoint: (point: Point2) => Point2;
521
- }
522
-
523
- declare type CPUFallbackViewport = {
524
- scale?: number;
525
- translation?: {
526
- x: number;
527
- y: number;
528
- };
529
- voi?: {
530
- windowWidth: number;
531
- windowCenter: number;
532
- };
533
- invert?: boolean;
534
- pixelReplication?: boolean;
535
- rotation?: number;
536
- hflip?: boolean;
537
- vflip?: boolean;
538
- modalityLUT?: CPUFallbackLUT;
539
- voiLUT?: CPUFallbackLUT;
540
- colormap?: CPUFallbackColormap;
541
- displayedArea?: CPUFallbackViewportDisplayedArea;
542
- modality?: string;
543
- };
544
-
545
- declare type CPUFallbackViewportDisplayedArea = {
546
- tlhc: {
547
- x: number;
548
- y: number;
549
- };
550
- brhc: {
551
- x: number;
552
- y: number;
553
- };
554
- rowPixelSpacing: number;
555
- columnPixelSpacing: number;
556
- presentationSizeMode: string;
557
- };
558
-
559
- declare type CPUIImageData = {
560
- dimensions: Point3
561
- direction: Float32Array
562
- spacing: Point3
563
- origin: Point3
564
- imageData: CPUImageData
565
- metadata: { Modality: string }
566
- scalarData: number[]
567
- scaling: Scaling
568
- }
569
-
570
- declare type CPUImageData = {
571
- worldToIndex?: (point: Point3) => Point3
572
- indexToWorld?: (point: Point3) => Point3
573
- getWorldToIndex?: () => Point3
574
- getIndexToWorld?: () => Point3
575
- /** Last spacing is always EPSILON */
576
- getSpacing?: () => Point3
577
- getDirection?: () => Float32Array
578
- getScalarData?: () => number[]
579
- /** Last index is always 1 */
580
- getDimensions?: () => Point3
581
- }
582
-
583
- declare function createCameraPositionSynchronizer(synchronizerName: string): Synchronizer;
584
-
585
- declare function createMergedLabelmapForIndex(labelmaps: Array<Types_2.IImageVolume>, segmentIndex?: number, volumeId?: string): Types_2.IImageVolume;
586
-
587
- declare function createNewSegmentationForToolGroup(toolGroupId: string, options?: {
588
- volumeId?: string;
589
- scalarData?: Float32Array | Uint8Array;
590
- targetBuffer?: {
591
- type: 'Float32Array' | 'Uint8Array';
592
- };
593
- metadata?: any;
594
- dimensions?: Types_2.Point3;
595
- spacing?: Types_2.Point3;
596
- origin?: Types_2.Point3;
597
- direction?: Float32Array;
598
- }): Promise<string>;
599
-
600
- declare function createSynchronizer(synchronizerId: string, eventName: string, eventHandler: ISynchronizerEventHandler): Synchronizer;
601
-
602
- declare function createToolGroup(toolGroupId: string): IToolGroup | undefined;
603
-
604
- declare function createVOISynchronizer(synchronizerName: string): Synchronizer;
605
-
606
- declare interface CrosshairsAnnotation extends Annotation {
607
- data: {
608
- handles: {
609
- rotationPoints: any[];
610
- slabThicknessPoints: any[];
611
- activeOperation: number | null;
612
- toolCenter: Types_2.Point3;
613
- };
614
- activeViewportIds: string[];
615
- viewportId: string;
616
- };
617
- }
618
-
619
- export declare class CrosshairsTool extends AnnotationTool {
620
- static toolName: string;
621
- toolCenter: Types_2.Point3;
622
- _getReferenceLineColor?: (viewportId: string) => string;
623
- _getReferenceLineControllable?: (viewportId: string) => boolean;
624
- _getReferenceLineDraggableRotatable?: (viewportId: string) => boolean;
625
- _getReferenceLineSlabThicknessControlsOn?: (viewportId: string) => boolean;
626
- editData: {
627
- annotation: any;
628
- } | null;
629
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
630
- initializeViewport: ({ renderingEngineId, viewportId, }: Types_2.IViewportId) => {
631
- normal: Types_2.Point3;
632
- point: Types_2.Point3;
633
- };
634
- init: (viewports: ViewportInputs) => void;
635
- addNewAnnotation: (evt: EventTypes_2.MouseDownActivateEventType, interactionType: string) => CrosshairsAnnotation;
636
- cancel: () => void;
637
- getHandleNearImagePoint(element: HTMLElement, annotation: Annotation, canvasCoords: Types_2.Point2, proximity: number): ToolHandle | undefined;
638
- handleSelectedCallback: (evt: EventTypes_2.MouseDownEventType, annotation: Annotation, handle: ToolHandle, interactionType?: string) => void;
639
- isPointNearTool: (element: HTMLElement, annotation: CrosshairsAnnotation, canvasCoords: Types_2.Point2, proximity: number) => boolean;
640
- toolSelectedCallback: (evt: EventTypes_2.MouseDownEventType, annotation: Annotation, interactionType: InteractionTypes) => void;
641
- onCameraModified: (evt: any) => void;
642
- mouseMoveCallback: (evt: EventTypes_2.MouseMoveEventType, filteredToolAnnotations: Annotations) => boolean;
643
- filterInteractableAnnotationsForElement: (element: any, annotations: any) => any;
644
- renderAnnotation: (enabledElement: Types_2.IEnabledElement, svgDrawingHelper: any) => void;
645
- _autoPanViewportIfNecessary(viewportId: string, renderingEngine: Types_2.IRenderingEngine): void;
646
- _areViewportIdArraysEqual: (viewportIdArrayOne: any, viewportIdArrayTwo: any) => boolean;
647
- _getAnnotationsForViewportsWithDifferentCameras: (enabledElement: any, annotations: any) => any;
648
- _filterLinkedViewportWithSameOrientationAndScene: (enabledElement: any, annotations: any) => any;
649
- _filterAnnotationsByUniqueViewportOrientations: (enabledElement: any, annotations: any) => any[];
650
- _checkIfViewportsRenderingSameScene: (viewport: any, otherViewport: any) => boolean;
651
- _jump: (enabledElement: any, jumpWorld: any) => boolean;
652
- _activateModify: (element: any) => void;
653
- _deactivateModify: (element: any) => void;
654
- _mouseUpCallback: (evt: EventTypes_2.MouseUpEventType | EventTypes_2.MouseClickEventType) => void;
655
- _mouseDragCallback: (evt: MouseDragEventType) => void;
656
- _isClockWise(a: any, b: any, c: any): boolean;
657
- _applyDeltaShiftToSelectedViewportCameras(renderingEngine: any, viewportsAnnotationsToUpdate: any, delta: any): void;
658
- _applyDeltaShiftToViewportCamera(renderingEngine: Types_2.IRenderingEngine, annotation: any, delta: any): void;
659
- _pointNearReferenceLine: (annotation: any, canvasCoords: any, proximity: any, lineViewport: any) => boolean;
660
- _getRotationHandleNearImagePoint(viewport: any, annotation: any, canvasCoords: any, proximity: any): any;
661
- _getSlabThicknessHandleNearImagePoint(viewport: any, annotation: any, canvasCoords: any, proximity: any): any;
662
- _pointNearTool(element: any, annotation: any, canvasCoords: any, proximity: any): boolean;
663
- }
664
-
665
- declare const CursorNames: string[];
666
-
667
- declare namespace cursors {
668
- export {
669
- MouseCursor,
670
- ImageMouseCursor,
671
- SVGMouseCursor,
672
- elementCursor,
673
- registerCursor,
674
- CursorNames,
675
- setCursorForElement
676
- }
677
- }
678
- export { cursors }
679
-
680
- declare interface CustomEvent_2<T = any> extends Event {
681
- /**
682
- * Returns any custom data event was created with. Typically used for synthetic events.
683
- */
684
- readonly detail: T
685
- initCustomEvent(
686
- typeArg: string,
687
- canBubbleArg: boolean,
688
- cancelableArg: boolean,
689
- detailArg: T
690
- ): void
691
- }
692
-
693
- declare function debounce(func: Function, wait?: number, options?: {
694
- leading?: boolean;
695
- maxWait?: number;
696
- trailing?: boolean;
697
- }): Function;
698
-
699
- declare function deepmerge(target?: {}, source?: {}, optionsArgument?: any): any;
700
-
701
- declare const _default: {
702
- filterAnnotationsWithinSlice: typeof filterAnnotationsWithinSlice;
703
- getWorldWidthAndHeightFromCorners: typeof getWorldWidthAndHeightFromCorners;
704
- filterAnnotationsForDisplay: typeof filterAnnotationsForDisplay;
705
- getPointInLineOfSightWithCriteria: typeof getPointInLineOfSightWithCriteria;
706
- };
707
-
708
- declare const _default_2: {
709
- snapFocalPointToSlice: typeof snapFocalPointToSlice;
710
- getSliceRange: typeof getSliceRange;
711
- scrollThroughStack: typeof scrollThroughStack;
712
- };
713
-
714
- export declare function destroy(): void;
715
-
716
- declare function destroy_2(): void;
717
-
718
- declare function destroy_3(): void;
719
-
720
- declare function destroySynchronizerById(synchronizerId: string): void;
721
-
722
- declare function destroyToolGroupById(toolGroupId: string): void;
723
-
724
- declare function distanceToPoint(lineStart: Types_2.Point2, lineEnd: Types_2.Point2, point: Types_2.Point2): number;
725
-
726
- declare function distanceToPoint_2(rect: number[], point: Types_2.Point2): number;
727
-
728
- declare function distanceToPointSquared(lineStart: Types_2.Point2, lineEnd: Types_2.Point2, point: Types_2.Point2): number;
729
-
730
- declare function draw(element: HTMLElement, fn: (svgDrawingElement: any) => any): void;
731
-
732
- declare function drawCircle(svgDrawingHelper: any, toolName: string, annotationUID: string, circleUID: string, center: Types_2.Point2, radius: number, options?: {}): void;
733
-
734
- declare function drawEllipse(svgDrawingHelper: any, toolName: string, annotationUID: string, ellipseUID: string, corner1: Types_2.Point2, corner2: Types_2.Point2, options?: {}): void;
735
-
736
- declare function drawHandles(svgDrawingHelper: any, toolName: string, annotationUID: string, handleGroupUID: string, handlePoints: Array<Types_2.Point2>, options?: {}): void;
737
-
738
- declare namespace drawing {
739
- export {
740
- draw,
741
- drawCircle,
742
- drawEllipse,
743
- drawHandles,
744
- drawLine,
745
- drawLinkedTextBox,
746
- drawRect,
747
- drawTextBox
748
- }
749
- }
750
- export { drawing }
751
-
752
- declare namespace drawing_2 {
753
- export {
754
- getTextBoxCoordsCanvas
755
- }
756
- }
757
-
758
- declare function drawLine(svgDrawingHelper: any, toolName: string, annotationUID: string, lineUID: string, start: Types_2.Point2, end: Types_2.Point2, options?: {}): void;
759
-
760
- declare function drawLinkedTextBox(svgDrawingHelper: Record<string, unknown>, toolName: string, annotationUID: string, textBoxUID: string, textLines: Array<string>, textBoxPosition: Types_2.Point2, annotationAnchorPoints: Array<Types_2.Point2>, textBox: unknown, options?: {}): SVGRect;
761
-
762
- declare function drawRect(svgDrawingHelper: any, toolName: string, annotationUID: string, rectangleUID: string, start: Types_2.Point2, end: Types_2.Point2, options?: {}): void;
763
-
764
- declare function drawTextBox(svgDrawingHelper: Record<string, unknown>, toolName: string, annotationUID: string, textUID: string, textLines: Array<string>, position: Types_2.Point2, options?: {}): SVGRect;
765
-
766
- declare namespace elementCursor {
767
- export {
768
- initElementCursor,
769
- resetElementCursor,
770
- hideElementCursor,
771
- _setElementCursor as setElementCursor
772
- }
773
- }
774
-
775
- /**
776
- * ELEMENT_DISABLED Event type
777
- */
778
- declare type ElementDisabledEvent = CustomEvent_2<ElementDisabledEventDetail>
779
-
780
- /**
781
- * ELEMENT_DISABLED Event's data
782
- */
783
- declare type ElementDisabledEventDetail = {
784
- /** Viewport HTML element in the DOM */
785
- element: HTMLElement
786
- /** Viewport Unique ID in the renderingEngine */
787
- viewportId: string
788
- /** Unique ID for the renderingEngine */
789
- renderingEngineId: string
790
- }
791
-
792
- /**
793
- * ELEMENT_ENABLED Event type
794
- */
795
- declare type ElementEnabledEvent = CustomEvent_2<ElementEnabledEventDetail>
796
-
797
- /**
798
- * ELEMENT_Enabled Event's data
799
- */
800
- declare type ElementEnabledEventDetail = {
801
- /** Viewport HTML element in the DOM */
802
- element: HTMLElement
803
- /** Viewport Unique ID in the renderingEngine */
804
- viewportId: string
805
- /** Unique ID for the renderingEngine */
806
- renderingEngineId: string
807
- }
808
-
809
- declare type Ellipse = {
810
- center: Types_2.Point3;
811
- xRadius: number;
812
- yRadius: number;
813
- zRadius: number;
814
- };
815
-
816
- declare namespace ellipse {
817
- export {
818
- pointInEllipse,
819
- getCanvasEllipseCorners
820
- }
821
- }
822
-
823
- declare interface EllipticalRoiAnnotation extends Annotation {
824
- data: {
825
- handles: {
826
- points: [Types_2.Point3, Types_2.Point3, Types_2.Point3, Types_2.Point3];
827
- activeHandleIndex: number | null;
828
- textBox?: {
829
- hasMoved: boolean;
830
- worldPosition: Types_2.Point3;
831
- worldBoundingBox: {
832
- topLeft: Types_2.Point3;
833
- topRight: Types_2.Point3;
834
- bottomLeft: Types_2.Point3;
835
- bottomRight: Types_2.Point3;
836
- };
837
- };
838
- };
839
- label: string;
840
- cachedStats?: {
841
- [targetId: string]: {
842
- Modality: string;
843
- area: number;
844
- max: number;
845
- mean: number;
846
- stdDev: number;
847
- };
848
- };
849
- };
850
- }
851
-
852
- export declare class EllipticalRoiTool extends AnnotationTool {
853
- static toolName: string;
854
- touchDragCallback: any;
855
- mouseDragCallback: any;
856
- _throttledCalculateCachedStats: any;
857
- editData: {
858
- annotation: any;
859
- viewportIdsToRender: Array<string>;
860
- handleIndex?: number;
861
- movingTextBox?: boolean;
862
- centerCanvas?: Array<number>;
863
- canvasWidth?: number;
864
- canvasHeight?: number;
865
- originalHandleCanvas?: Array<number>;
866
- newAnnotation?: boolean;
867
- hasMoved?: boolean;
868
- } | null;
869
- isDrawing: boolean;
870
- isHandleOutsideImage: boolean;
871
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
872
- addNewAnnotation: (evt: EventTypes_2.MouseDownActivateEventType) => EllipticalRoiAnnotation;
873
- isPointNearTool: (element: HTMLElement, annotation: EllipticalRoiAnnotation, canvasCoords: Types_2.Point2, proximity: number) => boolean;
874
- toolSelectedCallback: (evt: EventTypes_2.MouseDownEventType, annotation: EllipticalRoiAnnotation, interactionType: InteractionTypes) => void;
875
- handleSelectedCallback: (evt: EventTypes_2.MouseDownEventType, annotation: EllipticalRoiAnnotation, handle: ToolHandle, interactionType?: string) => void;
876
- _mouseUpCallback: (evt: EventTypes_2.MouseUpEventType | EventTypes_2.MouseClickEventType) => void;
877
- _mouseDragDrawCallback: (evt: MouseMoveEventType | MouseDragEventType) => void;
878
- _mouseDragModifyCallback: (evt: MouseDragEventType) => void;
879
- _dragHandle: (evt: any) => void;
880
- cancel: (element: HTMLElement) => any;
881
- _activateModify: (element: any) => void;
882
- _deactivateModify: (element: any) => void;
883
- _activateDraw: (element: any) => void;
884
- _deactivateDraw: (element: any) => void;
885
- renderAnnotation: (enabledElement: Types_2.IEnabledElement, svgDrawingHelper: any) => void;
886
- _getTextLines: (data: any, targetId: any) => any[];
887
- _calculateCachedStats: (annotation: any, viewport: any, renderingEngine: any, enabledElement: any) => any;
888
- _isInsideVolume: (index1: any, index2: any, dimensions: any) => boolean;
889
- _pointInEllipseCanvas(ellipse: any, location: Types_2.Point2): boolean;
890
- }
891
-
892
- export declare const Enums: {
893
- MouseBindings: typeof MouseBindings;
894
- KeyboardBindings: typeof KeyboardBindings;
895
- ToolModes: typeof ToolModes;
896
- Events: typeof Events;
897
- SegmentationRepresentations: typeof SegmentationRepresentations;
898
- };
899
-
900
- declare namespace Enums_2 {
901
- export {
902
- MouseBindings,
903
- KeyboardBindings,
904
- ToolModes,
905
- AnnotationStyleStates,
906
- Events,
907
- SegmentationRepresentations
908
- }
909
- }
910
-
911
- declare enum Events {
912
- ANNOTATION_ADDED = "CORNERSTONE_TOOLS_ANNOTATION_ADDED",
913
- ANNOTATION_MODIFIED = "CORNERSTONE_TOOLS_ANNOTATION_MODIFIED",
914
- ANNOTATION_REMOVED = "CORNERSTONE_TOOLS_ANNOTATION_REMOVED",
915
- ANNOTATION_SELECTION_CHANGE = "CORNERSTONE_TOOLS_ANNOTATION_SELECTION_CHANGE",
916
- ANNOTATION_LOCK_CHANGE = "CORNERSTONE_TOOLS_ANNOTATION_LOCK_CHANGE",
917
- ANNOTATION_RENDERED = "CORNERSTONE_TOOLS_ANNOTATION_RENDERED",
918
- SEGMENTATION_MODIFIED = "CORNERSTONE_TOOLS_SEGMENTATION_MODIFIED",
919
- SEGMENTATION_RENDERED = "CORNERSTONE_TOOLS_SEGMENTATION_RENDERED",
920
- SEGMENTATION_REPRESENTATION_MODIFIED = "CORNERSTONE_TOOLS_SEGMENTATION_REPRESENTATION_MODIFIED",
921
- SEGMENTATION_REPRESENTATION_REMOVED = "CORNERSTONE_TOOLS_SEGMENTATION_REPRESENTATION_REMOVED",
922
- SEGMENTATION_DATA_MODIFIED = "CORNERSTONE_TOOLS_SEGMENTATION_DATA_MODIFIED",
923
- KEY_DOWN = "CORNERSTONE_TOOLS_KEY_DOWN",
924
- KEY_UP = "CORNERSTONE_TOOLS_KEY_UP",
925
- MOUSE_DOWN = "CORNERSTONE_TOOLS_MOUSE_DOWN",
926
- MOUSE_UP = "CORNERSTONE_TOOLS_MOUSE_UP",
927
- MOUSE_DOWN_ACTIVATE = "CORNERSTONE_TOOLS_MOUSE_DOWN_ACTIVATE",
928
- MOUSE_DRAG = "CORNERSTONE_TOOLS_MOUSE_DRAG",
929
- MOUSE_MOVE = "CORNERSTONE_TOOLS_MOUSE_MOVE",
930
- MOUSE_CLICK = "CORNERSTONE_TOOLS_MOUSE_CLICK",
931
- MOUSE_DOUBLE_CLICK = "CORNERSTONE_TOOLS_MOUSE_DOUBLE_CLICK",
932
- MOUSE_WHEEL = "CORNERSTONE_TOOLS_MOUSE_WHEEL"
933
- }
934
-
935
- declare namespace EventTypes {
936
- export {
937
- CameraModifiedEventDetail,
938
- CameraModifiedEvent,
939
- VoiModifiedEvent,
940
- VoiModifiedEventDetail,
941
- ElementDisabledEvent,
942
- ElementDisabledEventDetail,
943
- ElementEnabledEvent,
944
- ElementEnabledEventDetail,
945
- ImageRenderedEventDetail,
946
- ImageRenderedEvent,
947
- ImageVolumeModifiedEvent,
948
- ImageVolumeModifiedEventDetail,
949
- ImageLoadedEvent,
950
- ImageLoadedEventDetail,
951
- ImageLoadedFailedEventDetail,
952
- ImageLoadedFailedEvent,
953
- VolumeLoadedEvent,
954
- VolumeLoadedEventDetail,
955
- VolumeLoadedFailedEvent,
956
- VolumeLoadedFailedEventDetail,
957
- ImageCacheImageAddedEvent,
958
- ImageCacheImageAddedEventDetail,
959
- ImageCacheImageRemovedEvent,
960
- ImageCacheImageRemovedEventDetail,
961
- VolumeCacheVolumeAddedEvent,
962
- VolumeCacheVolumeAddedEventDetail,
963
- VolumeCacheVolumeRemovedEvent,
964
- VolumeCacheVolumeRemovedEventDetail,
965
- StackNewImageEvent,
966
- StackNewImageEventDetail,
967
- ImageSpacingCalibratedEvent,
968
- ImageSpacingCalibratedEventDetail,
969
- ImageLoadProgressEvent,
970
- ImageLoadProgressEventDetail
971
- }
972
- }
973
-
974
- declare namespace EventTypes_2 {
975
- export {
976
- NormalizedMouseEventDetail,
977
- NormalizedMouseEventType,
978
- AnnotationAddedEventDetail,
979
- AnnotationAddedEventType,
980
- AnnotationModifiedEventDetail,
981
- AnnotationModifiedEventType,
982
- AnnotationRemovedEventDetail,
983
- AnnotationRemovedEventType,
984
- AnnotationSelectionChangeEventDetail,
985
- AnnotationSelectionChangeEventType,
986
- AnnotationRenderedEventDetail,
987
- AnnotationRenderedEventType,
988
- AnnotationLockChangeEventDetail,
989
- AnnotationLockChangeEventType,
990
- SegmentationDataModifiedEventType,
991
- SegmentationRepresentationModifiedEventDetail,
992
- SegmentationRepresentationModifiedEventType,
993
- SegmentationRepresentationRemovedEventDetail,
994
- SegmentationRepresentationRemovedEventType,
995
- SegmentationDataModifiedEventDetail,
996
- SegmentationRenderedEventType,
997
- SegmentationRenderedEventDetail,
998
- SegmentationModifiedEventType,
999
- SegmentationModifiedEventDetail,
1000
- KeyDownEventDetail,
1001
- KeyDownEventType,
1002
- KeyUpEventDetail,
1003
- KeyUpEventType,
1004
- MouseDownEventDetail,
1005
- MouseDownEventType,
1006
- MouseDownActivateEventDetail,
1007
- MouseDownActivateEventType,
1008
- MouseDragEventDetail,
1009
- MouseDragEventType,
1010
- MouseUpEventDetail,
1011
- MouseUpEventType,
1012
- MouseClickEventDetail,
1013
- MouseClickEventType,
1014
- MouseMoveEventDetail,
1015
- MouseMoveEventType,
1016
- MouseDoubleClickEventDetail,
1017
- MouseDoubleClickEventType,
1018
- MouseWheelEventDetail,
1019
- MouseWheelEventType
1020
- }
1021
- }
1022
-
1023
- declare function extend2DBoundingBoxInViewAxis(boundsIJK: [Types_2.Point2, Types_2.Point2, Types_2.Point2], numSlicesToProject: number): [Types_2.Point2, Types_2.Point2, Types_2.Point2];
1024
-
1025
- declare function filterAnnotationsForDisplay(viewport: Types_2.IViewport, annotations: Annotations): Annotations;
1026
-
1027
- declare function filterAnnotationsWithinSlice(annotations: Annotations, camera: Types_2.ICamera, spacingInNormalDirection: number): Annotations;
1028
-
1029
- declare interface FilterInterface {
1030
- FrameOfReferenceUID?: string;
1031
- toolName?: string;
1032
- }
1033
-
1034
- declare function filterViewportsWithFrameOfReferenceUID(viewports: Array<Types_2.IStackViewport | Types_2.IVolumeViewport>, FrameOfReferenceUID: string): Array<Types_2.IStackViewport | Types_2.IVolumeViewport>;
1035
-
1036
- declare function filterViewportsWithToolEnabled(viewports: Array<Types_2.IStackViewport | Types_2.IVolumeViewport>, toolName: string): Array<Types_2.IStackViewport | Types_2.IVolumeViewport>;
1037
-
1038
- declare function findClosestPoint(sourcePoints: Array<Types_2.Point2>, targetPoint: Types_2.Point2): Types_2.Point2;
1039
-
1040
- /**
1041
- * Flip direction which can be horizontal or vertical.
1042
- */
1043
- declare type FlipDirection = {
1044
- flipHorizontal?: boolean
1045
- flipVertical?: boolean
1046
- }
1047
-
1048
- declare class FrameOfReferenceSpecificAnnotationManager {
1049
- private annotations;
1050
- readonly uid: string;
1051
- constructor(uid?: string);
1052
- _imageVolumeModifiedHandler: (evt: Types_2.EventTypes.ImageVolumeModifiedEvent) => void;
1053
- getFramesOfReference: () => Array<string>;
1054
- getFrameOfReferenceAnnotations: (FrameOfReferenceUID: string) => FrameOfReferenceSpecificAnnotations;
1055
- get: (FrameOfReferenceUID: string, toolName: string) => Annotations | undefined;
1056
- getAnnotation: (annotationUID: string, filter?: FilterInterface) => Annotation | undefined;
1057
- addAnnotation: (annotation: Annotation) => void;
1058
- removeAnnotation: (annotationUID: string, filter?: FilterInterface) => void;
1059
- saveAnnotations: (FrameOfReferenceUID?: string, toolName?: string) => AnnotationState | FrameOfReferenceSpecificAnnotations | Annotations;
1060
- restoreAnnotations: (state: AnnotationState | FrameOfReferenceSpecificAnnotations | Annotations, FrameOfReferenceUID?: string, toolName?: string) => void;
1061
- private _getToolSpecificAnnotationsAndIndex;
1062
- }
1063
-
1064
- declare type FrameOfReferenceSpecificAnnotations = {
1065
- [key: string]: Annotations;
1066
- };
1067
-
1068
- declare function getActiveSegmentationRepresentation(toolGroupId: string): ToolGroupSpecificRepresentation;
1069
-
1070
- declare function getActiveSegmentIndex(toolGroupId: string): number | undefined;
1071
-
1072
- declare function getActiveSegmentIndexForSegmentation(segmentationId: string): number | undefined;
1073
-
1074
- declare function getAllSynchronizers(): Array<Synchronizer>;
1075
-
1076
- declare function getAllToolGroups(): Array<IToolGroup>;
1077
-
1078
- declare function getAnnotation(annotationUID: string, element?: HTMLElement): Annotation;
1079
-
1080
- declare function getAnnotationNearPoint(element: HTMLElement, canvasPoint: Types_2.Point2, proximity?: number): Annotation | null;
1081
-
1082
- declare function getAnnotationNearPointOnEnabledElement(enabledElement: Types_2.IEnabledElement, point: Types_2.Point2, proximity: number): Annotation | null;
1083
-
1084
- declare function getAnnotations(element: HTMLElement, toolName: string): Annotations;
1085
-
1086
- declare function getAnnotationSelected(annotationUID: string): Annotation;
1087
-
1088
- declare function getAnnotationsLocked(): Array<Annotation>;
1089
-
1090
- declare function getAnnotationsLockedCount(): number;
1091
-
1092
- declare function getAnnotationsSelected(): Array<Annotation>;
1093
-
1094
- declare function getAnnotationsSelectedByToolName(toolName: string): Array<Annotation>;
1095
-
1096
- declare function getAnnotationsSelectedCount(): number;
1097
-
1098
- declare function getBoundingBoxAroundShape(vertices: Types_2.Point3[], dimensions?: Types_2.Point3): [Types_2.Point2, Types_2.Point2, Types_2.Point2];
1099
-
1100
- declare function getCanvasEllipseCorners(ellipseCanvasPoints: canvasCoordinates): Array<Types_2.Point2>;
1101
-
1102
- declare function getColorForSegmentIndex(toolGroupId: string, segmentationRepresentationUID: string, segmentIndex: number): Color;
1103
-
1104
- declare function getColorLut(index: number): ColorLut | undefined;
1105
-
1106
- declare function getDefaultAnnotationManager(): FrameOfReferenceSpecificAnnotationManager;
1107
-
1108
- declare function getDefaultRepresentationConfig(segmentation: Segmentation): labelmapConfig;
1109
-
1110
- declare function getDefaultSegmentationStateManager(): SegmentationStateManager;
1111
-
1112
- declare function getFont(settings?: Settings, state?: AnnotationStyleStates, mode?: ToolModes): string;
1113
-
1114
- declare function getGlobalConfig(): SegmentationRepresentationConfig;
1115
-
1116
- declare function getGlobalConfig_2(): SegmentationRepresentationConfig;
1117
-
1118
- declare function getGlobalRepresentationConfig(representationType: SegmentationRepresentations): RepresentationConfig['LABELMAP'];
1119
-
1120
- declare function getPointInLineOfSightWithCriteria(viewport: Types_2.IVolumeViewport, worldPos: Types_2.Point3, targetVolumeId: string, criteriaFunction: (intensity: number, point: Types_2.Point3) => Types_2.Point3, stepSize?: number): Types_2.Point3;
1121
-
1122
- declare function getSegmentation(segmentationId: string): Segmentation | undefined;
1123
-
1124
- declare function getSegmentationRepresentationByUID(toolGroupId: string, segmentationRepresentationUID: string): ToolGroupSpecificRepresentation | undefined;
1125
-
1126
- declare function getSegmentationRepresentations(toolGroupId: string): ToolGroupSpecificRepresentation[] | [];
1127
-
1128
- declare function getSegmentations(): Segmentation[] | [];
1129
-
1130
- declare function getSegmentationVisibility(toolGroupId: string, segmentationRepresentationUID: string): boolean | undefined;
1131
-
1132
- declare function getSegmentIndexLocked(toolGroupId: string, segmentIndex: number): boolean;
1133
-
1134
- declare function getSegmentIndexLockedForSegmentation(segmentationId: string, segmentIndex: number): boolean;
1135
-
1136
- declare function getSegmentsLockedForSegmentation(segmentationId: string): number[] | [];
1137
-
1138
- declare function getSliceRange(volumeActor: Types_2.VolumeActor, viewPlaneNormal: Types_2.Point3, focalPoint: Types_2.Point3): {
1139
- min: number;
1140
- max: number;
1141
- current: number;
1142
- };
1143
-
1144
- declare function getState(annotation?: Annotation): AnnotationStyleStates;
1145
-
1146
- declare function getStyle(toolName?: string, annotation?: Record<string, unknown>): Settings;
1147
-
1148
- declare function getSynchronizerById(synchronizerId: string): Synchronizer | void;
1149
-
1150
- declare function getSynchronizers(renderingEngineId: string, viewportId: string): Array<Synchronizer>;
1151
-
1152
- declare function getTextBoxCoordsCanvas(annotationCanvasPoints: Array<Types_2.Point2>): Types_2.Point2;
1153
-
1154
- declare function getToolGroup(viewportId: string, renderingEngineId: string): IToolGroup | undefined;
1155
-
1156
- declare function getToolGroupById(toolGroupId: string): IToolGroup | undefined;
1157
-
1158
- declare function getToolGroupSpecificConfig(toolGroupId: string): SegmentationRepresentationConfig;
1159
-
1160
- declare function getToolGroupSpecificConfig_2(toolGroupId: string): SegmentationRepresentationConfig;
1161
-
1162
- declare function getToolGroupsWithSegmentation(segmentationId: string): string[];
1163
-
1164
- declare function getViewportIdsWithToolToRender(element: HTMLElement, toolName: string, requireSameOrientation?: boolean): string[];
1165
-
1166
- declare function getViewportSpecificAnnotationManager(element?: Types_2.IEnabledElement | HTMLElement): FrameOfReferenceSpecificAnnotationManager;
1167
-
1168
- declare function getWorldWidthAndHeightFromCorners(viewPlaneNormal: Types_2.Point3, viewUp: Types_2.Point3, topLeftWorld: Types_2.Point3, bottomRightWorld: Types_2.Point3): {
1169
- worldWidth: number;
1170
- worldHeight: number;
1171
- };
1172
-
1173
- declare function hideElementCursor(element: HTMLElement): void;
1174
-
1175
- declare interface IBaseTool {
1176
- toolGroupId: string;
1177
- supportedInteractionTypes: InteractionTypes[];
1178
- mode: ToolModes;
1179
- configuration: {
1180
- preventHandleOutsideImage?: boolean;
1181
- strategies?: Record<string, any>;
1182
- defaultStrategy?: string;
1183
- activeStrategy?: string;
1184
- strategyOptions?: Record<string, unknown>;
1185
- };
1186
- }
1187
-
1188
- declare interface ICache {
1189
- /** Set the maximum cache size */
1190
- setMaxCacheSize: (maxCacheSize: number) => void
1191
- /** Get the maximum cache size */
1192
- getMaxCacheSize: () => number
1193
- /** Get the current cache size */
1194
- getCacheSize: () => number
1195
- /** Stores the imageLoad Object inside the cache */
1196
- putImageLoadObject: (
1197
- imageId: string,
1198
- imageLoadObject: IImageLoadObject
1199
- ) => Promise<any>
1200
- /** Retrieves the imageLoad Object from the cache */
1201
- getImageLoadObject: (imageId: string) => IImageLoadObject | void
1202
- /** Stores the volumeLoad Object inside the cache */
1203
- putVolumeLoadObject: (
1204
- volumeId: string,
1205
- volumeLoadObject: IVolumeLoadObject
1206
- ) => Promise<any>
1207
- /** Retrieves the volumeLoad Object from the cache */
1208
- getVolumeLoadObject: (volumeId: string) => IVolumeLoadObject | void
1209
- /** Purge cache both image and volume */
1210
- purgeCache: () => void
1211
- }
1212
-
1213
- declare interface ICachedImage {
1214
- image?: IImage
1215
- imageId: string
1216
- imageLoadObject: IImageLoadObject
1217
- loaded: boolean
1218
- sharedCacheKey?: string
1219
- timeStamp: number
1220
- sizeInBytes: number
1221
- }
1222
-
1223
- declare interface ICachedVolume {
1224
- volume?: IImageVolume
1225
- volumeId: string
1226
- volumeLoadObject: IVolumeLoadObject
1227
- loaded: boolean
1228
- timeStamp: number
1229
- sizeInBytes: number
1230
- }
1231
-
1232
- /**
1233
- * Camera Interface. See {@link https://kitware.github.io/vtk-examples/site/VTKBook/03Chapter3/#35-cameras} if you
1234
- * want to know more about the camera.
1235
- */
1236
- declare interface ICamera {
1237
- /** Camera Clipping range*/
1238
- clippingRange?: Point2
1239
- /** Camera Focal point */
1240
- focalPoint?: Point3
1241
- /** Camera Parallel Projection flag - whether camera is using parallel projection */
1242
- parallelProjection?: boolean
1243
- /** Camera parallel scale - used for parallel projection zoom, smaller values zoom in */
1244
- parallelScale?: number
1245
- /** Camera position */
1246
- position?: Point3
1247
- /** Camera view angle - 90 degrees is orthographic */
1248
- viewAngle?: number
1249
- /** Camera viewPlaneNormal - negative of the direction the camera is pointing or directionOfProjection*/
1250
- viewPlaneNormal?: Point3
1251
- /** Camera viewUp - the direction of viewUP in camera */
1252
- viewUp?: Point3
1253
- /** Camera Slab Thickness */
1254
- slabThickness?: number
1255
- }
1256
-
1257
- /**
1258
- * Cornerstone Enabled Element interface
1259
- */
1260
- declare interface IEnabledElement {
1261
- /** Cornerstone Viewport instance - can be Stack or Volume Viewport as of now */
1262
- viewport: IStackViewport | IVolumeViewport
1263
- /** Cornerstone Rendering Engine instance */
1264
- renderingEngine: IRenderingEngine
1265
- /** Unique ID of the viewport in the renderingEngine */
1266
- viewportId: string
1267
- /** Unique ID of the renderingEngine */
1268
- renderingEngineId: string
1269
- /** FrameOfReference the enabledElement is rendering inside */
1270
- FrameOfReferenceUID: string
1271
- }
1272
-
1273
- /**
1274
- * Cornerstone Image interface, it is used for both CPU and GPU rendering
1275
- */
1276
- declare interface IImage {
1277
- /** Image Id */
1278
- imageId: string
1279
- sharedCacheKey?: string
1280
- /** minimum pixel value of the image */
1281
- minPixelValue: number
1282
- /* maximum pixel value of the image */
1283
- maxPixelValue: number
1284
- /** slope from metadata for scaling */
1285
- slope: number
1286
- /** intercept from metadata for scaling */
1287
- intercept: number
1288
- /** windowCenter from metadata */
1289
- windowCenter: number[] | number
1290
- /** windowWidth from metadata */
1291
- windowWidth: number[] | number
1292
- /** function that returns the pixelData as an array */
1293
- getPixelData: () => Array<number>
1294
- getCanvas: () => HTMLCanvasElement
1295
- /** image number of rows */
1296
- rows: number
1297
- /** image number of columns */
1298
- columns: number
1299
- /** image height */
1300
- height: number
1301
- /** image width */
1302
- width: number
1303
- /** is image a color image */
1304
- color: boolean
1305
- /** is image rgb and alpha */
1306
- rgba: boolean
1307
- /** number of components in the image */
1308
- numComps: number
1309
- /** CPU: custom render method for the image */
1310
- render?: (
1311
- enabledElement: CPUFallbackEnabledElement,
1312
- invalidated: boolean
1313
- ) => unknown
1314
- /** column pixel spacing */
1315
- columnPixelSpacing: number
1316
- /** row pixel spacing */
1317
- rowPixelSpacing: number
1318
- /** slice thickness */
1319
- sliceThickness?: number
1320
- /** whether image pixels are inverted in color */
1321
- invert: boolean
1322
- /** image size in number of bytes */
1323
- sizeInBytes: number
1324
- /** CPU: custom modality LUT for image */
1325
- modalityLUT?: CPUFallbackLUT
1326
- /** CPU: custom VOI LUT for image */
1327
- voiLUT?: CPUFallbackLUT
1328
- /** CPU: custom color map for image */
1329
- colormap?: CPUFallbackColormap
1330
- /** image scaling metadata - including PT suv values */
1331
- scaling?: {
1332
- PET?: {
1333
- // @TODO: Do these values exist?
1334
- SUVlbmFactor?: number
1335
- SUVbsaFactor?: number
1336
- // accessed in ProbeTool
1337
- suvbwToSuvlbm?: number
1338
- suvbwToSuvbsa?: number
1339
- }
1340
- }
1341
- /** CPU: image statistics for rendering */
1342
- stats?: {
1343
- lastStoredPixelDataToCanvasImageDataTime?: number
1344
- lastGetPixelDataTime?: number
1345
- lastPutImageDataTime?: number
1346
- lastLutGenerateTime?: number
1347
- lastRenderedViewport?: unknown
1348
- lastRenderTime?: number
1349
- }
1350
- /** CPU: image cached LUT */
1351
- cachedLut?: {
1352
- windowWidth?: number | number[]
1353
- windowCenter?: number | number[]
1354
- invert?: boolean
1355
- lutArray?: Uint8ClampedArray
1356
- modalityLUT?: unknown
1357
- voiLUT?: CPUFallbackLUT
1358
- }
1359
- }
1360
-
1361
- /**
1362
- * IImageData of an image, which stores actual scalarData and metaData about the image.
1363
- * IImageData is different from vtkImageData.
1364
- */
1365
- declare interface IImageData {
1366
- /** image dimensions */
1367
- dimensions: Point3
1368
- /** image direction */
1369
- direction: Float32Array
1370
- /** image spacing */
1371
- spacing: Point3
1372
- /** image origin */
1373
- origin: Point3
1374
- /** image scalarData which stores the array of pixelData */
1375
- scalarData: Float32Array
1376
- /** vtkImageData object */
1377
- imageData: vtkImageData
1378
- /** image metadata - currently only modality */
1379
- metadata: { Modality: string }
1380
- /** image scaling for scaling pixelArray */
1381
- scaling?: Scaling
1382
- }
1383
-
1384
- /**
1385
- * ImageLoadObject interface which any imageLoader should return
1386
- */
1387
- declare interface IImageLoadObject {
1388
- /** promise that resolves to an image */
1389
- promise: Promise<IImage>
1390
- /** optional cancel function for loading*/
1391
- cancel?: () => void
1392
- /** optional decache function */
1393
- decache?: () => void
1394
- }
1395
-
1396
- /**
1397
- * Cornerstone ImageVolume interface. Todo: we should define new IVolume class
1398
- * with appropriate typings for the other types of volume that don't have images (nrrd, nifti)
1399
- */
1400
- declare interface IImageVolume {
1401
- /** unique identifier of the volume in the cache */
1402
- readonly volumeId: string
1403
- /** volume dimensions */
1404
- dimensions: Point3
1405
- /** volume direction */
1406
- direction: Float32Array
1407
- /** volume metadata */
1408
- metadata: Metadata
1409
- /** volume origin - set to the imagePositionPatient of the last image in the volume */
1410
- origin: Point3
1411
- /** volume scalar data */
1412
- scalarData: any
1413
- /** volume scaling metadata */
1414
- scaling?: {
1415
- PET?: {
1416
- SUVlbmFactor?: number
1417
- SUVbsaFactor?: number
1418
- suvbwToSuvlbm?: number
1419
- suvbwToSuvbsa?: number
1420
- }
1421
- }
1422
- /** volume size in bytes */
1423
- sizeInBytes?: number
1424
- /** volume spacing */
1425
- spacing: Point3
1426
- /** number of voxels in the volume */
1427
- numVoxels: number
1428
- /** volume image data as vtkImageData */
1429
- imageData?: vtkImageData
1430
- /** openGL texture for the volume */
1431
- vtkOpenGLTexture: any
1432
- /** loading status object for the volume containing loaded/loading statuses */
1433
- loadStatus?: Record<string, any>
1434
- /** imageIds of the volume (if it is built of separate imageIds) */
1435
- imageIds?: Array<string>
1436
- /** volume referencedVolumeId (if it is derived from another volume) */
1437
- referencedVolumeId?: string // if volume is derived from another volume
1438
- /** method to convert the volume data in the volume cache, to separate images in the image cache */
1439
- convertToCornerstoneImage?: (
1440
- imageId: string,
1441
- imageIdIndex: number
1442
- ) => IImageLoadObject
1443
- }
1444
-
1445
- /**
1446
- * IMAGE_CACHE_IMAGE_ADDED Event type
1447
- */
1448
- declare type ImageCacheImageAddedEvent =
1449
- CustomEvent_2<ImageCacheImageAddedEventDetail>
1450
-
1451
- /**
1452
- * IMAGE_CACHE_IMAGE_ADDED Event's data
1453
- */
1454
- declare type ImageCacheImageAddedEventDetail = {
1455
- /** the added image */
1456
- image: ICachedImage
1457
- }
1458
-
1459
- /**
1460
- * IMAGE_CACHE_IMAGE_REMOVED Event type
1461
- */
1462
- declare type ImageCacheImageRemovedEvent =
1463
- CustomEvent_2<ImageCacheImageRemovedEventDetail>
1464
-
1465
- /**
1466
- * IMAGE_CACHE_IMAGE_REMOVED Event's data
1467
- */
1468
- declare type ImageCacheImageRemovedEventDetail = {
1469
- /** the removed image id */
1470
- imageId: string
1471
- }
1472
-
1473
- /**
1474
- * IMAGE_LOADED Event type
1475
- */
1476
- declare type ImageLoadedEvent = CustomEvent_2<ImageLoadedEventDetail>
1477
-
1478
- /**
1479
- * IMAGE_LOADED Event's data
1480
- */
1481
- declare type ImageLoadedEventDetail = {
1482
- /** the loaded image */
1483
- image: IImage
1484
- }
1485
-
1486
- /**
1487
- * IMAGE_LOADED_FAILED Event type
1488
- */
1489
- declare type ImageLoadedFailedEvent = CustomEvent_2<ImageLoadedFailedEventDetail>
1490
-
1491
- /**
1492
- * IMAGE_LOADED_FAILED Event's data
1493
- */
1494
- declare type ImageLoadedFailedEventDetail = {
1495
- /** the imageId for the image */
1496
- imageId: string
1497
- error: unknown
1498
- }
1499
-
1500
- /**
1501
- * Any imageLoader function should implement a loading given the imageId
1502
- * and returns a mandatory promise which will resolve to the loaded image object.
1503
- * Additional `cancelFn` and `decache` can be implemented.
1504
- */
1505
- declare type ImageLoaderFn = (
1506
- imageId: string,
1507
- options?: Record<string, any>
1508
- ) => {
1509
- /** Promise that resolves to the image object */
1510
- promise: Promise<Record<string, any>>
1511
- cancelFn?: () => void | undefined
1512
- decache?: () => void | undefined
1513
- }
1514
-
1515
- /**
1516
- * IMAGE_LOAD_PROGRESS
1517
- */
1518
- declare type ImageLoadProgressEvent = CustomEvent_2<ImageLoadProgressEventDetail>
1519
-
1520
- /**
1521
- * IMAGE_LOAD_PROGRESS Event's data. Note this is only for one image load and NOT volume load.
1522
- */
1523
- declare type ImageLoadProgressEventDetail = {
1524
- /** url we are loading from */
1525
- url: string
1526
- /** loading image image id */
1527
- imageId: string
1528
- /** the bytes browser receive */
1529
- loaded: number
1530
- /** the total bytes settled by the header */
1531
- total: number
1532
- /** loaded divided by total * 100 - shows the percentage of the image loaded */
1533
- percent: number
1534
- }
1535
-
1536
- declare class ImageMouseCursor extends MouseCursor {
1537
- private url;
1538
- private x;
1539
- private y;
1540
- constructor(url: string, x?: number, y?: number, name?: string | undefined, fallback?: MouseCursor | undefined);
1541
- getStyleProperty(): string;
1542
- static getUniqueInstanceName(prefix: string): string;
1543
- }
1544
-
1545
- /**
1546
- * IMAGE_RENDERED Event type
1547
- */
1548
- declare type ImageRenderedEvent = CustomEvent_2<ElementEnabledEventDetail>
1549
-
1550
- /**
1551
- * IMAGE_RENDERED Event's data
1552
- */
1553
- declare type ImageRenderedEventDetail = {
1554
- /** Viewport HTML element in the DOM */
1555
- element: HTMLElement
1556
- /** Viewport Unique ID in the renderingEngine */
1557
- viewportId: string
1558
- /** Unique ID for the renderingEngine */
1559
- renderingEngineId: string
1560
- /** Whether to suppress the event */
1561
- suppressEvents?: boolean
1562
- }
1563
-
1564
- /**
1565
- * IMAGE_SPACING_CALIBRATED
1566
- */
1567
- declare type ImageSpacingCalibratedEvent =
1568
- CustomEvent_2<ImageSpacingCalibratedEventDetail>
1569
-
1570
- /**
1571
- * IMAGE_SPACING_CALIBRATED Event's data
1572
- */
1573
- declare type ImageSpacingCalibratedEventDetail = {
1574
- element: HTMLElement
1575
- viewportId: string
1576
- renderingEngineId: string
1577
- imageId: string
1578
- rowScale: number
1579
- columnScale: number
1580
- imageData: vtkImageData
1581
- worldToIndex: mat4
1582
- }
1583
-
1584
- /** The base class for volume data. It includes the volume metadata
1585
- * and the volume data along with the loading status.
1586
- */
1587
- declare class ImageVolume implements IImageVolume {
1588
- /** Read-only unique identifier for the volume */
1589
- readonly volumeId: string
1590
- /** Dimensions of the volume */
1591
- dimensions: Point3
1592
- /** volume direction in world space */
1593
- direction: Float32Array
1594
- /** volume metadata */
1595
- metadata: Metadata
1596
- /** volume origin, Note this is an opinionated origin for the volume */
1597
- origin: Point3
1598
- /** volume scalar data */
1599
- scalarData: Float32Array | Uint8Array
1600
- /** volume scaling parameters if it contains scaled data */
1601
- scaling?: {
1602
- PET?: {
1603
- // @TODO: Do these values exist?
1604
- SUVlbmFactor?: number
1605
- SUVbsaFactor?: number
1606
- // accessed in ProbeTool
1607
- suvbwToSuvlbm?: number
1608
- suvbwToSuvbsa?: number
1609
- }
1610
- }
1611
- /** volume size in bytes */
1612
- sizeInBytes?: number // Seems weird to pass this in? Why not grab it from scalarData.byteLength
1613
- /** volume spacing in 3d world space */
1614
- spacing: Point3
1615
- /** volume number of voxels */
1616
- numVoxels: number
1617
- /** volume image data */
1618
- imageData?: any
1619
- /** open gl texture for the volume */
1620
- vtkOpenGLTexture: any // No good way of referencing vtk classes as they aren't classes.
1621
- /** load status object for the volume */
1622
- loadStatus?: Record<string, any>
1623
- /** optional image ids for the volume if it is made of separated images */
1624
- imageIds?: Array<string>
1625
- /** optional reference volume id if the volume is derived from another volume */
1626
- referencedVolumeId?: string
1627
-
1628
- constructor(props: IVolume) {
1629
- this.volumeId = props.volumeId
1630
- this.metadata = props.metadata
1631
- this.dimensions = props.dimensions
1632
- this.spacing = props.spacing
1633
- this.origin = props.origin
1634
- this.direction = props.direction
1635
- this.imageData = props.imageData
1636
- this.scalarData = props.scalarData
1637
- this.sizeInBytes = props.sizeInBytes
1638
- this.vtkOpenGLTexture = vtkStreamingOpenGLTexture.newInstance()
1639
- this.numVoxels =
1640
- this.dimensions[0] * this.dimensions[1] * this.dimensions[2]
1641
-
1642
- if (props.scaling) {
1643
- this.scaling = props.scaling
1644
- }
1645
-
1646
- if (props.referencedVolumeId) {
1647
- this.referencedVolumeId = props.referencedVolumeId
1648
- }
1649
- }
1650
- }
1651
-
1652
- /**
1653
- * IMAGE_VOLUME_MODIFIED Event type
1654
- */
1655
- declare type ImageVolumeModifiedEvent = CustomEvent_2<ImageVolumeModifiedEventDetail>
1656
-
1657
- /**
1658
- * IMAGE_VOLUME_MODIFIED Event's data
1659
- */
1660
- declare type ImageVolumeModifiedEventDetail = {
1661
- /** the modified volume */
1662
- imageVolume: IImageVolume
1663
- /** FrameOfReferenceUID where the volume belongs to */
1664
- FrameOfReferenceUID: string
1665
- }
1666
-
1667
- export declare function init(defaultConfiguration?: {}): void;
1668
-
1669
- declare function initElementCursor(element: HTMLElement, cursor: MouseCursor | null): void;
1670
-
1671
- declare type InteractionTypes = 'Mouse';
1672
-
1673
- /**
1674
- * Interpolation types for image rendering
1675
- */
1676
- declare enum InterpolationType {
1677
- /** nearest neighbor interpolation */
1678
- NEAREST,
1679
- /** linear interpolation - Default */
1680
- LINEAR,
1681
- /** */
1682
- FAST_LINEAR,
1683
- }
1684
-
1685
- declare function intersectLine(line1Start: Types_2.Point2, line1End: Types_2.Point2, line2Start: Types_2.Point2, line2End: Types_2.Point2): number[];
1686
-
1687
- declare type IPoints = {
1688
- page: Types_2.Point2;
1689
- client: Types_2.Point2;
1690
- canvas: Types_2.Point2;
1691
- world: Types_2.Point3;
1692
- };
1693
-
1694
- /**
1695
- * Register image loader interface
1696
- */
1697
- declare interface IRegisterImageLoader {
1698
- registerImageLoader: (scheme: string, imageLoader: ImageLoaderFn) => void
1699
- }
1700
-
1701
- declare interface IRenderingEngine {
1702
- id: string
1703
- hasBeenDestroyed: boolean
1704
- offscreenMultiRenderWindow: any
1705
- offScreenCanvasContainer: any
1706
- setViewports(viewports: Array<PublicViewportInput>): void
1707
- resize(): void
1708
- getViewport(id: string): IStackViewport | IVolumeViewport
1709
- getViewports(): Array<IStackViewport | IVolumeViewport>
1710
- render(): void
1711
- renderViewports(viewportIds: Array<string>): void
1712
- renderViewport(viewportId: string): void
1713
- renderFrameOfReference(FrameOfReferenceUID: string): void
1714
- fillCanvasWithBackgroundColor(
1715
- canvas: HTMLCanvasElement,
1716
- backgroundColor: [number, number, number]
1717
- ): void
1718
- enableElement(viewportInputEntry: PublicViewportInput): void
1719
- disableElement(viewportId: string): void
1720
- getStackViewports(): Array<IStackViewport>
1721
- getVolumeViewports(): Array<IVolumeViewport>
1722
- destroy(): void
1723
- _debugRender(): void
1724
- }
1725
-
1726
- declare function isAnnotationLocked(annotation: Annotation): boolean;
1727
-
1728
- declare function isAnnotationSelected(annotation: Annotation): boolean;
1729
-
1730
- declare function isObject(value: any): boolean;
1731
-
1732
- /**
1733
- * Interface for Stack Viewport
1734
- */
1735
- declare interface IStackViewport extends IViewport {
1736
- modality: string
1737
- /** Scaling parameters */
1738
- scaling: Scaling
1739
- /**
1740
- * Resizes the viewport - only used in CPU fallback for StackViewport. The
1741
- * GPU resizing happens inside the RenderingEngine.
1742
- */
1743
- resize: () => void
1744
- /**
1745
- * Returns the frame of reference UID, if the image doesn't have imagePlaneModule
1746
- * metadata, it returns undefined, otherwise, frameOfReferenceUID is returned.
1747
- */
1748
- getFrameOfReferenceUID: () => string
1749
- /**
1750
- * Sets the properties for the viewport on the default actor. Properties include
1751
- * setting the VOI, inverting the colors and setting the interpolation type, rotation
1752
- * and flipHorizontal/Vertical.
1753
- */
1754
- setProperties({
1755
- voiRange,
1756
- invert,
1757
- interpolationType,
1758
- rotation,
1759
- flipHorizontal,
1760
- flipVertical,
1761
- }: StackViewportProperties): void
1762
- /**
1763
- * Retrieve the viewport properties
1764
- */
1765
- getProperties: () => StackViewportProperties
1766
- /**
1767
- * canvasToWorld Returns the world coordinates of the given `canvasPos`
1768
- * projected onto the plane defined by the `Viewport`'s camera.
1769
- */
1770
- canvasToWorld: (canvasPos: Point2) => Point3
1771
- /**
1772
- * Returns the canvas coordinates of the given `worldPos`
1773
- * projected onto the `Viewport`'s `canvas`.
1774
- */
1775
- worldToCanvas: (worldPos: Point3) => Point2
1776
- /**
1777
- * Returns the index of the imageId being renderer
1778
- */
1779
- getCurrentImageIdIndex: () => number
1780
- /**
1781
- * Returns the list of image Ids for the current viewport
1782
- */
1783
- getImageIds: () => string[]
1784
- /**
1785
- * Returns the currently rendered imageId
1786
- */
1787
- getCurrentImageId: () => string
1788
- /**
1789
- * Custom rendering pipeline for the rendering for the CPU fallback
1790
- */
1791
- customRenderViewportToCanvas: () => {
1792
- canvas: HTMLCanvasElement
1793
- element: HTMLElement
1794
- viewportId: string
1795
- renderingEngineId: string
1796
- }
1797
- /**
1798
- * Returns the image and its properties that is being shown inside the
1799
- * stack viewport. It returns, the image dimensions, image direction,
1800
- * image scalar data, vtkImageData object, metadata, and scaling (e.g., PET suvbw)
1801
- */
1802
- getImageData(): IImageData | CPUIImageData
1803
- /**
1804
- * Reset the viewport properties to the default values
1805
- */
1806
- resetProperties(): void
1807
- /**
1808
- * If the user has selected CPU rendering, return the CPU camera, otherwise
1809
- * return the default camera
1810
- */
1811
- getCamera(): ICamera
1812
- /**
1813
- * Set the camera based on the provided camera object.
1814
- */
1815
- setCamera(cameraInterface: ICamera): void
1816
- /**
1817
- * Sets the imageIds to be visualized inside the stack viewport. It accepts
1818
- * list of imageIds, the index of the first imageId to be viewed. It is a
1819
- * asynchronous function that returns a promise resolving to imageId being
1820
- * displayed in the stack viewport.
1821
- */
1822
- setStack(
1823
- imageIds: Array<string>,
1824
- currentImageIdIndex?: number
1825
- ): Promise<string>
1826
- /**
1827
- * Centers Pan and resets the zoom for stack viewport.
1828
- */
1829
- resetCamera(resetPanZoomForViewPlane?: boolean): boolean
1830
- /**
1831
- * Loads the image based on the provided imageIdIndex. It is an Async function which
1832
- * returns a promise that resolves to the imageId.
1833
- */
1834
- setImageIdIndex(imageIdIndex: number): Promise<string>
1835
- /**
1836
- * Calibrates the image with new metadata that has been added for imageId. To calibrate
1837
- * a viewport, you should add your calibration data manually to
1838
- * calibratedPixelSpacingMetadataProvider and call viewport.calibrateSpacing
1839
- * for it get applied.
1840
- */
1841
- calibrateSpacing(imageId: string): void
1842
- /**
1843
- * If the renderer is CPU based, throw an error. Otherwise, returns the `vtkRenderer` responsible for rendering the `Viewport`.
1844
- */
1845
- getRenderer(): any
1846
- /**
1847
- * Sets the colormap for the current viewport.
1848
- * @param colormap - The colormap data to use.
1849
- */
1850
- setColormap(colormap: CPUFallbackColormapData): void
1851
- /**
1852
- * It sets the colormap to the default colormap.
1853
- */
1854
- unsetColormap(): void
1855
- }
1856
-
1857
- /**
1858
- * Cornerstone StreamingImageVolume which extends ImageVolume
1859
- */
1860
- declare interface IStreamingImageVolume extends ImageVolume {
1861
- /** method to load all the loading requests */
1862
- clearLoadCallbacks(): void
1863
- /** method to convert the volume data in the volume cache, to separate images in the image cache */
1864
- convertToCornerstoneImage(imageId: string, imageIdIndex: number): any
1865
- /** method to decache the volume from cache */
1866
- decache(completelyRemove: boolean): void
1867
- }
1868
-
1869
- declare interface IStreamingVolumeProperties {
1870
- /** imageIds of the volume */
1871
- imageIds: Array<string>
1872
- /** loading status object for the volume containing loaded/loading statuses */
1873
- loadStatus: {
1874
- loaded: boolean
1875
- loading: boolean
1876
- cachedFrames: Array<boolean>
1877
- callbacks: Array<() => void>
1878
- }
1879
- }
1880
-
1881
- declare function isValidRepresentationConfig(representationType: string, config: RepresentationConfig): boolean;
1882
-
1883
- declare interface ISynchronizerEventHandler {
1884
- (synchronizer: Synchronizer, sourceViewport: Types_2.IViewportId, targetViewport: Types_2.IViewportId, sourceEvent: any): void;
1885
- }
1886
-
1887
- declare type IToolBinding = {
1888
- mouseButton: ToolBindingMouseType;
1889
- modifierKey?: ToolBindingKeyboardType;
1890
- };
1891
-
1892
- declare interface IToolGroup {
1893
- _toolInstances: Record<string, any>;
1894
- id: string;
1895
- viewportsInfo: Array<Types_2.IViewportId>;
1896
- toolOptions: Record<string, any>;
1897
- getViewportIds: () => string[];
1898
- getToolInstance: {
1899
- (toolName: string): any;
1900
- };
1901
- addTool: {
1902
- (toolName: string, toolConfiguration?: any): void;
1903
- };
1904
- addViewport: {
1905
- (viewportId: string, renderingEngineId?: string): void;
1906
- };
1907
- removeViewports: {
1908
- (renderingEngineId: string, viewportId?: string): void;
1909
- };
1910
- setToolActive: {
1911
- (toolName: string, toolBindingsOption?: SetToolBindingsType): void;
1912
- };
1913
- setToolPassive: {
1914
- (toolName: string): void;
1915
- };
1916
- setToolEnabled: {
1917
- (toolName: string): void;
1918
- };
1919
- setToolDisabled: {
1920
- (toolName: string): void;
1921
- };
1922
- getToolOptions: {
1923
- (toolName: string): ToolOptionsType;
1924
- };
1925
- getActivePrimaryMouseButtonTool: {
1926
- (): undefined | string;
1927
- };
1928
- setViewportsCursorByToolName: {
1929
- (toolName: string, strategyName?: string): void;
1930
- };
1931
- }
1932
-
1933
- /**
1934
- * Viewport interface for cornerstone viewports
1935
- */
1936
- declare interface IViewport {
1937
- /** unique identifier of the viewport */
1938
- id: string
1939
- /** renderingEngineId the viewport belongs to */
1940
- renderingEngineId: string
1941
- /** viewport type, can be ORTHOGRAPHIC or STACK for now */
1942
- type: ViewportType
1943
- /** canvas associated to the viewport */
1944
- canvas: HTMLCanvasElement
1945
- /** public DOM element associated to the viewport */
1946
- element: HTMLElement
1947
- /** sx of the viewport on the offscreen canvas (if rendering using GPU) */
1948
- sx: number
1949
- /** sy of the viewport on the offscreen canvas (if rendering using GPU) */
1950
- sy: number
1951
- /** width of the viewport on the offscreen canvas (if rendering using GPU) */
1952
- sWidth: number
1953
- /** height of the viewport on the offscreen canvas (if rendering using GPU) */
1954
- sHeight: number
1955
- /** actors rendered in the viewport (volumeActors as of now) */
1956
- _actors: Map<string, any>
1957
- /** viewport default options including the axis, and background color */
1958
- defaultOptions: any
1959
- /** viewport options */
1960
- options: ViewportInputOptions
1961
- /** Suppress events */
1962
- suppressEvents: boolean
1963
- /** frameOfReferenceUID the viewport's default actor is rendering */
1964
- getFrameOfReferenceUID: () => string
1965
- /** method to convert canvas to world coordinates */
1966
- canvasToWorld: (canvasPos: Point2) => Point3
1967
- /** method to convert world to canvas coordinates */
1968
- worldToCanvas: (worldPos: Point3) => Point2
1969
- /** returns all the actors on the viewport which includes both volumeActor object and its uid */
1970
- getActors(): Array<ActorEntry>
1971
- /** returns specific actor by its uid */
1972
- getActor(actorUID: string): ActorEntry
1973
- /** set and overwrite actors in a viewport */
1974
- setActors(actors: Array<ActorEntry>): void
1975
- /** add actors to the list of actors */
1976
- addActors(actors: Array<ActorEntry>): void
1977
- /** add one actor */
1978
- addActor(actorEntry: ActorEntry): void
1979
- /** remove all actors from the viewport */
1980
- removeAllActors(): void
1981
- /** returns the renderingEngine instance the viewport belongs to */
1982
- getRenderingEngine(): any
1983
- /** returns the vtkRenderer (for GPU rendering) of the viewport */
1984
- getRenderer(): void
1985
- /** triggers render for all actors in the viewport */
1986
- render(): void
1987
- /** set options for the viewport */
1988
- setOptions(options: ViewportInputOptions, immediate: boolean): void
1989
- /** reset camera and options*/
1990
- reset(immediate: boolean): void
1991
- /** returns the canvas */
1992
- getCanvas(): HTMLCanvasElement
1993
- /** returns camera object */
1994
- getCamera(): ICamera
1995
- /** sets the camera */
1996
- setCamera(cameraInterface: ICamera): void
1997
- /** whether the viewport has custom rendering */
1998
- customRenderViewportToCanvas: () => unknown
1999
- _getCorners(bounds: Array<number>): Array<number>[]
2000
- }
2001
-
2002
- /**
2003
- * Interface to uniquely define a viewport in cornerstone. Note: viewportIds
2004
- * can be shared between different rendering engines, but having a renderingEngineId
2005
- * and a viewportId is required to uniquely define a viewport.
2006
- */
2007
- declare interface IViewportId {
2008
- renderingEngineId: string
2009
- viewportId: string
2010
- }
2011
-
2012
- /**
2013
- * Cornerstone ImageVolume interface.
2014
- */
2015
- declare interface IVolume {
2016
- /** unique identifier for the volume in the cache */
2017
- volumeId: string
2018
- /** volume metadata */
2019
- metadata: Metadata
2020
- /** volume dimensions */
2021
- dimensions: Point3
2022
- /** volume spacing */
2023
- spacing: Point3
2024
- /** volume origin */
2025
- origin: Point3
2026
- /** volume direction */
2027
- direction: Float32Array
2028
- /** volume scalarData */
2029
- scalarData: Float32Array | Uint8Array
2030
- /** volume size in bytes */
2031
- sizeInBytes?: number
2032
- /** volume image data as vtkImageData */
2033
- imageData?: vtkImageData
2034
- /** referencedVolumeId if volume is derived from another volume */
2035
- referencedVolumeId?: string
2036
- /** volume scaling metadata */
2037
- scaling?: {
2038
- PET?: {
2039
- // @TODO: Do these values exist?
2040
- SUVlbmFactor?: number
2041
- SUVbsaFactor?: number
2042
- // accessed in ProbeTool
2043
- suvbwToSuvlbm?: number
2044
- suvbwToSuvbsa?: number
2045
- }
2046
- }
2047
- }
2048
-
2049
- /**
2050
- * VolumeInput that can be used to add a volume to a viewport. It includes
2051
- * mandatory `volumeId` but other options such as `visibility`, `blendMode`,
2052
- * `slabThickness` and `callback` can also be provided
2053
- */
2054
- declare interface IVolumeInput {
2055
- /** Volume ID of the volume in the cache */
2056
- volumeId: string
2057
- // actorUID for segmentations, since two segmentations with the same volumeId
2058
- // can have different representations
2059
- actorUID?: string
2060
- /** Visibility of the volume - by default it is true */
2061
- visibility?: boolean
2062
- /** Callback to be called when the volume is added to the viewport */
2063
- callback?: VolumeInputCallback
2064
- /** Blend mode of the volume - by default it is `additive` */
2065
- blendMode?: BlendModes
2066
- /** Slab thickness of the volume - by default it is calculated by the image size*/
2067
- slabThickness?: number
2068
- }
2069
-
2070
- /**
2071
- * VolumeLoadObject interface which any volumeLoader should return
2072
- */
2073
- declare interface IVolumeLoadObject {
2074
- /** promise that resolves to an ImageVolume */
2075
- promise: Promise<ImageVolume>
2076
- /** optional cancel function for loading*/
2077
- cancel?: () => void
2078
- /** optional decache function */
2079
- decache?: () => void
2080
- }
2081
-
2082
- /**
2083
- * Interface for the Volume Viewport
2084
- */
2085
- declare interface IVolumeViewport extends IViewport {
2086
- useCPURendering: boolean
2087
- getFrameOfReferenceUID: () => string
2088
- getProperties: () => any
2089
- /**
2090
- * canvasToWorld Returns the world coordinates of the given `canvasPos`
2091
- * projected onto the plane defined by the `Viewport`'s `vtkCamera`'s focal point
2092
- * and the direction of projection.
2093
- */
2094
- canvasToWorld: (canvasPos: Point2) => Point3
2095
- /**
2096
- * Returns the canvas coordinates of the given `worldPos`
2097
- * projected onto the `Viewport`'s `canvas`.
2098
- */
2099
- worldToCanvas: (worldPos: Point3) => Point2
2100
- /**
2101
- * Uses viewport camera and volume actor to decide if the viewport
2102
- * is looking at the volume in the direction of acquisition (imageIds).
2103
- * If so, it uses the origin and focalPoint to calculate the slice index.
2104
- */
2105
- getCurrentImageIdIndex: () => number
2106
- /**
2107
- * Uses viewport camera and volume actor to decide if the viewport
2108
- * is looking at the volume in the direction of acquisition (imageIds).
2109
- * If so, it uses the origin and focalPoint to find which imageId is
2110
- * currently being viewed.
2111
- */
2112
- getCurrentImageId: () => string
2113
- /**
2114
- * Creates volume actors for all volumes defined in the `volumeInputArray`.
2115
- * For each entry, if a `callback` is supplied, it will be called with the new volume actor as input.
2116
- * For each entry, if a `blendMode` and/or `slabThickness` is defined, this will be set on the actor's
2117
- * `VolumeMapper`.
2118
- */
2119
- setVolumes(
2120
- volumeInputArray: Array<IVolumeInput>,
2121
- immediate?: boolean
2122
- ): Promise<void>
2123
- /**
2124
- * Creates and adds volume actors for all volumes defined in the `volumeInputArray`.
2125
- * For each entry, if a `callback` is supplied, it will be called with the new volume actor as input.
2126
- */
2127
- addVolumes(
2128
- volumeInputArray: Array<IVolumeInput>,
2129
- immediate?: boolean
2130
- ): Promise<void>
2131
- /**
2132
- * It removes the volume actor from the Viewport. If the volume actor is not in
2133
- * the viewport, it does nothing.
2134
- */
2135
- removeVolumeActors(actorUIDs: Array<string>, immediate?: boolean): void
2136
- /**
2137
- * Given a point in world coordinates, return the intensity at that point
2138
- */
2139
- getIntensityFromWorld(point: Point3): number
2140
- /**
2141
- * getBounds gets the visible bounds of the viewport
2142
- */
2143
- getBounds(): any
2144
- /**
2145
- * Flip the viewport along the desired axis
2146
- */
2147
- flip(flipDirection: FlipDirection): void
2148
- /**
2149
- * Reset the camera for the volume viewport
2150
- */
2151
- resetCamera(resetPanZoomForViewPlane?: boolean): boolean
2152
- /**
2153
- * Sets the slab thickness option in the `Viewport`'s `options`.
2154
- */
2155
- setSlabThickness(slabThickness: number): void
2156
- /**
2157
- * Gets the slab thickness option in the `Viewport`'s `options`.
2158
- */
2159
- getSlabThickness(): number
2160
- /**
2161
- * Returns the image and its properties that is being shown inside the
2162
- * stack viewport. It returns, the image dimensions, image direction,
2163
- * image scalar data, vtkImageData object, metadata, and scaling (e.g., PET suvbw)
2164
- */
2165
- getImageData(): IImageData | undefined
2166
- }
2167
-
2168
- declare enum KeyboardBindings {
2169
- Shift = 16,
2170
- Ctrl = 18,
2171
- Alt = 17
2172
- }
2173
-
2174
- declare type KeyDownEventDetail = {
2175
- element: HTMLElement;
2176
- viewportId: string;
2177
- renderingEngineId: string;
2178
- key: string;
2179
- keyCode: number;
2180
- };
2181
-
2182
- declare type KeyDownEventType = Types_2.CustomEventType<KeyDownEventDetail>;
2183
-
2184
- declare type KeyUpEventDetail = KeyDownEventDetail;
2185
-
2186
- declare type KeyUpEventType = Types_2.CustomEventType<KeyUpEventDetail>;
2187
-
2188
- declare type labelmapConfig = {
2189
- renderOutline?: boolean;
2190
- outlineWidth?: number;
2191
- outlineWidthActive?: number;
2192
- outlineWidthInactive?: number;
2193
- renderFill?: boolean;
2194
- fillAlpha?: number;
2195
- fillAlphaInactive?: number;
2196
- };
2197
-
2198
- declare type LabelmapRenderingConfig = {
2199
- cfun?: vtkColorTransferFunction;
2200
- ofun?: vtkPiecewiseFunction;
2201
- };
2202
-
2203
- declare type LabelmapRepresentationData = {
2204
- volumeId: string;
2205
- referencedVolumeId?: string;
2206
- };
2207
-
2208
- declare interface LengthAnnotation extends Annotation {
2209
- data: {
2210
- handles: {
2211
- points: Types_2.Point3[];
2212
- activeHandleIndex: number | null;
2213
- textBox: {
2214
- hasMoved: boolean;
2215
- worldPosition: Types_2.Point3;
2216
- worldBoundingBox: {
2217
- topLeft: Types_2.Point3;
2218
- topRight: Types_2.Point3;
2219
- bottomLeft: Types_2.Point3;
2220
- bottomRight: Types_2.Point3;
2221
- };
2222
- };
2223
- };
2224
- label: string;
2225
- cachedStats: {
2226
- [targetId: string]: {
2227
- length: number;
2228
- };
2229
- };
2230
- };
2231
- }
2232
-
2233
- export declare class LengthTool extends AnnotationTool {
2234
- static toolName: string;
2235
- touchDragCallback: any;
2236
- mouseDragCallback: any;
2237
- _throttledCalculateCachedStats: any;
2238
- editData: {
2239
- annotation: any;
2240
- viewportIdsToRender: string[];
2241
- handleIndex?: number;
2242
- movingTextBox?: boolean;
2243
- newAnnotation?: boolean;
2244
- hasMoved?: boolean;
2245
- } | null;
2246
- isDrawing: boolean;
2247
- isHandleOutsideImage: boolean;
2248
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
2249
- addNewAnnotation: (evt: EventTypes_2.MouseDownActivateEventType) => LengthAnnotation;
2250
- isPointNearTool: (element: HTMLElement, annotation: LengthAnnotation, canvasCoords: Types_2.Point2, proximity: number) => boolean;
2251
- toolSelectedCallback: (evt: EventTypes_2.MouseDownEventType, annotation: LengthAnnotation, interactionType: InteractionTypes) => void;
2252
- handleSelectedCallback(evt: EventTypes_2.MouseDownEventType, annotation: LengthAnnotation, handle: ToolHandle, interactionType?: string): void;
2253
- _mouseUpCallback: (evt: EventTypes_2.MouseUpEventType | EventTypes_2.MouseClickEventType) => void;
2254
- _mouseDragCallback: (evt: EventTypes_2.MouseDragEventType | EventTypes_2.MouseMoveEventType) => void;
2255
- cancel: (element: HTMLElement) => any;
2256
- _activateModify: (element: HTMLElement) => void;
2257
- _deactivateModify: (element: HTMLElement) => void;
2258
- _activateDraw: (element: HTMLElement) => void;
2259
- _deactivateDraw: (element: HTMLElement) => void;
2260
- renderAnnotation: (enabledElement: Types_2.IEnabledElement, svgDrawingHelper: any) => void;
2261
- _getTextLines(data: any, targetId: any): string[];
2262
- _calculateLength(pos1: any, pos2: any): number;
2263
- _calculateCachedStats(annotation: any, renderingEngine: any, enabledElement: any): any;
2264
- _isInsideVolume(index1: any, index2: any, dimensions: any): boolean;
2265
- }
2266
-
2267
- declare namespace lineSegment {
2268
- export {
2269
- distanceToPoint,
2270
- distanceToPointSquared,
2271
- intersectLine
2272
- }
2273
- }
2274
-
2275
- declare namespace locking {
2276
- export {
2277
- setAnnotationLocked,
2278
- getAnnotationsLocked,
2279
- getAnnotationsLockedCount,
2280
- unlockAllAnnotations,
2281
- isAnnotationLocked,
2282
- checkAndDefineIsLockedProperty
2283
- }
2284
- }
2285
-
2286
- declare namespace math {
2287
- export {
2288
- vec2,
2289
- ellipse,
2290
- lineSegment,
2291
- rectangle
2292
- }
2293
- }
2294
-
2295
- /**
2296
- * Metadata for images, More information can be found in the
2297
- * {@link https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.3.html#table_C.7-11c}
2298
- */
2299
- declare type Metadata = {
2300
- /** Number of bits allocated for each pixel sample. Each sample shall have the same number of bits allocated */
2301
- BitsAllocated: number
2302
- /** Number of bits stored for each pixel sample */
2303
- BitsStored: number
2304
- SamplesPerPixel: number
2305
- /** Most significant bit for pixel sample data */
2306
- HighBit: number
2307
- /** Specifies the intended interpretation of the pixel data */
2308
- PhotometricInterpretation: string
2309
- /** Data representation of the pixel samples. */
2310
- PixelRepresentation: number
2311
- /** Image Modality */
2312
- Modality: string
2313
- /** The direction cosines of the first row and the first column with respect to the patient */
2314
- ImageOrientationPatient: Array<number>
2315
- /** Physical distance in the patient between the center of each pixel */
2316
- PixelSpacing: Array<number>
2317
- /** Uniquely identifies the Frame of Reference for a Series */
2318
- FrameOfReferenceUID: string
2319
- /** Number of columns in the image. */
2320
- Columns: number
2321
- /** Number of rows in the image. */
2322
- Rows: number
2323
- /** Window Level/Center for the image */
2324
- voiLut: Array<VOI>
2325
- }
2326
-
2327
- export declare class MIPJumpToClickTool extends BaseTool {
2328
- static toolName: string;
2329
- _bounds: any;
2330
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
2331
- mouseClickCallback(evt: any): void;
2332
- }
2333
-
2334
- declare enum MouseBindings {
2335
- Primary = 1,
2336
- Secondary = 2,
2337
- Primary_And_Secondary = 3,
2338
- Auxiliary = 4,
2339
- Primary_And_Auxiliary = 5,
2340
- Secondary_And_Auxiliary = 6,
2341
- Primary_And_Secondary_And_Auxiliary = 7,
2342
- Fourth_Button = 8,
2343
- Fifth_Button = 16
2344
- }
2345
-
2346
- declare type MouseClickEventDetail = NormalizedMouseEventDetail & {
2347
- mouseButton: number;
2348
- startPoints: IPoints;
2349
- lastPoints: IPoints;
2350
- currentPoints: IPoints;
2351
- deltaPoints: IPoints;
2352
- };
2353
-
2354
- declare type MouseClickEventType = Types_2.CustomEventType<MouseClickEventDetail>;
2355
-
2356
- declare class MouseCursor {
2357
- private name;
2358
- private fallback;
2359
- constructor(name: string, fallback?: MouseCursor | undefined);
2360
- getName(): string;
2361
- addFallbackStyleProperty(style: string): string;
2362
- getStyleProperty(): string;
2363
- static getDefinedCursor(name: string): MouseCursor | undefined;
2364
- static setDefinedCursor(name: string, cursor: MouseCursor): boolean;
2365
- }
2366
-
2367
- declare type MouseDoubleClickEventDetail = NormalizedMouseEventDetail & {
2368
- startPoints: IPoints;
2369
- lastPoints: IPoints;
2370
- currentPoints: IPoints;
2371
- deltaPoints: IPoints;
2372
- };
2373
-
2374
- declare type MouseDoubleClickEventType = Types_2.CustomEventType<MouseDoubleClickEventDetail>;
2375
-
2376
- declare type MouseDownActivateEventDetail = NormalizedMouseEventDetail & {
2377
- mouseButton: number;
2378
- startPoints: IPoints;
2379
- lastPoints: IPoints;
2380
- currentPoints: IPoints;
2381
- deltaPoints: IPoints;
2382
- };
2383
-
2384
- declare type MouseDownActivateEventType = Types_2.CustomEventType<MouseDownActivateEventDetail>;
2385
-
2386
- declare type MouseDownEventDetail = NormalizedMouseEventDetail & {
2387
- mouseButton: number;
2388
- startPoints: IPoints;
2389
- lastPoints: IPoints;
2390
- currentPoints: IPoints;
2391
- deltaPoints: IPoints;
2392
- };
2393
-
2394
- declare type MouseDownEventType = Types_2.CustomEventType<MouseDownEventDetail>;
2395
-
2396
- declare type MouseDragEventDetail = NormalizedMouseEventDetail & {
2397
- mouseButton: number;
2398
- startPoints: IPoints;
2399
- lastPoints: IPoints;
2400
- currentPoints: IPoints;
2401
- deltaPoints: IPoints;
2402
- };
2403
-
2404
- declare type MouseDragEventType = Types_2.CustomEventType<MouseDragEventDetail>;
2405
-
2406
- declare type MouseMoveEventDetail = NormalizedMouseEventDetail & {
2407
- currentPoints: IPoints;
2408
- };
2409
-
2410
- declare type MouseMoveEventType = Types_2.CustomEventType<MouseMoveEventDetail>;
2411
-
2412
- declare type MouseUpEventDetail = NormalizedMouseEventDetail & {
2413
- mouseButton: number;
2414
- startPoints: IPoints;
2415
- lastPoints: IPoints;
2416
- currentPoints: IPoints;
2417
- deltaPoints: IPoints;
2418
- };
2419
-
2420
- declare type MouseUpEventType = Types_2.CustomEventType<MouseUpEventDetail>;
2421
-
2422
- declare type MouseWheelEventDetail = NormalizedMouseEventDetail & {
2423
- detail: Record<string, any>;
2424
- wheel: {
2425
- spinX: number;
2426
- spinY: number;
2427
- pixelX: number;
2428
- pixelY: number;
2429
- direction: number;
2430
- };
2431
- points: IPoints;
2432
- };
2433
-
2434
- declare type MouseWheelEventType = Types_2.CustomEventType<MouseWheelEventDetail>;
2435
-
2436
- declare type NormalizedMouseEventDetail = {
2437
- event: Record<string, unknown> | MouseEvent;
2438
- eventName: string;
2439
- renderingEngineId: string;
2440
- viewportId: string;
2441
- camera: Record<string, unknown>;
2442
- element: HTMLElement;
2443
- };
2444
-
2445
- declare type NormalizedMouseEventType = Types_2.CustomEventType<NormalizedMouseEventDetail>;
2446
-
2447
- declare type Orientation = {
2448
- /** Slice Normal for the viewport - the normal that points in the opposite direction of the slice normal out of screen and is negative of direction of projection */
2449
- sliceNormal: Point3
2450
- /** viewUp direction for the viewport - the vector that points from bottom to top of the viewport */
2451
- viewUp: Point3
2452
- }
2453
-
2454
- export declare class PanTool extends BaseTool {
2455
- static toolName: string;
2456
- touchDragCallback: () => void;
2457
- mouseDragCallback: () => void;
2458
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
2459
- _dragCallback(evt: any): void;
2460
- }
2461
-
2462
- declare namespace planar {
2463
- export {
2464
- _default as default,
2465
- filterAnnotationsWithinSlice,
2466
- getWorldWidthAndHeightFromCorners,
2467
- filterAnnotationsForDisplay,
2468
- getPointInLineOfSightWithCriteria
2469
- }
2470
- }
2471
-
2472
- declare type PlanarBoundingBox = {
2473
- x: number;
2474
- y: number;
2475
- width: number;
2476
- height: number;
2477
- };
2478
-
2479
- /**
2480
- * Plane equation Ax+By+Cz=D, plane is defined by [A, B, C, D]
2481
- */
2482
- declare type Plane = [number, number, number, number]
2483
-
2484
- /**
2485
- * This duplicates the typing established in gl-matrix for a vec2
2486
- */
2487
- declare type Point2 = [number, number]
2488
-
2489
- /**
2490
- * This duplicates the typing established in gl-matrix for a vec3
2491
- */
2492
- declare type Point3 = [number, number, number]
2493
-
2494
- /**
2495
- * This represents a 4-vector or RGBA value.
2496
- */
2497
- declare type Point4 = [number, number, number, number];
2498
-
2499
- declare function pointInEllipse(ellipse: Ellipse, pointLPS: Types_2.Point3): boolean;
2500
-
2501
- declare type PointInShapeCallback = ({ value, index, pointIJK, pointLPS, }: {
2502
- value: number;
2503
- index: number;
2504
- pointIJK: Types_2.Point3;
2505
- pointLPS: Types_2.Point3;
2506
- }) => void;
2507
-
2508
- declare function pointInShapeCallback(imageData: vtkImageData | Types_2.CPUImageData, pointInShapeFn: ShapeFnCriteria, callback: PointInShapeCallback, boundsIJK?: BoundsIJK): void;
2509
-
2510
- declare function pointInSurroundingSphereCallback(viewport: Types_2.IVolumeViewport, imageData: vtkImageData, circlePoints: [Types_2.Point3, Types_2.Point3], callback: PointInShapeCallback): void;
2511
-
2512
- declare interface ProbeAnnotation extends Annotation {
2513
- data: {
2514
- handles: {
2515
- points: Types_2.Point3[];
2516
- };
2517
- cachedStats: {
2518
- [targetId: string]: {
2519
- Modality: string;
2520
- index: Types_2.Point3;
2521
- value: number;
2522
- };
2523
- };
2524
- label: string;
2525
- };
2526
- }
2527
-
2528
- export declare class ProbeTool extends AnnotationTool {
2529
- static toolName: string;
2530
- touchDragCallback: any;
2531
- mouseDragCallback: any;
2532
- editData: {
2533
- annotation: any;
2534
- viewportIdsToRender: string[];
2535
- } | null;
2536
- eventDispatchDetail: {
2537
- viewportId: string;
2538
- renderingEngineId: string;
2539
- };
2540
- isDrawing: boolean;
2541
- isHandleOutsideImage: boolean;
2542
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
2543
- isPointNearTool(): boolean;
2544
- toolSelectedCallback(): void;
2545
- addNewAnnotation: (evt: EventTypes_2.MouseDownActivateEventType) => ProbeAnnotation;
2546
- getHandleNearImagePoint(element: HTMLElement, annotation: ProbeAnnotation, canvasCoords: Types_2.Point2, proximity: number): ToolHandle | undefined;
2547
- handleSelectedCallback(evt: EventTypes_2.MouseDownEventType, annotation: ProbeAnnotation, handle: ToolHandle, interactionType?: string): void;
2548
- _mouseUpCallback: (evt: EventTypes_2.MouseUpEventType | EventTypes_2.MouseClickEventType) => void;
2549
- _mouseDragCallback: (evt: any) => void;
2550
- cancel: (element: HTMLElement) => any;
2551
- _activateModify: (element: any) => void;
2552
- _deactivateModify: (element: any) => void;
2553
- renderAnnotation: (enabledElement: Types_2.IEnabledElement, svgDrawingHelper: any) => void;
2554
- _getTextLines(data: any, targetId: any): any[];
2555
- _getValueForModality(value: any, imageVolume: any, modality: any): {};
2556
- _calculateCachedStats(annotation: any, renderingEngine: any, enabledElement: any): any;
2557
- }
2558
-
2559
- declare type PTScaling = {
2560
- /** suv body weight to suv lean body mass */
2561
- suvbwToSuvlbm?: number
2562
- /** suv body weight to suv body surface area */
2563
- suvbwToSuvbsa?: number
2564
- }
2565
-
2566
- declare type PublicToolProps = SharedToolProp & {
2567
- name?: string;
2568
- };
2569
-
2570
- /**
2571
- * Public Interface for viewport input to get enabled/disabled or set
2572
- */
2573
- declare type PublicViewportInput = {
2574
- /** HTML element in the DOM */
2575
- element: HTMLElement
2576
- /** unique id for the viewport in the renderingEngine */
2577
- viewportId: string
2578
- /** type of the viewport */
2579
- type: ViewportType
2580
- /** options for the viewport */
2581
- defaultOptions: ViewportInputOptions
2582
- }
2583
-
2584
- declare namespace rectangle {
2585
- export {
2586
- distanceToPoint_2 as distanceToPoint
2587
- }
2588
- }
2589
-
2590
- declare interface RectangleRoiAnnotation extends Annotation {
2591
- data: {
2592
- handles: {
2593
- points: Types_2.Point3[];
2594
- activeHandleIndex: number | null;
2595
- textBox: {
2596
- hasMoved: boolean;
2597
- worldPosition: Types_2.Point3;
2598
- worldBoundingBox: {
2599
- topLeft: Types_2.Point3;
2600
- topRight: Types_2.Point3;
2601
- bottomLeft: Types_2.Point3;
2602
- bottomRight: Types_2.Point3;
2603
- };
2604
- };
2605
- };
2606
- label: string;
2607
- cachedStats?: RectangleRoiCachedStats | {
2608
- projectionPoints?: Types_2.Point3[];
2609
- projectionPointsImageIds?: string[];
2610
- };
2611
- };
2612
- }
2613
-
2614
- declare interface RectangleRoiCachedStats {
2615
- [targetId: string]: {
2616
- Modality: string;
2617
- area: number;
2618
- max: number;
2619
- mean: number;
2620
- stdDev: number;
2621
- };
2622
- }
2623
-
2624
- declare interface RectangleRoiStartEndThresholdAnnotation extends Annotation {
2625
- metadata: {
2626
- cameraPosition?: Types_2.Point3;
2627
- cameraFocalPoint?: Types_2.Point3;
2628
- viewPlaneNormal?: Types_2.Point3;
2629
- viewUp?: Types_2.Point3;
2630
- annotationUID?: string;
2631
- FrameOfReferenceUID: string;
2632
- referencedImageId?: string;
2633
- toolName: string;
2634
- enabledElement: any;
2635
- volumeId: string;
2636
- spacingInNormal: number;
2637
- };
2638
- data: {
2639
- label: string;
2640
- startSlice: number;
2641
- endSlice: number;
2642
- cachedStats: {
2643
- projectionPoints: Types_2.Point3[][];
2644
- projectionPointsImageIds: string[];
2645
- };
2646
- handles: {
2647
- points: Types_2.Point3[];
2648
- activeHandleIndex: number | null;
2649
- };
2650
- };
2651
- }
2652
-
2653
- export declare class RectangleRoiStartEndThresholdTool extends RectangleRoiTool {
2654
- static toolName: string;
2655
- _throttledCalculateCachedStats: any;
2656
- editData: {
2657
- annotation: any;
2658
- viewportIdsToRender: string[];
2659
- handleIndex?: number;
2660
- newAnnotation?: boolean;
2661
- hasMoved?: boolean;
2662
- } | null;
2663
- isDrawing: boolean;
2664
- isHandleOutsideImage: boolean;
2665
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
2666
- addNewAnnotation: (evt: EventTypes_2.MouseDownActivateEventType) => {
2667
- highlighted: boolean;
2668
- invalidated: boolean;
2669
- metadata: {
2670
- viewPlaneNormal: Types_2.Point3;
2671
- enabledElement: Types_2.IEnabledElement;
2672
- viewUp: Types_2.Point3;
2673
- FrameOfReferenceUID: string;
2674
- referencedImageId: any;
2675
- toolName: string;
2676
- volumeId: any;
2677
- spacingInNormal: number;
2678
- };
2679
- data: {
2680
- label: string;
2681
- startSlice: number;
2682
- endSlice: number;
2683
- cachedStats: {
2684
- projectionPoints: any[];
2685
- projectionPointsImageIds: any[];
2686
- };
2687
- handles: {
2688
- textBox: {
2689
- hasMoved: boolean;
2690
- worldPosition: any;
2691
- worldBoundingBox: any;
2692
- };
2693
- points: Types_2.Point3[];
2694
- activeHandleIndex: any;
2695
- };
2696
- labelmapUID: any;
2697
- };
2698
- };
2699
- _computeProjectionPoints(annotation: RectangleRoiStartEndThresholdAnnotation, imageVolume: Types_2.IImageVolume): void;
2700
- _calculateCachedStatsTool(annotation: any, enabledElement: any): any;
2701
- renderAnnotation: (enabledElement: Types_2.IEnabledElement, svgDrawingHelper: any) => void;
2702
- _getEndSliceIndex(imageVolume: Types_2.IImageVolume, worldPos: Types_2.Point3, spacingInNormal: number, viewPlaneNormal: Types_2.Point3): number | undefined;
2703
- }
2704
-
2705
- export declare class RectangleRoiThresholdTool extends RectangleRoiTool {
2706
- static toolName: string;
2707
- _throttledCalculateCachedStats: any;
2708
- editData: {
2709
- annotation: any;
2710
- viewportIdsToRender: string[];
2711
- handleIndex?: number;
2712
- newAnnotation?: boolean;
2713
- hasMoved?: boolean;
2714
- } | null;
2715
- isDrawing: boolean;
2716
- isHandleOutsideImage: boolean;
2717
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
2718
- addNewAnnotation: (evt: EventTypes_2.MouseDownActivateEventType) => {
2719
- highlighted: boolean;
2720
- invalidated: boolean;
2721
- metadata: {
2722
- viewPlaneNormal: Types_2.Point3;
2723
- enabledElement: Types_2.IEnabledElement;
2724
- viewUp: Types_2.Point3;
2725
- FrameOfReferenceUID: string;
2726
- referencedImageId: any;
2727
- toolName: string;
2728
- volumeId: any;
2729
- };
2730
- data: {
2731
- label: string;
2732
- handles: {
2733
- textBox: {
2734
- hasMoved: boolean;
2735
- worldPosition: any;
2736
- worldBoundingBox: any;
2737
- };
2738
- points: Types_2.Point3[];
2739
- activeHandleIndex: any;
2740
- };
2741
- segmentationId: any;
2742
- };
2743
- };
2744
- renderAnnotation: (enabledElement: Types_2.IEnabledElement, svgDrawingHelper: any) => void;
2745
- }
2746
-
2747
- export declare class RectangleRoiTool extends AnnotationTool {
2748
- static toolName: string;
2749
- _throttledCalculateCachedStats: any;
2750
- editData: {
2751
- annotation: any;
2752
- viewportIdsToRender: string[];
2753
- handleIndex?: number;
2754
- movingTextBox?: boolean;
2755
- newAnnotation?: boolean;
2756
- hasMoved?: boolean;
2757
- } | null;
2758
- isDrawing: boolean;
2759
- isHandleOutsideImage: boolean;
2760
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
2761
- addNewAnnotation: (evt: EventTypes_2.MouseDownActivateEventType) => RectangleRoiAnnotation;
2762
- isPointNearTool: (element: HTMLElement, annotation: RectangleRoiAnnotation, canvasCoords: Types_2.Point2, proximity: number) => boolean;
2763
- toolSelectedCallback: (evt: EventTypes_2.MouseDownEventType, annotation: RectangleRoiAnnotation, interactionType: InteractionTypes) => void;
2764
- handleSelectedCallback: (evt: EventTypes_2.MouseDownEventType, annotation: RectangleRoiAnnotation, handle: ToolHandle, interactionType?: string) => void;
2765
- _mouseUpCallback: (evt: EventTypes_2.MouseUpEventType | EventTypes_2.MouseClickEventType) => void;
2766
- _mouseDragCallback: (evt: EventTypes_2.MouseMoveEventType | EventTypes_2.MouseDragEventType) => void;
2767
- cancel: (element: HTMLElement) => any;
2768
- _activateDraw: (element: any) => void;
2769
- _deactivateDraw: (element: any) => void;
2770
- _activateModify: (element: any) => void;
2771
- _deactivateModify: (element: any) => void;
2772
- renderAnnotation: (enabledElement: Types_2.IEnabledElement, svgDrawingHelper: any) => void;
2773
- _getRectangleImageCoordinates: (points: Array<Types_2.Point2>) => {
2774
- left: number;
2775
- top: number;
2776
- width: number;
2777
- height: number;
2778
- };
2779
- _getTextLines: (data: any, targetId: string) => any[];
2780
- _calculateCachedStats: (annotation: any, viewPlaneNormal: any, viewUp: any, renderingEngine: any, enabledElement: any) => any;
2781
- _isInsideVolume: (index1: any, index2: any, dimensions: any) => boolean;
2782
- }
2783
-
2784
- export declare class RectangleScissorsTool extends BaseTool {
2785
- static toolName: string;
2786
- _throttledCalculateCachedStats: any;
2787
- editData: {
2788
- annotation: any;
2789
- segmentationId: string;
2790
- segmentation: any;
2791
- segmentIndex: number;
2792
- segmentsLocked: number[];
2793
- segmentColor: [number, number, number, number];
2794
- viewportIdsToRender: string[];
2795
- handleIndex?: number;
2796
- movingTextBox: boolean;
2797
- newAnnotation?: boolean;
2798
- hasMoved?: boolean;
2799
- } | null;
2800
- isDrawing: boolean;
2801
- isHandleOutsideImage: boolean;
2802
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
2803
- addNewAnnotation: (evt: EventTypes_2.MouseDownActivateEventType) => void;
2804
- _mouseDragCallback: (evt: EventTypes_2.MouseDragEventType) => void;
2805
- _mouseUpCallback: (evt: EventTypes_2.MouseUpEventType | EventTypes_2.MouseClickEventType) => void;
2806
- _activateDraw: (element: any) => void;
2807
- _deactivateDraw: (element: any) => void;
2808
- renderAnnotation: (enabledElement: Types_2.IEnabledElement, svgDrawingHelper: any) => void;
2809
- }
2810
-
2811
- declare function registerCursor(toolName: string, iconContent: string, viewBox: {
2812
- x: number;
2813
- y: number;
2814
- }): void;
2815
-
2816
- declare function removeAnnotation(element: HTMLElement, annotationUID: string): void;
2817
-
2818
- declare function removeSegmentationRepresentation(toolGroupId: string, segmentationRepresentationUID: string): void;
2819
-
2820
- declare function removeSegmentationsFromToolGroup(toolGroupId: string, segmentationRepresentationUIDs?: string[] | undefined): void;
2821
-
2822
- export declare function removeTool(ToolClass: any): void;
2823
-
2824
- declare type RepresentationConfig = {
2825
- LABELMAP?: labelmapConfig;
2826
- };
2827
-
2828
- declare type RepresentationPublicInput = {
2829
- segmentationId: string;
2830
- type: Enums_2.SegmentationRepresentations;
2831
- };
2832
-
2833
- declare function resetElementCursor(element: HTMLElement): void;
2834
-
2835
- declare type Scaling = {
2836
- PET?: PTScaling
2837
- }
2838
-
2839
- declare type ScalingParameters = {
2840
- /** m in m*p+b which specifies the linear transformation from stored pixels to memory value */
2841
- rescaleSlope: number
2842
- /** b in m*p+b which specifies the offset of the transformation */
2843
- rescaleIntercept: number
2844
- /** modality */
2845
- modality: string
2846
- /** SUV body weight */
2847
- suvbw?: number
2848
- /** SUV lean body mass */
2849
- suvlbm?: number
2850
- /** SUV body surface area */
2851
- suvbsa?: number
2852
- }
2853
-
2854
- declare function scrollThroughStack(evt: MouseWheelEventType | MouseDragEventType, deltaFrames: number, volumeId: string, invert?: boolean): void;
2855
-
2856
- declare type Segmentation = {
2857
- segmentationId: string;
2858
- type: Enums_2.SegmentationRepresentations;
2859
- label: string;
2860
- activeSegmentIndex: number;
2861
- segmentsLocked: Set<number>;
2862
- cachedStats: {
2863
- [key: string]: number;
2864
- };
2865
- representations: SegmentationRepresentationData;
2866
- };
2867
-
2868
- declare namespace segmentation {
2869
- export {
2870
- state_2 as state,
2871
- addSegmentations,
2872
- activeSegmentation,
2873
- addSegmentationRepresentations,
2874
- removeSegmentationsFromToolGroup,
2875
- createNewSegmentationForToolGroup,
2876
- segmentLocking,
2877
- segmentationColor,
2878
- segmentationConfig,
2879
- segmentationVisibility,
2880
- segmentIndex,
2881
- triggerSegmentationEvents
2882
- }
2883
- }
2884
- export { segmentation }
2885
-
2886
- declare namespace segmentation_2 {
2887
- export {
2888
- getBoundingBoxAroundShape,
2889
- extend2DBoundingBoxInViewAxis,
2890
- thresholdVolumeByRange,
2891
- createMergedLabelmapForIndex,
2892
- isValidRepresentationConfig,
2893
- getDefaultRepresentationConfig
2894
- }
2895
- }
2896
-
2897
- declare namespace segmentationColor {
2898
- export {
2899
- getColorForSegmentIndex,
2900
- addColorLUT_2 as addColorLUT
2901
- }
2902
- }
2903
-
2904
- declare namespace segmentationConfig {
2905
- export {
2906
- getGlobalConfig_2 as getGlobalConfig,
2907
- setGlobalConfig_2 as setGlobalConfig,
2908
- getGlobalRepresentationConfig,
2909
- setGlobalRepresentationConfig,
2910
- getToolGroupSpecificConfig_2 as getToolGroupSpecificConfig,
2911
- setToolGroupSpecificConfig_2 as setToolGroupSpecificConfig
2912
- }
2913
- }
2914
-
2915
- declare type SegmentationDataModifiedEventDetail = {
2916
- segmentationId: string;
2917
- };
2918
-
2919
- declare type SegmentationDataModifiedEventType = Types_2.CustomEventType<SegmentationDataModifiedEventDetail>;
2920
-
2921
- export declare class SegmentationDisplayTool extends BaseTool {
2922
- static toolName: string;
2923
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
2924
- enableCallback(): void;
2925
- disableCallback(): void;
2926
- renderSegmentation: (toolGroupId: string) => void;
2927
- _getMergedRepresentationsConfig(toolGroupId: string): SegmentationRepresentationConfig;
2928
- }
2929
-
2930
- declare type SegmentationModifiedEventDetail = {
2931
- segmentationId: string;
2932
- };
2933
-
2934
- declare type SegmentationModifiedEventType = Types_2.CustomEventType<SegmentationModifiedEventDetail>;
2935
-
2936
- declare type SegmentationPublicInput = {
2937
- segmentationId: string;
2938
- representation: {
2939
- type: Enums_2.SegmentationRepresentations;
2940
- data: LabelmapRepresentationData;
2941
- };
2942
- };
2943
-
2944
- declare type SegmentationRenderedEventDetail = {
2945
- viewportId: string;
2946
- toolGroupId: string;
2947
- };
2948
-
2949
- declare type SegmentationRenderedEventType = Types_2.CustomEventType<SegmentationRenderedEventDetail>;
2950
-
2951
- declare type SegmentationRepresentationConfig = {
2952
- renderInactiveSegmentations: boolean;
2953
- representations: RepresentationConfig;
2954
- };
2955
-
2956
- declare type SegmentationRepresentationData = {
2957
- LABELMAP?: LabelmapRepresentationData;
2958
- };
2959
-
2960
- declare type SegmentationRepresentationModifiedEventDetail = {
2961
- toolGroupId: string;
2962
- segmentationRepresentationUID: string;
2963
- };
2964
-
2965
- declare type SegmentationRepresentationModifiedEventType = Types_2.CustomEventType<SegmentationRepresentationModifiedEventDetail>;
2966
-
2967
- declare type SegmentationRepresentationRemovedEventDetail = {
2968
- toolGroupId: string;
2969
- segmentationRepresentationUID: string;
2970
- };
2971
-
2972
- declare type SegmentationRepresentationRemovedEventType = Types_2.CustomEventType<SegmentationRepresentationRemovedEventDetail>;
2973
-
2974
- declare enum SegmentationRepresentations {
2975
- Labelmap = "LABELMAP"
2976
- }
2977
-
2978
- declare type SegmentationState = {
2979
- colorLut: ColorLut[];
2980
- segmentations: Segmentation[];
2981
- globalConfig: SegmentationRepresentationConfig;
2982
- toolGroups: {
2983
- [key: string]: {
2984
- segmentationRepresentations: ToolGroupSpecificRepresentation[];
2985
- config: SegmentationRepresentationConfig;
2986
- };
2987
- };
2988
- };
2989
-
2990
- declare class SegmentationStateManager {
2991
- private state;
2992
- readonly uid: string;
2993
- constructor(uid?: string);
2994
- getState(): SegmentationState;
2995
- getToolGroups(): string[];
2996
- getColorLut(lutIndex: number): ColorLut | undefined;
2997
- resetState(): void;
2998
- getSegmentation(segmentationId: string): Segmentation | undefined;
2999
- addSegmentation(segmentation: Segmentation): void;
3000
- getSegmentationRepresentations(toolGroupId: string): ToolGroupSpecificRepresentation[] | undefined;
3001
- addSegmentationRepresentation(toolGroupId: string, segmentationRepresentation: ToolGroupSpecificRepresentation): void;
3002
- getGlobalConfig(): SegmentationRepresentationConfig;
3003
- setGlobalConfig(config: SegmentationRepresentationConfig): void;
3004
- getSegmentationRepresentationByUID(toolGroupId: string, segmentationRepresentationUID: string): ToolGroupSpecificRepresentation | undefined;
3005
- removeSegmentationRepresentation(toolGroupId: string, segmentationRepresentationUID: string): void;
3006
- setActiveSegmentationRepresentation(toolGroupId: string, segmentationRepresentationUID: string): void;
3007
- getToolGroupSpecificConfig(toolGroupId: string): SegmentationRepresentationConfig | undefined;
3008
- setSegmentationRepresentationConfig(toolGroupId: string, config: SegmentationRepresentationConfig): void;
3009
- addColorLUT(colorLut: ColorLut, lutIndex: number): void;
3010
- _handleActiveSegmentation(toolGroupId: string, recentlyAddedOrRemovedSegmentationRepresentation: ToolGroupSpecificRepresentation): void;
3011
- _initDefaultColorLutIfNecessary(): void;
3012
- }
3013
-
3014
- declare namespace segmentationVisibility {
3015
- export {
3016
- setSegmentationVisibility,
3017
- getSegmentationVisibility
3018
- }
3019
- }
3020
-
3021
- declare namespace segmentIndex {
3022
- export {
3023
- getActiveSegmentIndex,
3024
- setActiveSegmentIndex,
3025
- getActiveSegmentIndexForSegmentation,
3026
- setActiveSegmentIndexForSegmentation
3027
- }
3028
- }
3029
-
3030
- declare namespace segmentLocking {
3031
- export {
3032
- getSegmentIndexLocked,
3033
- setSegmentIndexLocked,
3034
- getSegmentIndexLockedForSegmentation,
3035
- setSegmentIndexLockedForSegmentation,
3036
- getSegmentsLockedForSegmentation
3037
- }
3038
- }
3039
-
3040
- declare namespace selection {
3041
- export {
3042
- setAnnotationSelected,
3043
- getAnnotationsSelected,
3044
- getAnnotationSelected,
3045
- getAnnotationsSelectedByToolName,
3046
- getAnnotationsSelectedCount,
3047
- isAnnotationSelected
3048
- }
3049
- }
3050
-
3051
- declare function setActiveSegmentationRepresentation(toolGroupId: string, segmentationRepresentationUID: string): void;
3052
-
3053
- declare function setActiveSegmentIndex(toolGroupId: string, segmentIndex: number): void;
3054
-
3055
- declare function setActiveSegmentIndexForSegmentation(segmentationId: string, segmentIndex: number): void;
3056
-
3057
- declare function setAnnotationLocked(annotation: Annotation, locked?: boolean): void;
3058
-
3059
- declare function setAnnotationSelected(annotation: Annotation, selected?: boolean, preserveSelected?: boolean): void;
3060
-
3061
- declare function setAnnotationStyle(toolName: string, annotation: Record<string, unknown>, style: Record<string, unknown>): boolean;
3062
-
3063
- declare function setCursorForElement(element: HTMLElement, cursorName: string): void;
3064
-
3065
- declare function _setElementCursor(element: HTMLElement, cursor: MouseCursor | null): void;
3066
-
3067
- declare function setGlobalConfig(config: SegmentationRepresentationConfig, suppressEvents?: boolean): void;
3068
-
3069
- declare function setGlobalConfig_2(segmentationConfig: SegmentationRepresentationConfig): void;
3070
-
3071
- declare function setGlobalRepresentationConfig(representationType: SegmentationRepresentations, config: RepresentationConfig['LABELMAP']): void;
3072
-
3073
- declare function setGlobalStyle(style: Record<string, unknown>): boolean;
3074
-
3075
- declare function setSegmentationVisibility(toolGroupId: string, segmentationRepresentationUID: string, visibility: boolean): void;
3076
-
3077
- declare function setSegmentIndexLocked(toolGroupId: string, segmentIndex: number, locked?: boolean): void;
3078
-
3079
- declare function setSegmentIndexLockedForSegmentation(segmentationId: string, segmentIndex: number, locked?: boolean): void;
3080
-
3081
- /**
3082
- * Settings
3083
- */
3084
- declare class Settings {
3085
- constructor(base?: Settings) {
3086
- const dictionary = Object.create(
3087
- base instanceof Settings && DICTIONARY in base ? base[DICTIONARY] : null
3088
- )
3089
- Object.seal(
3090
- Object.defineProperty(this, DICTIONARY, {
3091
- value: dictionary,
3092
- })
3093
- )
3094
- }
3095
-
3096
- set(key: string, value: unknown): boolean {
3097
- return set(this[DICTIONARY], key, value, null)
3098
- }
3099
-
3100
- get(key: string): unknown {
3101
- return get(this[DICTIONARY], key)
3102
- }
3103
-
3104
- /**
3105
- * Unset a specific key or a set of keys within a namespace when the key ends with a dot (ASCII #46).
3106
- * If the key is ".", all keys will be removed and this command works as a reset.
3107
- * @param key - name The key to be unset or a namespace.
3108
- * @returns boolean
3109
- */
3110
- unset(key: string): boolean {
3111
- return unset(this[DICTIONARY], key + '')
3112
- }
3113
-
3114
- forEach(callback: (key: string, value: unknown) => void): void {
3115
- iterate(this[DICTIONARY], callback)
3116
- }
3117
-
3118
- extend(): Settings {
3119
- return new Settings(this)
3120
- }
3121
-
3122
- /**
3123
- * Recursively import all properties from the given plain JavaScript object.
3124
- * This method has the opposite effect of the `dump` method.
3125
- * @param root - The root object whose properties will
3126
- * be imported.
3127
- */
3128
- import(root: Record<string, unknown>): void {
3129
- if (isPlainObject(root)) {
3130
- Object.keys(root).forEach((key) => {
3131
- set(this[DICTIONARY], key, root[key], null)
3132
- })
3133
- }
3134
- }
3135
-
3136
- /**
3137
- * Build a JSON representation of the current internal state of this settings
3138
- * object. The returned object can be safely passed to `JSON.stringify`
3139
- * function.
3140
- * @returns The JSON representation of the current
3141
- * state of this settings instance
3142
- */
3143
- dump(): Record<string, unknown> {
3144
- const context = {}
3145
- iterate(this[DICTIONARY], (key, value) => {
3146
- if (typeof value !== 'undefined') {
3147
- deepSet(context, key, value)
3148
- }
3149
- })
3150
- return context
3151
- }
3152
-
3153
- static assert(subject: Settings): Settings {
3154
- return subject instanceof Settings ? subject : Settings.getRuntimeSettings()
3155
- }
3156
-
3157
- static getDefaultSettings(subfield = null): Settings | any {
3158
- let defaultSettings = Settings[DEFAULT_SETTINGS]
3159
- if (!(defaultSettings instanceof Settings)) {
3160
- defaultSettings = new Settings()
3161
- Settings[DEFAULT_SETTINGS] = defaultSettings
3162
- }
3163
-
3164
- // Given subfield of 'segmentation' it will return all settings
3165
- // that starts with segmentation.*
3166
- if (subfield) {
3167
- const settingObj = {}
3168
- defaultSettings.forEach((name: string) => {
3169
- if (name.startsWith(subfield)) {
3170
- const setting = name.split(`${subfield}.`)[1]
3171
- settingObj[setting] = defaultSettings.get(name)
3172
- }
3173
- })
3174
- return settingObj
3175
- }
3176
-
3177
- return defaultSettings
3178
- }
3179
-
3180
- static getRuntimeSettings(): Settings {
3181
- let runtimeSettings = Settings[RUNTIME_SETTINGS]
3182
- if (!(runtimeSettings instanceof Settings)) {
3183
- runtimeSettings = new Settings(Settings.getDefaultSettings())
3184
- Settings[RUNTIME_SETTINGS] = runtimeSettings
3185
- }
3186
- return runtimeSettings
3187
- }
3188
-
3189
- static getObjectSettings(subject: unknown, from?: unknown): Settings {
3190
- let settings = null
3191
- if (subject instanceof Settings) {
3192
- settings = subject
3193
- } else if (typeof subject === 'object' && subject !== null) {
3194
- let objectSettingsMap = Settings[OBJECT_SETTINGS_MAP]
3195
- if (!(objectSettingsMap instanceof WeakMap)) {
3196
- objectSettingsMap = new WeakMap()
3197
- Settings[OBJECT_SETTINGS_MAP] = objectSettingsMap
3198
- }
3199
- settings = objectSettingsMap.get(subject)
3200
- if (!(settings instanceof Settings)) {
3201
- settings = new Settings(
3202
- Settings.assert(Settings.getObjectSettings(from))
3203
- )
3204
- objectSettingsMap.set(subject, settings)
3205
- }
3206
- }
3207
- return settings
3208
- }
3209
-
3210
- static extendRuntimeSettings(): Settings {
3211
- return Settings.getRuntimeSettings().extend()
3212
- }
3213
- }
3214
-
3215
- declare type SetToolBindingsType = {
3216
- bindings: IToolBinding[];
3217
- };
3218
-
3219
- declare function setToolGroupSpecificConfig(toolGroupId: string, config: SegmentationRepresentationConfig, suppressEvents?: boolean): void;
3220
-
3221
- declare function setToolGroupSpecificConfig_2(toolGroupId: string, segmentationRepresentationConfig: SegmentationRepresentationConfig): void;
3222
-
3223
- declare function setToolStyle(toolName: string, style: Record<string, unknown>): boolean;
3224
-
3225
- declare type ShapeFnCriteria = (pointIJK: Types_2.Point3, pointLPS: Types_2.Point3) => boolean;
3226
-
3227
- declare type SharedToolProp = {
3228
- supportedInteractionTypes?: Array<string>;
3229
- configuration?: Record<string, any>;
3230
- };
3231
-
3232
- declare function snapFocalPointToSlice(focalPoint: Types_2.Point3, position: Types_2.Point3, scrollRange: any, viewPlaneNormal: Types_2.Point3, spacingInNormalDirection: number, deltaFrames: number): {
3233
- newFocalPoint: Types_2.Point3;
3234
- newPosition: Types_2.Point3;
3235
- };
3236
-
3237
- export declare class SphereScissorsTool extends BaseTool {
3238
- static toolName: string;
3239
- editData: {
3240
- annotation: any;
3241
- segmentation: any;
3242
- segmentIndex: number;
3243
- segmentsLocked: number[];
3244
- segmentationId: string;
3245
- toolGroupId: string;
3246
- segmentColor: [number, number, number, number];
3247
- viewportIdsToRender: string[];
3248
- handleIndex?: number;
3249
- movingTextBox: boolean;
3250
- newAnnotation?: boolean;
3251
- hasMoved?: boolean;
3252
- centerCanvas?: Array<number>;
3253
- } | null;
3254
- isDrawing: boolean;
3255
- isHandleOutsideImage: boolean;
3256
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
3257
- addNewAnnotation: (evt: EventTypes_2.MouseDownActivateEventType) => void;
3258
- _mouseDragCallback: (evt: EventTypes_2.MouseDragEventType) => void;
3259
- _mouseUpCallback: (evt: EventTypes_2.MouseUpEventType | EventTypes_2.MouseClickEventType) => void;
3260
- _activateDraw: (element: any) => void;
3261
- _deactivateDraw: (element: any) => void;
3262
- renderAnnotation: (enabledElement: Types_2.IEnabledElement, svgDrawingHelper: any) => void;
3263
- }
3264
-
3265
- /**
3266
- * START_NEW_IMAGE
3267
- */
3268
- declare type StackNewImageEvent = CustomEvent_2<StackNewImageEventDetail>
3269
-
3270
- /**
3271
- * STACK_NEW_IMAGE Event's data
3272
- */
3273
- declare type StackNewImageEventDetail = {
3274
- /** the new image set on the stack viewport */
3275
- image: IImage
3276
- /** the image imageId */
3277
- imageId: string
3278
- /** unique id for the viewport */
3279
- viewportId: string
3280
- /** unique id for the renderingEngine */
3281
- renderingEngineId: string
3282
- }
3283
-
3284
- export declare class StackScrollMouseWheelTool extends BaseTool {
3285
- static toolName: string;
3286
- _configuration: any;
3287
- constructor(toolProps?: {}, defaultToolProps?: {
3288
- supportedInteractionTypes: string[];
3289
- invert: boolean;
3290
- });
3291
- mouseWheelCallback(evt: MouseWheelEventType): void;
3292
- }
3293
-
3294
- export declare class StackScrollTool extends BaseTool {
3295
- static toolName: string;
3296
- touchDragCallback: () => void;
3297
- mouseDragCallback: () => void;
3298
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
3299
- _dragCallback(evt: EventTypes_2.MouseDragEventType): void;
3300
- }
3301
-
3302
- declare namespace stackScrollTool {
3303
- export {
3304
- snapFocalPointToSlice,
3305
- getSliceRange,
3306
- scrollThroughStack,
3307
- _default_2 as default
3308
- }
3309
- }
3310
-
3311
- /**
3312
- * Stack Viewport Properties
3313
- */
3314
- declare type StackViewportProperties = {
3315
- /** voi range (upper, lower) for the viewport */
3316
- voiRange?: VOIRange
3317
- /** invert flag - whether the image is inverted */
3318
- invert?: boolean
3319
- /** interpolation type - linear or nearest neighbor */
3320
- interpolationType?: InterpolationType
3321
- /** image rotation */
3322
- rotation?: number
3323
- /** flip horizontal flag */
3324
- flipHorizontal?: boolean
3325
- /** flip vertical flag */
3326
- flipVertical?: boolean
3327
- }
3328
-
3329
- declare namespace state {
3330
- export {
3331
- getAnnotations,
3332
- addAnnotation,
3333
- getAnnotation,
3334
- removeAnnotation,
3335
- getViewportSpecificAnnotationManager,
3336
- getDefaultAnnotationManager
3337
- }
3338
- }
3339
-
3340
- declare namespace state_2 {
3341
- export {
3342
- getDefaultSegmentationStateManager,
3343
- getSegmentation,
3344
- getSegmentations,
3345
- addSegmentation,
3346
- getSegmentationRepresentations,
3347
- addSegmentationRepresentation,
3348
- removeSegmentationRepresentation,
3349
- getToolGroupSpecificConfig,
3350
- setToolGroupSpecificConfig,
3351
- getGlobalConfig,
3352
- setGlobalConfig,
3353
- getToolGroupsWithSegmentation,
3354
- getSegmentationRepresentationByUID,
3355
- addColorLUT,
3356
- getColorLut
3357
- }
3358
- }
3359
-
3360
- declare type SVGCursorDescriptor = {
3361
- iconContent: string;
3362
- iconSize: number;
3363
- viewBox: SVGPoint_2;
3364
- mousePoint: SVGPoint_2;
3365
- mousePointerGroupString: string;
3366
- };
3367
-
3368
- declare class SVGMouseCursor extends ImageMouseCursor {
3369
- constructor(url: string, x?: number, y?: number, name?: string | undefined, fallback?: MouseCursor | undefined);
3370
- static getDefinedCursor(name: string, pointer?: boolean, color?: string): MouseCursor;
3371
- }
3372
-
3373
- declare type SVGPoint_2 = {
3374
- x: number;
3375
- y: number;
3376
- };
3377
-
3378
- export declare class Synchronizer {
3379
- private _enabled;
3380
- private _eventName;
3381
- private _eventHandler;
3382
- private _ignoreFiredEvents;
3383
- private _sourceViewports;
3384
- private _targetViewports;
3385
- id: string;
3386
- constructor(synchronizerId: string, eventName: string, eventHandler: ISynchronizerEventHandler);
3387
- isDisabled(): boolean;
3388
- add(viewportInfo: Types_2.IViewportId): void;
3389
- addSource(viewportInfo: Types_2.IViewportId): void;
3390
- addTarget(viewportInfo: Types_2.IViewportId): void;
3391
- getSourceViewports(): Array<Types_2.IViewportId>;
3392
- getTargetViewports(): Array<Types_2.IViewportId>;
3393
- destroy(): void;
3394
- remove(viewportInfo: Types_2.IViewportId): void;
3395
- removeSource(viewportInfo: Types_2.IViewportId): void;
3396
- removeTarget(viewportInfo: Types_2.IViewportId): void;
3397
- hasSourceViewport(renderingEngineId: string, viewportId: string): boolean;
3398
- private fireEvent;
3399
- private _onEvent;
3400
- private _hasSourceElements;
3401
- private _updateDisableHandlers;
3402
- }
3403
-
3404
- declare namespace SynchronizerManager {
3405
- export {
3406
- createSynchronizer,
3407
- destroy_2 as destroy,
3408
- getSynchronizerById,
3409
- getSynchronizers,
3410
- getAllSynchronizers,
3411
- destroySynchronizerById
3412
- }
3413
- }
3414
- export { SynchronizerManager }
3415
-
3416
- declare namespace synchronizers {
3417
- export {
3418
- createCameraPositionSynchronizer,
3419
- createVOISynchronizer
3420
- }
3421
- }
3422
- export { synchronizers }
3423
-
3424
- declare type TextBoxHandle = {
3425
- hasMoved: boolean;
3426
- worldBoundingBox: {
3427
- bottomLeft: Types_2.Point3;
3428
- bottomRight: Types_2.Point3;
3429
- topLeft: Types_2.Point3;
3430
- topRight: Types_2.Point3;
3431
- };
3432
- worldPosition: Types_2.Point3;
3433
- };
3434
-
3435
- declare type ThresholdRangeOptions = {
3436
- higherThreshold: number;
3437
- lowerThreshold: number;
3438
- numSlicesToProject?: number;
3439
- overwrite: boolean;
3440
- };
3441
-
3442
- declare function thresholdVolumeByRange(annotations: AnnotationForThresholding[], referenceVolumes: Types_2.IImageVolume[], segmentationRepresentation: ToolGroupSpecificRepresentation, options: ThresholdRangeOptions): Types_2.IImageVolume;
3443
-
3444
- declare function throttle(func: Function, wait?: number, options?: {
3445
- leading?: boolean;
3446
- trailing?: boolean;
3447
- }): Function;
3448
-
3449
- declare type ToolBindingKeyboardType = typeof KeyboardBindings[keyof typeof KeyboardBindings];
3450
-
3451
- declare type ToolBindingMouseType = typeof MouseBindings[keyof typeof MouseBindings];
3452
-
3453
- declare namespace ToolGroupManager {
3454
- export {
3455
- createToolGroup,
3456
- destroy_3 as destroy,
3457
- destroyToolGroupById,
3458
- getToolGroupById,
3459
- getToolGroup,
3460
- getAllToolGroups
3461
- }
3462
- }
3463
- export { ToolGroupManager }
3464
-
3465
- declare type ToolGroupSpecificLabelmapRepresentation = ToolGroupSpecificRepresentationState & {
3466
- config: LabelmapRenderingConfig;
3467
- };
3468
-
3469
- declare type ToolGroupSpecificRepresentation = ToolGroupSpecificLabelmapRepresentation;
3470
-
3471
- declare type ToolGroupSpecificRepresentationState = {
3472
- segmentationRepresentationUID: string;
3473
- segmentationId: string;
3474
- type: Enums_2.SegmentationRepresentations;
3475
- active: boolean;
3476
- segmentsHidden: Set<number>;
3477
- visibility: boolean;
3478
- colorLUTIndex: number;
3479
- };
3480
-
3481
- declare type ToolHandle = AnnotationHandle | TextBoxHandle;
3482
-
3483
- declare enum ToolModes {
3484
- Active = "Active",
3485
- Passive = "Passive",
3486
- Enabled = "Enabled",
3487
- Disabled = "Disabled"
3488
- }
3489
-
3490
- declare type ToolOptionsType = {
3491
- bindings: IToolBinding[];
3492
- mode: ToolModes;
3493
- };
3494
-
3495
- declare type ToolProps = SharedToolProp;
3496
-
3497
- /** used for CPU rendering */
3498
- declare type TransformMatrix2D = [number, number, number, number, number, number]
3499
-
3500
- declare function transformPhysicalToIndex(imageData: any, physicalPoint: any): any;
3501
-
3502
- declare function triggerAnnotationRenderForViewportIds(renderingEngine: Types_2.IRenderingEngine, viewportIdsToRender: string[]): void;
3503
-
3504
- /**
3505
- * Small utility to trigger a custom event for a given EventTarget.
3506
- *
3507
- * @example
3508
- *
3509
- * ```javascript
3510
- * triggerEvent(element, Events.IMAGE_RENDERED, { element })
3511
- * ```
3512
- * or it can trigger event on the eventTarget itself
3513
- *
3514
- * ```javascript
3515
- * triggerEvent(eventTarget, CSTOOLS_EVENTS.ANNOTATION_MODIFIED, { viewportId, annotationUID })
3516
- * ```
3517
- *
3518
- * @param el - The element or EventTarget to trigger the event upon
3519
- * @param type - The event type name
3520
- * @param detail - The event detail to be sent
3521
- * @returns false if event is cancelable and at least one of the event handlers
3522
- * which received event called Event.preventDefault(). Otherwise it returns true.
3523
- */
3524
- declare function triggerEvent(
3525
- el: EventTarget = eventTarget,
3526
- type: string,
3527
- detail: unknown = null
3528
- ): boolean {
3529
- if (!type) {
3530
- throw new Error('Event type was not defined')
3531
- }
3532
-
3533
- const event = new CustomEvent(type, {
3534
- detail,
3535
- cancelable: true,
3536
- })
3537
-
3538
- return el.dispatchEvent(event)
3539
- }
3540
-
3541
- declare function triggerSegmentationDataModified(segmentationId: string): void;
3542
-
3543
- declare namespace triggerSegmentationEvents {
3544
- export {
3545
- triggerSegmentationRepresentationModified,
3546
- triggerSegmentationRepresentationRemoved,
3547
- triggerSegmentationDataModified,
3548
- triggerSegmentationModified
3549
- }
3550
- }
3551
-
3552
- declare function triggerSegmentationModified(segmentationId?: string): void;
3553
-
3554
- declare function triggerSegmentationRepresentationModified(toolGroupId: string, segmentationRepresentationUID?: string): void;
3555
-
3556
- declare function triggerSegmentationRepresentationRemoved(toolGroupId: string, segmentationRepresentationUID: string): void;
3557
-
3558
- declare namespace Types {
3559
- export {
3560
- Annotation,
3561
- Annotations,
3562
- FrameOfReferenceSpecificAnnotations,
3563
- AnnotationState,
3564
- PlanarBoundingBox,
3565
- ToolProps,
3566
- PublicToolProps,
3567
- EventTypes_2 as EventTypes,
3568
- IPoints,
3569
- IToolBinding,
3570
- SetToolBindingsType,
3571
- ToolOptionsType,
3572
- InteractionTypes,
3573
- IToolGroup,
3574
- ToolHandle,
3575
- AnnotationHandle,
3576
- TextBoxHandle,
3577
- Segmentation,
3578
- SegmentationState,
3579
- SegmentationRepresentationData,
3580
- SegmentationRepresentationConfig,
3581
- RepresentationConfig,
3582
- ToolGroupSpecificRepresentationState,
3583
- ToolGroupSpecificLabelmapRepresentation,
3584
- ToolGroupSpecificRepresentation,
3585
- Color,
3586
- ColorLut,
3587
- SVGCursorDescriptor,
3588
- SVGPoint_2 as SVGPoint
3589
- }
3590
- }
3591
- export { Types }
3592
-
3593
- declare namespace Types_2 {
3594
- export {
3595
- ICamera,
3596
- IStackViewport,
3597
- IVolumeViewport,
3598
- IEnabledElement,
3599
- ICache,
3600
- IVolume,
3601
- IViewportId,
3602
- IImageVolume,
3603
- IRenderingEngine,
3604
- ScalingParameters,
3605
- PTScaling,
3606
- Scaling,
3607
- IStreamingImageVolume,
3608
- IImage,
3609
- IImageData,
3610
- CPUIImageData,
3611
- CPUImageData,
3612
- EventTypes,
3613
- ImageLoaderFn,
3614
- VolumeLoaderFn,
3615
- IRegisterImageLoader,
3616
- IStreamingVolumeProperties,
3617
- IViewport,
3618
- StackViewportProperties,
3619
- PublicViewportInput,
3620
- VolumeActor,
3621
- ActorEntry,
3622
- IImageLoadObject,
3623
- IVolumeLoadObject,
3624
- IVolumeInput,
3625
- VolumeInputCallback,
3626
- Metadata,
3627
- Orientation,
3628
- Point2,
3629
- Point3,
3630
- Point4,
3631
- Plane,
3632
- ViewportInputOptions,
3633
- VOIRange,
3634
- VOI,
3635
- FlipDirection,
3636
- ICachedImage,
3637
- ICachedVolume,
3638
- CPUFallbackEnabledElement,
3639
- CPUFallbackViewport,
3640
- CPUFallbackTransform,
3641
- CPUFallbackColormapData,
3642
- CPUFallbackViewportDisplayedArea,
3643
- CPUFallbackColormapsData,
3644
- CPUFallbackColormap,
3645
- TransformMatrix2D,
3646
- CPUFallbackLookupTable,
3647
- CPUFallbackLUT,
3648
- CPUFallbackRenderingTools,
3649
- CustomEvent_2 as CustomEventType
3650
- }
3651
- }
3652
-
3653
- declare function unlockAllAnnotations(): void;
3654
-
3655
- declare namespace utilities {
3656
- export {
3657
- math,
3658
- planar,
3659
- viewportFilters,
3660
- stackScrollTool,
3661
- drawing_2 as drawing,
3662
- debounce,
3663
- deepmerge as deepMerge,
3664
- throttle,
3665
- isObject,
3666
- triggerEvent,
3667
- calibrateImageSpacing,
3668
- segmentation_2 as segmentation,
3669
- triggerAnnotationRenderForViewportIds,
3670
- pointInShapeCallback,
3671
- pointInSurroundingSphereCallback,
3672
- getAnnotationNearPoint,
3673
- getAnnotationNearPointOnEnabledElement,
3674
- transformPhysicalToIndex
3675
- }
3676
- }
3677
- export { utilities }
3678
-
3679
- declare namespace vec2 {
3680
- export {
3681
- findClosestPoint,
3682
- clip as liangBarksyClip
3683
- }
3684
- }
3685
-
3686
- declare namespace viewportFilters {
3687
- export {
3688
- filterViewportsWithToolEnabled,
3689
- filterViewportsWithFrameOfReferenceUID,
3690
- getViewportIdsWithToolToRender
3691
- }
3692
- }
3693
-
3694
- /**
3695
- * This type defines the shape of viewport input options, so we can throw when it is incorrect.
3696
- */
3697
- declare type ViewportInputOptions = {
3698
- /** background color */
3699
- background?: [number, number, number]
3700
- /** orientation of the viewport - Axial, Coronal, Sagittal */
3701
- orientation?: Orientation
3702
- /** whether the events should be suppressed and not fired*/
3703
- suppressEvents?: boolean
3704
- }
3705
-
3706
- declare type ViewportInputs = Array<Types_2.IViewportId>;
3707
-
3708
- /**
3709
- * ViewportType enum for cornerstone-render which defines the type of viewport.
3710
- * It can be either STACK, PERSPECTIVE, ORTHOGRAPHIC.
3711
- */
3712
- declare enum ViewportType {
3713
- /**
3714
- * - Suitable for rendering a stack of images, that might or might not belong to the same image.
3715
- * - Stack can include 2D images of different shapes, size and direction
3716
- */
3717
- STACK = 'stack',
3718
- /**
3719
- * - Suitable for rendering a volumetric data which is considered as one 3D image.
3720
- * - Having a VolumeViewport enables Multi-planar reformation or reconstruction (MPR) by design, in which you can visualize the volume from various different orientations without addition of performance costs.
3721
- */
3722
- ORTHOGRAPHIC = 'orthographic',
3723
- /** Perspective Viewport: Not Implemented yet */
3724
- PERSPECTIVE = 'perspective',
3725
- }
3726
-
3727
- declare type VOI = {
3728
- /** Window Width for display */
3729
- windowWidth: number
3730
- /** Window Center for display */
3731
- windowCenter: number
3732
- }
3733
-
3734
- /**
3735
- * VOI_MODIFIED Event type
3736
- */
3737
- declare type VoiModifiedEvent = CustomEvent_2<VoiModifiedEventDetail>
3738
-
3739
- /**
3740
- * VOI_MODIFIED Event's data
3741
- */
3742
- declare type VoiModifiedEventDetail = {
3743
- /** Viewport Unique ID in the renderingEngine */
3744
- viewportId: string
3745
- /** Unique ID for the volume in the cache */
3746
- volumeId: string
3747
- /** new VOI range */
3748
- range: VOIRange
3749
- }
3750
-
3751
- declare type VOIRange = {
3752
- /** upper value for display */
3753
- upper: number
3754
- /** lower value for display */
3755
- lower: number
3756
- }
3757
-
3758
- /** volume actor which is vtkVolume */
3759
- declare type VolumeActor = vtkVolume
3760
-
3761
- /**
3762
- * VOLUME_CACHE_VOLUME_ADDED Event type
3763
- */
3764
- declare type VolumeCacheVolumeAddedEvent =
3765
- CustomEvent_2<VolumeCacheVolumeAddedEventDetail>
3766
-
3767
- /**
3768
- * VOLUME_CACHE_VOLUME_ADDED Event's data
3769
- */
3770
- declare type VolumeCacheVolumeAddedEventDetail = {
3771
- /** the added volume */
3772
- volume: ICachedVolume
3773
- }
3774
-
3775
- /**
3776
- * VOLUME_CACHE_VOLUME_REMOVED Event type
3777
- */
3778
- declare type VolumeCacheVolumeRemovedEvent =
3779
- CustomEvent_2<VolumeCacheVolumeRemovedEventDetail>
3780
-
3781
- /**
3782
- * VOLUME_CACHE_VOLUME_REMOVED Event's data
3783
- */
3784
- declare type VolumeCacheVolumeRemovedEventDetail = {
3785
- /** the removed volume id */
3786
- volumeId: string
3787
- }
3788
-
3789
- /**
3790
- * Volume input callback type, used to perform operations on the volume data
3791
- * after it has been loaded.
3792
- */
3793
- declare type VolumeInputCallback = (params: {
3794
- /** vtk volume actor */
3795
- volumeActor: VolumeActor
3796
- /** unique volume Id in the cache */
3797
- volumeId: string
3798
- }) => unknown
3799
-
3800
- /**
3801
- * VOLUME_LOADED Event type
3802
- */
3803
- declare type VolumeLoadedEvent = CustomEvent_2<VolumeLoadedEventDetail>
3804
-
3805
- /**
3806
- * VOLUME_LOADED Event's data
3807
- */
3808
- declare type VolumeLoadedEventDetail = {
3809
- /** the loaded volume */
3810
- volume: IImageVolume
3811
- }
3812
-
3813
- /**
3814
- * VOLUME_LOADED_FAILED Event type
3815
- */
3816
- declare type VolumeLoadedFailedEvent = CustomEvent_2<VolumeLoadedFailedEventDetail>
3817
-
3818
- /**
3819
- * VOLUME_LOADED_FAILED Event's data
3820
- */
3821
- declare type VolumeLoadedFailedEventDetail = {
3822
- /** the volumeId for the volume */
3823
- volumeId: string
3824
- error: unknown
3825
- }
3826
-
3827
- /**
3828
- * Any volumeLoader function should implement a loading given the volumeId
3829
- * and returns a mandatory promise which will resolve to the loaded volume object.
3830
- * Additional `cancelFn` and `decache` can be implemented.
3831
- */
3832
- declare type VolumeLoaderFn = (
3833
- volumeId: string,
3834
- options?: Record<string, any>
3835
- ) => {
3836
- /** promise that resolves to the volume object */
3837
- promise: Promise<Record<string, any>>
3838
- /** cancel function */
3839
- cancelFn?: () => void | undefined
3840
- /** decache function */
3841
- decache?: () => void | undefined
3842
- }
3843
-
3844
- export declare class VolumeRotateMouseWheelTool extends BaseTool {
3845
- static toolName: string;
3846
- _configuration: any;
3847
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
3848
- mouseWheelCallback(evt: MouseWheelEventType): void;
3849
- }
3850
-
3851
- export declare class WindowLevelTool extends BaseTool {
3852
- static toolName: string;
3853
- touchDragCallback: () => void;
3854
- mouseDragCallback: () => void;
3855
- constructor(toolProps?: {}, defaultToolProps?: {
3856
- supportedInteractionTypes: string[];
3857
- });
3858
- _dragCallback(evt: any): void;
3859
- getPTNewRange({ deltaPointsCanvas, lower, upper, clientHeight }: {
3860
- deltaPointsCanvas: any;
3861
- lower: any;
3862
- upper: any;
3863
- clientHeight: any;
3864
- }): {
3865
- lower: any;
3866
- upper: any;
3867
- };
3868
- getNewRange({ deltaPointsCanvas, useDynamicRange, volumeId, lower, upper }: {
3869
- deltaPointsCanvas: any;
3870
- useDynamicRange: any;
3871
- volumeId: any;
3872
- lower: any;
3873
- upper: any;
3874
- }): {
3875
- lower: number;
3876
- upper: number;
3877
- };
3878
- _getMultiplyerFromDynamicRange(volumeId: any): number;
3879
- _getImageDynamicRange: (volumeId: string) => number;
3880
- }
3881
-
3882
- export declare class ZoomTool extends BaseTool {
3883
- static toolName: string;
3884
- touchDragCallback: () => void;
3885
- mouseDragCallback: () => void;
3886
- constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
3887
- _dragCallback(evt: any): void;
3888
- _dragParallelProjection: (evt: any, camera: any) => void;
3889
- _dragPerspectiveProjection: (evt: any, camera: any) => void;
3890
- }
3891
-
3892
- export { }