@3cr/viewer-browser 0.0.248 → 0.0.293

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 (520) hide show
  1. package/.circleci/config.yml +53 -0
  2. package/README.md +79 -74
  3. package/components.d.ts +94 -36
  4. package/dist/Viewer3CR.js +663 -47
  5. package/dist/Viewer3CR.mjs +107687 -36565
  6. package/dist/Viewer3CR.umd.js +663 -47
  7. package/index.html +35 -33
  8. package/package.json +27 -8
  9. package/playground/img.png +0 -0
  10. package/playground/index.html +6 -2
  11. package/src/App.vue +41 -97
  12. package/src/__tests__/app.spec.ts +2 -1
  13. package/src/__tests__/main.spec.ts +14 -14
  14. package/src/assets/_palette.scss +112 -0
  15. package/src/assets/_settings.scss +64 -0
  16. package/src/assets/_typography.scss +187 -0
  17. package/src/assets/images/cloud-storage.svg +22 -0
  18. package/src/assets/images/courtney.png +0 -0
  19. package/src/assets/images/dark/magic-wand.svg +32 -0
  20. package/src/assets/images/dark-theme.svg +33 -0
  21. package/src/assets/images/dot.svg +5 -0
  22. package/src/assets/images/dr-miles.png +0 -0
  23. package/src/assets/images/illustration.svg +118 -0
  24. package/src/assets/images/intro.svg +30 -0
  25. package/src/assets/{magic_wand.svg → images/light/magic-wand.svg} +22 -14
  26. package/src/assets/images/light-theme.svg +33 -0
  27. package/src/assets/images/system-theme.svg +51 -0
  28. package/src/assets/images/totalSegmentator.png +0 -0
  29. package/src/assets/logos/3dicom/black/black.svg +30 -0
  30. package/src/assets/logos/3dicom/colour/colour.svg +18 -0
  31. package/src/assets/logos/3dicom/colour/colour_single.svg +18 -0
  32. package/src/assets/logos/3dicom/wordmark/patients/patients.svg +29 -0
  33. package/src/assets/logos/3dicom/wordmark/powered-by/powered-by.svg +41 -0
  34. package/src/assets/logos/3dicom/wordmark/practitioners/practitioner.svg +34 -0
  35. package/src/assets/logos/3dicom/wordmark/research/research.svg +29 -0
  36. package/src/assets/logos/license/black/black.svg +22 -0
  37. package/src/assets/logos/license/white/white.svg +22 -0
  38. package/src/assets/styles.scss +435 -12
  39. package/src/components/ShFlatIconBtn.vue +36 -0
  40. package/src/components/ShPlainIconBtn.vue +42 -0
  41. package/src/components/ShSelect.vue +48 -0
  42. package/src/components/ShTextField.vue +39 -0
  43. package/src/components/ShTextarea.vue +39 -0
  44. package/src/components/__tests__/ShFlatIconBtn.spec.ts +32 -0
  45. package/src/components/__tests__/ShPlainIconBtn.spec.ts +37 -0
  46. package/src/components/__tests__/ShSelect.spec.ts +30 -0
  47. package/src/components/__tests__/ShTextField.spec.ts +30 -0
  48. package/src/components/__tests__/ShTextarea.spec.ts +30 -0
  49. package/src/components/demo/CloudDropZone.vue +105 -0
  50. package/src/components/demo/DemoAvatarDropdownMenu.vue +343 -0
  51. package/src/components/demo/DemoInfoModal.vue +60 -0
  52. package/src/components/demo/DemoNotificationNavigationDrawer.vue +118 -0
  53. package/src/components/demo/DemoPurchaseCreditsModal.vue +141 -0
  54. package/src/components/demo/DemoUpgradeCloudStorageModal.vue +74 -0
  55. package/src/components/demo/DemoUpgradePlanModal.vue +17 -0
  56. package/src/components/demo/UploadDicomToCloudModal.vue +225 -0
  57. package/src/components/demo/__tests__/CloudDropZone.spec.ts +132 -0
  58. package/src/components/demo/__tests__/DemoAvatarDropdownMenu.spec.ts +16 -0
  59. package/src/components/demo/{licence/__tests__/DemoLicenceEnableCloudStorageModal.spec.ts → __tests__/DemoEnableCloudStorageModal.spec.ts} +11 -11
  60. package/src/components/demo/{licence/__tests__/DemoLicenceInfoModal.spec.ts → __tests__/DemoInfoModal.spec.ts} +11 -8
  61. package/src/components/demo/__tests__/DemoNotificationNavigationDrawer.spec.ts +56 -0
  62. package/src/components/demo/__tests__/UploadDicomToCloudModal.spec.ts +320 -0
  63. package/src/components/demo/__tests__/demo-payload.spec.ts +10 -0
  64. package/src/components/demo/demo-notifications.ts +45 -0
  65. package/src/components/demo/demo-payload.ts +9 -0
  66. package/src/components/demo/fileReader.ts +47 -0
  67. package/src/{composables/useViewerOptions.ts → components/demo/mockDemoViewerStlDecimator.ts} +8 -12
  68. package/src/components/intro/ViewerIntro.vue +56 -0
  69. package/src/components/intro/ViewerTour.vue +53 -0
  70. package/src/components/intro/tour/Tour.vue +205 -0
  71. package/src/components/intro/tour/step.ts +6 -0
  72. package/src/components/modal/ActionRail.vue +4 -0
  73. package/src/components/modal/Viewer3cr.vue +224 -0
  74. package/src/components/modal/Viewer3crWebGL.vue +65 -0
  75. package/src/components/modal/ViewerActionRail.vue +10 -27
  76. package/src/components/modal/ViewerMain.vue +84 -0
  77. package/src/components/modal/ViewerNavigationDrawer.vue +269 -68
  78. package/src/components/modal/ViewerScanView.vue +223 -67
  79. package/src/components/modal/__tests__/{MftpWebGL3DRModal.spec.ts → Viewer3cr.spec.ts} +154 -53
  80. package/src/components/modal/__tests__/{WebGL3DR.spec.ts → Viewer3crWebGL.spec.ts} +11 -11
  81. package/src/components/modal/__tests__/ViewerNavigationDrawer.spec.ts +271 -11
  82. package/src/components/modal/__tests__/ViewerScanView.spec.ts +15 -7
  83. package/src/components/modal/actions/Action.vue +3 -8
  84. package/src/components/modal/actions/Flip3dAction.vue +31 -16
  85. package/src/components/modal/actions/FlipHorizontalAction.vue +14 -5
  86. package/src/components/modal/actions/FlipVerticalAction.vue +14 -5
  87. package/src/components/modal/actions/FullscreenAction.vue +9 -5
  88. package/src/components/modal/actions/PanAction.vue +11 -51
  89. package/src/components/modal/actions/ResetViewAction.vue +10 -8
  90. package/src/components/modal/actions/Rotate2dAction.vue +25 -15
  91. package/src/components/modal/actions/Slice3dAction.vue +22 -10
  92. package/src/components/modal/actions/ZoomAction.vue +21 -13
  93. package/src/components/modal/actions/__tests__/Action.spec.ts +2 -2
  94. package/src/components/modal/actions/__tests__/Flip3dAction.spec.ts +58 -14
  95. package/src/components/modal/actions/__tests__/FlipHorizontalAction.spec.ts +15 -5
  96. package/src/components/modal/actions/__tests__/FlipVerticalAction.spec.ts +15 -5
  97. package/src/components/modal/actions/__tests__/FullscreenAction.spec.ts +7 -5
  98. package/src/components/modal/actions/__tests__/PanAction.spec.ts +13 -32
  99. package/src/components/modal/actions/__tests__/ResetViewAction.spec.ts +5 -3
  100. package/src/components/modal/actions/__tests__/Rotate2dAction.spec.ts +13 -6
  101. package/src/components/modal/actions/__tests__/Slice3dAction.spec.ts +1 -1
  102. package/src/components/modal/actions/__tests__/ZoomAction.spec.ts +25 -11
  103. package/src/components/modal/app-bars/ViewerActionBar.vue +224 -0
  104. package/src/components/modal/app-bars/ViewerAppBar.vue +126 -0
  105. package/src/components/modal/app-bars/__tests__/ViewerActionBar.spec.ts +176 -0
  106. package/src/components/modal/app-bars/__tests__/ViewerAppBar.spec.ts +99 -0
  107. package/src/components/modal/layouts/Layout1x3ClipPath.vue +35 -0
  108. package/src/components/modal/layouts/Layout2x2ClipPath.vue +35 -0
  109. package/src/components/modal/layouts/LayoutFullscreenClipPath.vue +29 -0
  110. package/src/components/modal/layouts/__tests__/Layout1x3ClipPath.spec.ts +15 -0
  111. package/src/components/modal/layouts/__tests__/Layout2x2ClipPath.spec.ts +15 -0
  112. package/src/components/modal/layouts/__tests__/LayoutFullscreenClipPath.spec.ts +15 -0
  113. package/src/components/modal/layouts/composables/__tests__/useLayout1x3.spec.ts +40 -0
  114. package/src/components/modal/layouts/composables/__tests__/useLayout2x2.spec.ts +40 -0
  115. package/src/components/modal/layouts/composables/__tests__/useLayoutFullscreen.spec.ts +40 -0
  116. package/src/components/modal/layouts/composables/useLayout1x3.ts +46 -0
  117. package/src/components/modal/layouts/composables/useLayout2x2.ts +46 -0
  118. package/src/components/modal/layouts/composables/useLayoutFullscreen.ts +24 -0
  119. package/src/components/modal/menus/AutoAnnotateMenu.vue +67 -0
  120. package/src/components/modal/menus/AvatarDropdownMenu.vue +66 -0
  121. package/src/components/modal/menus/HelpMenu.vue +47 -0
  122. package/src/components/modal/menus/SettingsMenu.vue +242 -92
  123. package/src/components/modal/menus/ShareMenu.vue +58 -0
  124. package/src/components/modal/menus/__tests__/AutoAnnotateMenu.spec.ts +80 -0
  125. package/src/components/modal/menus/__tests__/AvatarDropdownMenu.spec.ts +49 -0
  126. package/src/components/modal/menus/__tests__/HelpMenu.spec.ts +12 -0
  127. package/src/components/modal/menus/__tests__/SettingsMenu.spec.ts +163 -57
  128. package/src/components/modal/modal/AboutModal.vue +61 -0
  129. package/src/components/modal/modal/AiModelList.vue +70 -0
  130. package/src/components/modal/{AskAI.vue → modal/AskAiModal.vue} +26 -34
  131. package/src/components/modal/modal/AutoAnnotateModal.vue +136 -0
  132. package/src/components/modal/modal/CloseViewerModal.vue +108 -0
  133. package/src/components/modal/modal/DataOverlayGeneralModal.vue +122 -0
  134. package/src/components/modal/modal/DataOverlayMeasurementModal.vue +59 -0
  135. package/src/components/modal/modal/DataOverlayModal.vue +121 -0
  136. package/src/components/modal/modal/ShareModal.vue +201 -0
  137. package/src/components/modal/modal/UploadsDrawer.vue +165 -0
  138. package/src/components/modal/modal/WhatsNewModal.vue +45 -0
  139. package/src/components/modal/modal/__tests__/AboutModal.spec.ts +60 -0
  140. package/src/components/modal/modal/__tests__/AiModelList.spec.ts +50 -0
  141. package/src/components/modal/{__tests__ → modal/__tests__}/AskAI.spec.ts +8 -7
  142. package/src/components/modal/modal/__tests__/AutoAnnotateModal.spec.ts +29 -0
  143. package/src/components/modal/modal/__tests__/CloseViewerModal.spec.ts +60 -0
  144. package/src/components/modal/modal/__tests__/DataOverlayGeneralModal.spec.ts +55 -0
  145. package/src/components/modal/modal/__tests__/DataOverlayMeasurementModal.spec.ts +82 -0
  146. package/src/components/modal/modal/__tests__/DataOverlayModal.spec.ts +94 -0
  147. package/src/components/modal/modal/__tests__/ShareModal.spec.ts +260 -0
  148. package/src/components/modal/modal/__tests__/UploadsDrawer.spec.ts +174 -0
  149. package/src/components/modal/modal/__tests__/WhatsNewModal.spec.ts +29 -0
  150. package/src/components/modal/snackbars/AnnotationGeneratedSnackbar.vue +34 -0
  151. package/src/components/modal/snackbars/ImagesSharedSnackbar.vue +26 -0
  152. package/src/components/modal/snackbars/LinkCopiedSnackbar.vue +26 -0
  153. package/src/components/modal/snackbars/__tests__/AnnotationGeneratedSnackbar.spec.ts +43 -0
  154. package/src/components/modal/snackbars/__tests__/ImagesSharedSnackbar.spec.ts +22 -0
  155. package/src/components/modal/snackbars/__tests__/LinkCopiedSnackbar.spec.ts +21 -0
  156. package/src/components/navigation/annotation/AnnotationCreateModal.vue +104 -0
  157. package/src/components/navigation/annotation/AnnotationCreateSnackbar.vue +20 -0
  158. package/src/components/navigation/annotation/AnnotationDataTable.vue +157 -0
  159. package/src/components/navigation/annotation/AnnotationDeleteModal.vue +48 -0
  160. package/src/components/navigation/annotation/AnnotationDeleteSnackbar.vue +25 -0
  161. package/src/components/navigation/annotation/AnnotationForm.vue +253 -0
  162. package/src/components/navigation/annotation/AnnotationIcon.vue +45 -0
  163. package/src/components/navigation/annotation/AnnotationInfo.vue +141 -0
  164. package/src/components/navigation/annotation/AnnotationMenu.vue +99 -0
  165. package/src/components/navigation/annotation/AnnotationPanel.vue +30 -0
  166. package/src/components/navigation/annotation/AnnotationTools.vue +106 -0
  167. package/src/components/navigation/annotation/AnnotationUpdateModal.vue +92 -0
  168. package/src/components/navigation/annotation/AnnotationVisibilityBtn.vue +52 -0
  169. package/src/components/navigation/annotation/DrawerTitle.vue +25 -0
  170. package/src/components/navigation/annotation/__tests__/AnnotationCreateModal.spec.ts +175 -0
  171. package/src/components/navigation/annotation/__tests__/AnnotationCreateSnackbar.spec.ts +31 -0
  172. package/src/components/navigation/annotation/__tests__/AnnotationDataTable.spec.ts +79 -0
  173. package/src/components/navigation/annotation/__tests__/AnnotationDeleteSnackbar.spec.ts +66 -0
  174. package/src/components/navigation/annotation/__tests__/AnnotationForm.spec.ts +248 -0
  175. package/src/components/navigation/annotation/__tests__/AnnotationIcon.spec.ts +13 -0
  176. package/src/components/navigation/annotation/__tests__/AnnotationTools.spec.ts +107 -0
  177. package/src/components/navigation/display/DisplayPanel.vue +156 -0
  178. package/src/components/{views/__tests__/DisplaySettings.spec.ts → navigation/display/__tests__/DisplayPanel.spec.ts} +14 -3
  179. package/src/components/navigation/history/HistoryModal.vue +140 -0
  180. package/src/components/navigation/mcad/McadAddObjectBtn.vue +41 -0
  181. package/src/components/navigation/mcad/McadDataTable.vue +78 -0
  182. package/src/components/navigation/mcad/McadDataTableItems.vue +382 -0
  183. package/src/components/navigation/mcad/McadDeleteModal.vue +44 -0
  184. package/src/components/navigation/mcad/McadDropZone.vue +148 -0
  185. package/src/components/navigation/mcad/McadFloating.vue +193 -0
  186. package/src/components/navigation/mcad/McadIcon.vue +34 -0
  187. package/src/components/navigation/mcad/McadInvert.vue +91 -0
  188. package/src/components/navigation/mcad/McadLockBtn.vue +62 -0
  189. package/src/components/navigation/mcad/McadMenu.vue +249 -0
  190. package/src/components/navigation/mcad/McadOpacity.vue +79 -0
  191. package/src/components/navigation/mcad/McadPanel.vue +31 -0
  192. package/src/components/navigation/mcad/McadToggleSortBtn.vue +18 -0
  193. package/src/components/navigation/mcad/McadToggleVisibilityBtn.vue +46 -0
  194. package/src/components/navigation/mcad/McadUpdateModal.vue +108 -0
  195. package/src/components/navigation/mcad/McadVisibilityBtn.vue +46 -0
  196. package/src/components/navigation/mcad/__tests__/McadAddObjectBtn.spec.ts +73 -0
  197. package/src/components/navigation/mcad/__tests__/McadDataTable.spec.ts +27 -0
  198. package/src/components/navigation/mcad/__tests__/McadDataTableItems.spec.ts +621 -0
  199. package/src/components/navigation/mcad/__tests__/McadDeleteModal.spec.ts +67 -0
  200. package/src/components/navigation/mcad/__tests__/McadDropZone.spec.ts +109 -0
  201. package/src/components/navigation/mcad/__tests__/McadIcon.spec.ts +13 -0
  202. package/src/components/navigation/mcad/__tests__/McadInvert.spec.ts +45 -0
  203. package/src/components/navigation/mcad/__tests__/McadLockBtn.spec.ts +38 -0
  204. package/src/components/navigation/mcad/__tests__/McadMenu.spec.ts +258 -0
  205. package/src/components/navigation/mcad/__tests__/McadOpacity.spec.ts +68 -0
  206. package/src/components/navigation/mcad/__tests__/McadToggleSortBtn.spec.ts +36 -0
  207. package/src/components/navigation/mcad/__tests__/McadToggleVisibilityBtn.spec.ts +53 -0
  208. package/src/components/navigation/mcad/__tests__/McadUpdateModal.spec.ts +122 -0
  209. package/src/components/navigation/mcad/__tests__/McadVisibilityBtn.spec.ts +45 -0
  210. package/src/components/navigation/measurement/MeasurementAngleSnackbar.vue +18 -0
  211. package/src/components/navigation/measurement/MeasurementDataTable.vue +162 -0
  212. package/src/components/navigation/measurement/MeasurementDeleteModal.vue +49 -0
  213. package/src/components/navigation/measurement/MeasurementDeleteSnackbar.vue +40 -0
  214. package/src/components/navigation/measurement/MeasurementIcon.vue +41 -0
  215. package/src/components/navigation/measurement/MeasurementInfo.vue +25 -0
  216. package/src/components/navigation/measurement/MeasurementInfoAngle.vue +36 -0
  217. package/src/components/navigation/measurement/MeasurementInfoLength.vue +37 -0
  218. package/src/components/navigation/measurement/MeasurementInfoPolygon.vue +58 -0
  219. package/src/components/navigation/measurement/MeasurementLengthSnackbar.vue +18 -0
  220. package/src/components/navigation/measurement/MeasurementMenu.vue +97 -0
  221. package/src/components/navigation/measurement/MeasurementPanel.vue +30 -0
  222. package/src/components/navigation/measurement/MeasurementPolygonSnackbar.vue +18 -0
  223. package/src/components/navigation/measurement/MeasurementTools.vue +101 -0
  224. package/src/components/navigation/measurement/MeasurementVisibilityBtn.vue +53 -0
  225. package/src/components/navigation/measurement/__tests__/MeasurementAngleSnackbar.spec.ts +34 -0
  226. package/src/components/navigation/measurement/__tests__/MeasurementDataTable.spec.ts +79 -0
  227. package/src/components/navigation/measurement/__tests__/MeasurementDeleteSnackbar.spec.ts +51 -0
  228. package/src/components/navigation/measurement/__tests__/MeasurementInfo.spec.ts +77 -0
  229. package/src/components/navigation/measurement/__tests__/MeasurementLengthSnackbar.spec.ts +35 -0
  230. package/src/components/navigation/measurement/__tests__/MeasurementPolygonSnackbar.spec.ts +35 -0
  231. package/src/components/navigation/measurement/__tests__/MeasurementTools.spec.ts +87 -0
  232. package/src/components/shared/ColourPalette.vue +71 -0
  233. package/src/components/shared/DoubleSliderSelector.vue +66 -28
  234. package/src/components/shared/HorizontalSliderSelector.vue +80 -0
  235. package/src/components/shared/KeyboardShortcuts.vue +184 -0
  236. package/src/components/shared/LoadingSpinner.vue +508 -144
  237. package/src/components/shared/MultiLoginError.vue +98 -0
  238. package/src/components/shared/NotificationToaster.vue +112 -0
  239. package/src/components/shared/UpdateSnackbar.vue +22 -9
  240. package/src/components/shared/ValueSelector.vue +10 -10
  241. package/src/components/shared/VerticalSliderSelector.vue +45 -44
  242. package/src/components/shared/__tests__/ColourPalette.spec.ts +21 -0
  243. package/src/components/shared/__tests__/DoubleSliderSelector.spec.ts +58 -46
  244. package/src/components/shared/__tests__/HorizontalSliderSelector.spec.ts +35 -0
  245. package/src/components/shared/__tests__/KeyboardShortcuts.spec.ts +50 -0
  246. package/src/components/shared/__tests__/MultiLoginError.spec.ts +50 -0
  247. package/src/components/shared/__tests__/NotificationToaster.spec.ts +65 -0
  248. package/src/components/shared/__tests__/UpdateSnackbar.spec.ts +7 -7
  249. package/src/components/shared/__tests__/ValueSelector.spec.ts +6 -0
  250. package/src/composables/__tests__/useDebounce.spec.ts +17 -0
  251. package/src/composables/__tests__/useMovingAverage.spec.ts +40 -0
  252. package/src/composables/__tests__/useNavigationCube.spec.ts +79 -0
  253. package/src/{functions/__tests__/notification.spec.ts → composables/__tests__/useNotificationHandler.spec.ts} +74 -17
  254. package/src/composables/__tests__/useToolGroup.spec.ts +41 -0
  255. package/src/composables/__tests__/useViewName.spec.ts +29 -0
  256. package/src/composables/useBoundingBox.ts +32 -0
  257. package/src/composables/useEventListener.ts +7 -9
  258. package/src/composables/useMedia.ts +27 -0
  259. package/src/composables/useNavigationCube.ts +80 -0
  260. package/src/composables/useNotificationHandler.ts +82 -0
  261. package/src/composables/useResizeObserver.ts +31 -0
  262. package/src/composables/useToolGroup.ts +36 -0
  263. package/src/composables/useViewName.ts +34 -0
  264. package/src/composables/useViewer3cr.ts +3 -2
  265. package/src/config.ts +1 -1
  266. package/src/constants.ts +8 -0
  267. package/src/functions/HotkeyScope.ts +87 -0
  268. package/src/functions/__tests__/HotkeyScope.spec.ts +49 -0
  269. package/src/functions/__tests__/colours.spec.ts +42 -0
  270. package/src/functions/__tests__/fileReader.spec.ts +130 -0
  271. package/src/functions/__tests__/modelHelper.spec.ts +1 -0
  272. package/src/functions/__tests__/tsHelper.spec.ts +7 -0
  273. package/src/functions/chunker.ts +21 -0
  274. package/src/functions/colours.ts +45 -0
  275. package/src/functions/fileReader.ts +48 -0
  276. package/src/functions/guards/__tests__/isDataOverlayAngle.spec.ts +21 -0
  277. package/src/functions/guards/__tests__/isDataOverlayLength.spec.ts +21 -0
  278. package/src/functions/guards/__tests__/isDataOverlayPolygon.spec.ts +21 -0
  279. package/src/functions/guards/isDataOverlayAngle.ts +3 -4
  280. package/src/functions/guards/isDataOverlayLength.ts +3 -4
  281. package/src/functions/guards/isDataOverlayPolygon.ts +3 -4
  282. package/src/functions/openUrl.ts +3 -0
  283. package/src/functions/{__tests__ → parsers/__tests__}/parseAction.spec.ts +1 -1
  284. package/src/functions/{__tests__ → parsers/__tests__}/parseCallToAction.spec.ts +1 -1
  285. package/src/functions/{__tests__ → parsers/__tests__}/parseDataOverlay.spec.ts +1 -1
  286. package/src/functions/{__tests__ → parsers/__tests__}/parseDataOverlayData.spec.ts +1 -1
  287. package/src/functions/{__tests__ → parsers/__tests__}/parseDataOverlayEvent.spec.ts +3 -3
  288. package/src/functions/{__tests__ → parsers/__tests__}/parseMcadEvent.spec.ts +3 -3
  289. package/src/functions/{parseAction.ts → parsers/parseAction.ts} +1 -2
  290. package/src/functions/{parseCallToAction.ts → parsers/parseCallToAction.ts} +2 -2
  291. package/src/functions/{parseDataOverlay.ts → parsers/parseDataOverlay.ts} +3 -3
  292. package/src/functions/parsers/parseDataOverlayData.ts +9 -0
  293. package/src/functions/parsers/parseDataOverlayEvent.ts +19 -0
  294. package/src/functions/parsers/parseMcadEvent.ts +9 -0
  295. package/src/functions/platform.ts +7 -0
  296. package/src/functions/translateTooltipShortcut.ts +35 -0
  297. package/src/functions/tsHelper.ts +3 -0
  298. package/src/main.ts +70 -48
  299. package/src/models/__tests__/iso-languages.spec.ts +23 -0
  300. package/src/models/__tests__/scanState.spec.ts +14 -38
  301. package/src/models/iso-languages.ts +1609 -0
  302. package/src/models/progress.ts +23 -0
  303. package/src/models/scanState.ts +56 -100
  304. package/src/plugins/__tests__/pinia.spec.ts +7 -0
  305. package/src/plugins/__tests__/vue-i18n.spec.ts +7 -0
  306. package/src/plugins/__tests__/vuetify.spec.ts +3 -3
  307. package/src/plugins/locales/en.json +442 -0
  308. package/src/plugins/material-symbols/aliases.ts +43 -0
  309. package/src/plugins/material-symbols/material-symbols-filled.ts +11 -0
  310. package/src/plugins/material-symbols/material-symbols-outlined.ts +9 -0
  311. package/src/plugins/pinia.ts +3 -0
  312. package/src/plugins/vue-i18n.ts +9 -0
  313. package/src/plugins/vuetify.ts +157 -25
  314. package/src/services/__tests__/features.service.spec.ts +14 -0
  315. package/src/services/__tests__/gpt.service.spec.ts +64 -3
  316. package/src/services/__tests__/viewer-3cr.service.spec.ts +616 -192
  317. package/src/services/features.service.ts +32 -0
  318. package/src/services/gpt.service.ts +5 -2
  319. package/src/services/viewer-3cr.service.ts +374 -307
  320. package/src/stores/__tests__/data-overlay.store.spec.ts +92 -0
  321. package/src/stores/__tests__/demo.store.spec.ts +196 -0
  322. package/src/stores/__tests__/drawer.store.spec.ts +27 -0
  323. package/src/stores/__tests__/intro.store.spec.ts +102 -0
  324. package/src/stores/__tests__/language.store.spec.ts +83 -0
  325. package/src/stores/__tests__/mcad-floating.store.spec.ts +339 -0
  326. package/src/stores/__tests__/mcad.store.spec.ts +88 -0
  327. package/src/stores/__tests__/save.store.spec.ts +51 -0
  328. package/src/stores/__tests__/theme.store.spec.ts +18 -0
  329. package/src/stores/__tests__/tool.store.spec.ts +53 -0
  330. package/src/stores/__tests__/upload.store.spec.ts +19 -0
  331. package/src/stores/__tests__/viewer.store.spec.ts +18 -0
  332. package/src/stores/data-overlay.store.ts +93 -0
  333. package/src/stores/demo.store.ts +284 -0
  334. package/src/stores/drawer.store.ts +23 -0
  335. package/src/stores/intro.store.ts +35 -0
  336. package/src/stores/language.store.ts +59 -0
  337. package/src/stores/mcad-floating.store.ts +141 -0
  338. package/src/stores/mcad.store.ts +53 -0
  339. package/src/stores/save.store.ts +59 -0
  340. package/src/stores/theme.store.ts +45 -0
  341. package/src/stores/tool.store.ts +41 -0
  342. package/src/stores/upload.store.ts +19 -0
  343. package/src/stores/viewer.store.ts +30 -0
  344. package/src/tools/__tests__/annotation-create.tool.spec.ts +87 -0
  345. package/src/tools/__tests__/annotation-move.tool.spec.ts +107 -0
  346. package/src/tools/__tests__/data-overlay.tool.spec.ts +127 -0
  347. package/src/tools/__tests__/mcad-move.tool.spec.ts +106 -0
  348. package/src/tools/__tests__/mcad-rotate.tool.spec.ts +103 -0
  349. package/src/tools/__tests__/mcad-scale.tool.spec.ts +8 -0
  350. package/src/tools/__tests__/mcad-select.tool.spec.ts +63 -0
  351. package/src/tools/__tests__/measurement-angle.tool.spec.ts +26 -0
  352. package/src/tools/__tests__/measurement-length.tool.spec.ts +26 -0
  353. package/src/tools/__tests__/measurement-polygon.tool.spec.ts +26 -0
  354. package/src/tools/annotation-create.tool.ts +48 -0
  355. package/src/tools/annotation-move.tool.ts +48 -0
  356. package/src/tools/data-overlay.tool.ts +45 -48
  357. package/src/tools/mcad-move.tool.ts +47 -0
  358. package/src/tools/mcad-rotate.tool.ts +47 -0
  359. package/src/tools/mcad-scale-tool.ts +10 -0
  360. package/src/tools/mcad-select-tool.ts +32 -0
  361. package/src/tools/measurement-angle.tool.ts +20 -0
  362. package/src/tools/measurement-length.tool.ts +20 -0
  363. package/src/tools/measurement-polygon.tool.ts +20 -0
  364. package/src/types/feature.ts +6 -0
  365. package/src/types/viewer-tool.ts +5 -0
  366. package/test/MockImportOriginal.ts +7 -0
  367. package/test/assertions/beTypeOrNull.ts +24 -0
  368. package/test/fakers/action-data.faker.ts +1 -1
  369. package/test/fakers/action.faker.ts +1 -1
  370. package/test/fakers/call-to-action.faker.ts +1 -1
  371. package/test/fakers/data-overlay-angle.faker.ts +1 -1
  372. package/test/fakers/data-overlay-annotation.faker.ts +1 -1
  373. package/test/fakers/data-overlay-data.faker.ts +18 -15
  374. package/test/fakers/data-overlay-interaction.faker.ts +25 -17
  375. package/test/fakers/data-overlay-length.faker.ts +1 -1
  376. package/test/fakers/data-overlay-mcad.faker.ts +4 -3
  377. package/test/fakers/data-overlay-polygon.faker.ts +1 -1
  378. package/test/fakers/feature.faker.ts +13 -0
  379. package/test/fakers/file.faker.ts +11 -0
  380. package/test/fakers/gpt-question.faker.ts +1 -1
  381. package/test/fakers/gpt-response.faker.ts +1 -1
  382. package/test/fakers/mcad-object-interaction.faker.ts +4 -4
  383. package/test/fakers/orientation.faker.ts +1 -1
  384. package/test/fakers/segment-angle.faker.ts +1 -1
  385. package/test/fakers/upload.faker.ts +14 -0
  386. package/test/getAnimationFrame.ts +3 -0
  387. package/test/plugins/findByTestId.ts +13 -6
  388. package/test/plugins/pinia.ts +20 -0
  389. package/test/plugins/vitest.d.ts +8 -0
  390. package/test/plugins/vue-i18n.ts +22 -0
  391. package/test/plugins/vuetify.ts +10 -0
  392. package/test/setup.ts +37 -12
  393. package/tsconfig.json +1 -1
  394. package/vite.config.mts +48 -18
  395. package/vitest.config.mts +12 -3
  396. package/src/assets/images/MainBackdrop.svg +0 -48
  397. package/src/assets/images/dark/Singular-Health-Disc-Mono.svg +0 -9
  398. package/src/assets/images/dark/demo-icon-small.png +0 -0
  399. package/src/assets/images/dark/demo-logo-small.svg +0 -27
  400. package/src/assets/images/dark/demo-logo.svg +0 -1
  401. package/src/assets/images/light/Singular-Health-Disc-Mono.svg +0 -9
  402. package/src/assets/logos/3dicom/white-mini.svg +0 -20
  403. package/src/components/demo/DemoModal.vue +0 -44
  404. package/src/components/demo/DemoPatientModal.vue +0 -52
  405. package/src/components/demo/__tests__/DemoModal.spec.ts +0 -26
  406. package/src/components/demo/__tests__/DemoPatientModal.spec.ts +0 -38
  407. package/src/components/demo/__tests__/options.spec.ts +0 -25
  408. package/src/components/demo/licence/DemoLicenceEnableCloudStorageModal.vue +0 -64
  409. package/src/components/demo/licence/DemoLicenceInfoModal.vue +0 -49
  410. package/src/components/demo/licence/DemoLicenceSendToPartyModal.vue +0 -178
  411. package/src/components/demo/licence/DemoLicenceShareToMobileModal.vue +0 -102
  412. package/src/components/demo/licence/__tests__/DemoLicenceSendToPartyModal.spec.ts +0 -36
  413. package/src/components/demo/licence/__tests__/DemoLicenceShareToMobileModal.spec.ts +0 -52
  414. package/src/components/demo/options.ts +0 -170
  415. package/src/components/demo/patient/DemoPatientEnableCloudStorageModal.vue +0 -64
  416. package/src/components/demo/patient/DemoPatientInfoModal.vue +0 -49
  417. package/src/components/demo/patient/DemoPatientSendToPartyModal.vue +0 -177
  418. package/src/components/demo/patient/DemoPatientShareToMobileModal.vue +0 -102
  419. package/src/components/demo/patient/__tests__/DemoPatientEnableCloudStorageModal.spec.ts +0 -38
  420. package/src/components/demo/patient/__tests__/DemoPatientInfoModal.spec.ts +0 -38
  421. package/src/components/demo/patient/__tests__/DemoPatientSendToPartyModal.spec.ts +0 -36
  422. package/src/components/demo/patient/__tests__/DemoPatientShareToMobileModal.spec.ts +0 -52
  423. package/src/components/modal/CloseViewerModal.vue +0 -69
  424. package/src/components/modal/MftpWebGL3DRModal.vue +0 -336
  425. package/src/components/modal/ViewerNavigationDrawerContent.vue +0 -168
  426. package/src/components/modal/ViewerNavigationDrawerFooter.vue +0 -131
  427. package/src/components/modal/ViewerNavigationDrawerHeader.vue +0 -33
  428. package/src/components/modal/WebGL3DR.vue +0 -91
  429. package/src/components/modal/__tests__/CloseViewerModal.spec.ts +0 -70
  430. package/src/components/modal/__tests__/ViewerNavigationDrawerContent.spec.ts +0 -11
  431. package/src/components/modal/__tests__/ViewerNavigationDrawerFooter.spec.ts +0 -46
  432. package/src/components/modal/__tests__/ViewerNavigationDrawerHeader.spec.ts +0 -40
  433. package/src/components/modal/actions/NavigationCubeAction.vue +0 -26
  434. package/src/components/modal/actions/__tests__/NavigationCubeAction.spec.ts +0 -25
  435. package/src/components/modal/buttons/AutoAnnotateBtn.vue +0 -197
  436. package/src/components/modal/buttons/__tests__/AutoAnnotateBtn.spec.ts +0 -28
  437. package/src/components/modal/menus/FileMenu.vue +0 -73
  438. package/src/components/modal/menus/__tests__/FileMenu.spec.ts +0 -110
  439. package/src/components/navigation/mcad/McadGlobalActions.vue +0 -20
  440. package/src/components/navigation/mcad/McadGlobalOpacitySlider.vue +0 -103
  441. package/src/components/navigation/mcad/McadGlobalScanViewBtn.vue +0 -28
  442. package/src/components/navigation/mcad/McadGlobalVisibilityBtn.vue +0 -38
  443. package/src/components/views/AnnotationTreeView.vue +0 -236
  444. package/src/components/views/DisplaySettings.vue +0 -94
  445. package/src/components/views/MarkupTreeView.vue +0 -201
  446. package/src/components/views/McadObjectTreeView.vue +0 -129
  447. package/src/components/views/__tests__/AnnotationTreeView.spec.ts +0 -62
  448. package/src/components/views/__tests__/MarkupTreeView.spec.ts +0 -41
  449. package/src/components/views/__tests__/McadObjectTreeView.spec.ts +0 -47
  450. package/src/components/views/modals/DataOverlayGeneralModal.vue +0 -71
  451. package/src/components/views/modals/DataOverlayMarkupModal.vue +0 -60
  452. package/src/components/views/modals/DataOverlayModal.vue +0 -88
  453. package/src/components/views/shared/MaskIcon.vue +0 -44
  454. package/src/components/views/shared/ObjectColor.vue +0 -31
  455. package/src/components/views/shared/ObjectLabel.vue +0 -30
  456. package/src/components/views/shared/Opacity.vue +0 -65
  457. package/src/components/views/shared/VisibilityBtn.vue +0 -25
  458. package/src/components/views/shared/__tests__/MaskIcon.spec.ts +0 -10
  459. package/src/components/views/shared/__tests__/ObjectColor.spec.ts +0 -10
  460. package/src/components/views/shared/__tests__/ObjectLabel.spec.ts +0 -10
  461. package/src/components/views/shared/__tests__/Opacity.spec.ts +0 -24
  462. package/src/components/views/shared/__tests__/VisibilityBtn.spec.ts +0 -11
  463. package/src/components/views/types/annotation-tree-view-item-child-action.ts +0 -6
  464. package/src/components/views/types/annotation-tree-view-item-child.ts +0 -9
  465. package/src/components/views/types/annotation-tree-view-item.ts +0 -13
  466. package/src/components/views/types/markup-tree-view-item-child.ts +0 -6
  467. package/src/components/views/types/markup-tree-view-item.ts +0 -14
  468. package/src/components/views/types/mcad-object-tree-view-item.ts +0 -13
  469. package/src/composables/__tests__/useAnnotations.spec.ts +0 -35
  470. package/src/composables/__tests__/useIntroJs.spec.ts +0 -51
  471. package/src/composables/__tests__/useMarkups.spec.ts +0 -39
  472. package/src/composables/__tests__/useMcadObjects.spec.ts +0 -36
  473. package/src/composables/__tests__/useNavigationCubeObserver.spec.ts +0 -61
  474. package/src/composables/useAnnotations.ts +0 -37
  475. package/src/composables/useIntroJs.ts +0 -142
  476. package/src/composables/useMarkups.ts +0 -41
  477. package/src/composables/useMcadObjects.ts +0 -32
  478. package/src/composables/useNavigationCubeObserver.ts +0 -114
  479. package/src/composables/useVersion3cr.ts +0 -7
  480. package/src/functions/__tests__/layoutOverlayStyle.spec.ts +0 -325
  481. package/src/functions/asyncTools.ts +0 -3
  482. package/src/functions/layoutOverlayStyle.ts +0 -84
  483. package/src/functions/notification.ts +0 -82
  484. package/src/functions/parseDataOverlayData.ts +0 -10
  485. package/src/functions/parseDataOverlayEvent.ts +0 -17
  486. package/src/functions/parseMcadEvent.ts +0 -10
  487. package/src/functions/rgbaToCss.ts +0 -13
  488. package/src/models/__tests__/loadViewerOptions.spec.ts +0 -72
  489. package/src/models/__tests__/loadViewerPayload.spec.ts +0 -10
  490. package/src/models/callbacks.ts +0 -4
  491. package/src/models/loadViewerOptions.ts +0 -79
  492. package/src/models/loadViewerPayload.ts +0 -17
  493. package/src/plugins/__tests__/usePlugins.spec.ts +0 -12
  494. package/src/plugins/usePlugins.ts +0 -8
  495. package/src/types/action-data.ts +0 -4
  496. package/src/types/action.ts +0 -13
  497. package/src/types/call-to-action.ts +0 -9
  498. package/src/types/colour.ts +0 -6
  499. package/src/types/data-overlay-angle.ts +0 -16
  500. package/src/types/data-overlay-annotation.ts +0 -18
  501. package/src/types/data-overlay-data.ts +0 -15
  502. package/src/types/data-overlay-event.ts +0 -5
  503. package/src/types/data-overlay-info.ts +0 -18
  504. package/src/types/data-overlay-interaction.ts +0 -15
  505. package/src/types/data-overlay-length.ts +0 -16
  506. package/src/types/data-overlay-markup.ts +0 -7
  507. package/src/types/data-overlay-mcad.ts +0 -20
  508. package/src/types/data-overlay-polygon.ts +0 -18
  509. package/src/types/data-overlay.ts +0 -16
  510. package/src/types/demo-type.ts +0 -4
  511. package/src/types/gpt-question.ts +0 -4
  512. package/src/types/gpt-response-payload.ts +0 -6
  513. package/src/types/mcad-object-interaction.ts +0 -15
  514. package/src/types/segment-angle.ts +0 -5
  515. package/src/types/vector2.ts +0 -4
  516. package/src/types/vector3.ts +0 -5
  517. package/test/fakers/data-overlay-info.faker.ts +0 -29
  518. /package/src/assets/logos/3dicom/{white.svg → white/white.svg} +0 -0
  519. /package/src/assets/{images/light/Singular-Health-Trademark-mono.svg → logos/singular-health/black/black.svg} +0 -0
  520. /package/src/assets/{images/dark/Singular-Health-Trademark-mono.svg → logos/singular-health/white/white.svg} +0 -0
@@ -1,110 +0,0 @@
1
- import { mount } from '@vue/test-utils';
2
- import { useViewerOptions } from '@/composables/useViewerOptions';
3
- import { VBtn, VListItem } from 'vuetify/components';
4
- import FileMenu from '@/components/modal/menus/FileMenu.vue';
5
-
6
- describe('FileMenu tests', () => {
7
- const options = useViewerOptions();
8
-
9
- it('should mount', () => {
10
- const wrapper = mount(FileMenu);
11
- expect(wrapper).toBeTruthy();
12
- });
13
-
14
- it('should call OnLoadNewDicomSeries', async () => {
15
- options.value.OnLoadNewDicomSeries = vi.fn();
16
- const wrapper = mount(FileMenu);
17
- await wrapper.findComponentByTestId<VBtn>('menu').trigger('click');
18
- await wrapper.findComponentByTestId<VListItem>('load-new-dicom-series').trigger('click');
19
- expect(options.value.OnLoadNewDicomSeries).toHaveBeenCalled();
20
- });
21
-
22
- it('should not call OnLoadNewDicomSeries', async () => {
23
- options.value.OnLoadNewDicomSeries = undefined;
24
- const wrapper = mount(FileMenu);
25
- await wrapper.findComponentByTestId<VBtn>('menu').trigger('click');
26
- const item = wrapper.findComponentByTestId<VListItem>('load-new-dicom-series');
27
- expect(item.exists()).toBeFalsy();
28
- });
29
-
30
- it('should call OnDownloadDicomSeries', async () => {
31
- options.value.OnDownloadDicomSeries = vi.fn();
32
- const wrapper = mount(FileMenu);
33
- await wrapper.findComponentByTestId<VBtn>('menu').trigger('click');
34
- await wrapper.findComponentByTestId<VListItem>('download-dicom-series').trigger('click');
35
- expect(options.value.OnDownloadDicomSeries).toHaveBeenCalled();
36
- });
37
-
38
- it('should not call OnDownloadDicomSeries', async () => {
39
- options.value.OnDownloadDicomSeries = undefined;
40
- const wrapper = mount(FileMenu);
41
- await wrapper.findComponentByTestId<VBtn>('menu').trigger('click');
42
- const item = wrapper.findComponentByTestId<VListItem>('download-dicom-series');
43
- expect(item.exists()).toBeFalsy();
44
- });
45
-
46
- it('should call OnLoadSavedSession', async () => {
47
- options.value.OnLoadSavedSession = vi.fn();
48
- const wrapper = mount(FileMenu);
49
- await wrapper.findComponentByTestId<VBtn>('menu').trigger('click');
50
- await wrapper.findComponentByTestId<VListItem>('load-saved-session').trigger('click');
51
- expect(options.value.OnLoadSavedSession).toHaveBeenCalled();
52
- });
53
-
54
- it('should not call OnLoadSavedSession', async () => {
55
- options.value.OnLoadSavedSession = undefined;
56
- const wrapper = mount(FileMenu);
57
- await wrapper.findComponentByTestId<VBtn>('menu').trigger('click');
58
- const item = wrapper.findComponentByTestId<VListItem>('load-saved-session');
59
- expect(item.exists()).toBeFalsy();
60
- });
61
-
62
- it('should call OnSendTo3rdParty', async () => {
63
- options.value.OnSendTo3rdParty = vi.fn();
64
- const wrapper = mount(FileMenu);
65
- await wrapper.findComponentByTestId<VBtn>('menu').trigger('click');
66
- await wrapper.findComponentByTestId<VListItem>('send-to-3rd-party').trigger('click');
67
- expect(options.value.OnSendTo3rdParty).toHaveBeenCalled();
68
- });
69
-
70
- it('should not call OnSendTo3rdParty', async () => {
71
- options.value.OnSendTo3rdParty = undefined;
72
- const wrapper = mount(FileMenu);
73
- await wrapper.findComponentByTestId<VBtn>('menu').trigger('click');
74
- const item = wrapper.findComponentByTestId<VListItem>('send-to-3rd-party');
75
- expect(item.exists()).toBeFalsy();
76
- });
77
-
78
- it('should call OnShareToMobile', async () => {
79
- options.value.OnShareToMobile = vi.fn();
80
- const wrapper = mount(FileMenu);
81
- await wrapper.findComponentByTestId<VBtn>('menu').trigger('click');
82
- await wrapper.findComponentByTestId<VListItem>('share-to-mobile').trigger('click');
83
- expect(options.value.OnShareToMobile).toHaveBeenCalled();
84
- });
85
-
86
- it('should not call OnShareToMobile', async () => {
87
- options.value.OnShareToMobile = undefined;
88
- const wrapper = mount(FileMenu);
89
- await wrapper.findComponentByTestId<VBtn>('menu').trigger('click');
90
- const item = wrapper.findComponentByTestId<VListItem>('share-to-mobile');
91
- expect(item.exists()).toBeFalsy();
92
- });
93
-
94
- it('should call OnClosePopup', async () => {
95
- options.value.OnClosePopup = vi.fn();
96
- const wrapper = mount(FileMenu);
97
- await wrapper.findComponentByTestId<VBtn>('menu').trigger('click');
98
- await wrapper.findComponentByTestId<VListItem>('close').trigger('click');
99
- expect(options.value.OnClosePopup).toHaveBeenCalled();
100
- expect(wrapper.emitted('close')).toEqual([[]]);
101
- });
102
-
103
- it('should not call OnClosePopup', async () => {
104
- options.value.OnClosePopup = undefined;
105
- const wrapper = mount(FileMenu);
106
- await wrapper.findComponentByTestId<VBtn>('menu').trigger('click');
107
- await wrapper.findComponentByTestId<VListItem>('close').trigger('click');
108
- expect(wrapper.emitted('close')).toEqual([[]]);
109
- });
110
- });
@@ -1,20 +0,0 @@
1
- <template>
2
- <v-card flat density="compact" color="transparent">
3
- <v-card-title class="text-overline">Global Actions</v-card-title>
4
- <v-card-text class="d-flex flex-column ga-1">
5
- <mcad-global-scan-view-btn />
6
- <!-- <mcad-global-visibility-btn :mcads="items" />-->
7
- <!-- <mcad-global-opacity-slider :mcads="items" />-->
8
- </v-card-text>
9
- </v-card>
10
- </template>
11
-
12
- <script setup lang="ts">
13
- import { DataOverlayMcad } from '@/types/data-overlay-mcad';
14
-
15
- interface Props {
16
- items: DataOverlayMcad[];
17
- }
18
-
19
- defineProps<Props>();
20
- </script>
@@ -1,103 +0,0 @@
1
- <template>
2
- <v-row class="flex-column" no-gutters>
3
- <v-row no-gutters>
4
- <v-col>
5
- <span class="text-caption">Global Opacity</span>
6
- </v-col>
7
- </v-row>
8
- <v-row no-gutters>
9
- <v-col class="my-auto" cols="9">
10
- <v-slider
11
- v-model="opacity"
12
- class="pr-4"
13
- hide-details
14
- min="0"
15
- max="100"
16
- thumb-color="primary"
17
- thumb-size="16"
18
- step="1"
19
- />
20
- </v-col>
21
- <v-col class="my-auto" cols="3">
22
- <v-text-field
23
- v-model="opacity"
24
- density="compact"
25
- hide-details
26
- variant="outlined"
27
- type="number"
28
- min="0"
29
- max="100"
30
- >
31
- <template #append-inner>
32
- <v-icon icon="percent" size="16" />
33
- </template>
34
- </v-text-field>
35
- </v-col>
36
- </v-row>
37
- </v-row>
38
- </template>
39
-
40
- <script setup lang="ts">
41
- import { DataOverlayMcad } from '@/types/data-overlay-mcad';
42
- import { useViewer3cr } from '@/composables/useViewer3cr';
43
- import { computed, ref } from 'vue';
44
- import { ObjectColour } from '@3cr/types-ts';
45
- import { clamp } from '@/functions/clamp';
46
- import { useDebounce } from '@/composables/useDebounce';
47
-
48
- interface Props {
49
- mcads: DataOverlayMcad[];
50
- }
51
-
52
- const props = defineProps<Props>();
53
-
54
- const viewer3cr = useViewer3cr();
55
- const setOpacityDebounce = useDebounce(setOpacity, 500);
56
-
57
- const _opacity = ref<number>(100);
58
-
59
- const opacity = computed({
60
- get(): number {
61
- return _opacity.value;
62
- },
63
- set(value: number): void {
64
- const next = clamp(value, 0, 100);
65
- _opacity.value = next;
66
- setOpacityDebounce(next);
67
- }
68
- });
69
-
70
- async function setOpacity(value: number): Promise<void> {
71
- const alpha = clamp(value, 0, 100) / 100;
72
- for (const mcad of props.mcads) {
73
- const message: ObjectColour = {
74
- Version: '0.0.0',
75
- Id: mcad.Id,
76
- Colour: {
77
- Version: '0.0.0',
78
- R: mcad.Colour.R,
79
- G: mcad.Colour.G,
80
- B: mcad.Colour.B,
81
- A: alpha
82
- }
83
- };
84
- await viewer3cr.setMcadObjectColour(message);
85
- }
86
- }
87
- </script>
88
-
89
- <style scoped lang="scss">
90
- :deep(.v-field) {
91
- padding-right: 1px !important;
92
- }
93
-
94
- :deep(input) {
95
- font-size: 11px;
96
- padding: 4px 0 4px 4px;
97
- min-height: 0;
98
- }
99
-
100
- :deep(.v-field__append-inner) {
101
- padding-top: 4px;
102
- }
103
- </style>
@@ -1,28 +0,0 @@
1
- <template>
2
- <v-btn variant="text" size="small" @click="toggle">
3
- <v-icon start :icon="icon" size="20" />
4
- <span>{{ visibility ? 'Hide' : 'Show' }} 3D Volume</span>
5
- </v-btn>
6
- </template>
7
-
8
- <script setup lang="ts">
9
- import { computed } from 'vue';
10
- import { useViewer3cr } from '@/composables/useViewer3cr';
11
- import { ScanView, ViewToggleData } from '@3cr/types-ts';
12
- import { scanState } from '@/models/scanState';
13
-
14
- const viewer3cr = useViewer3cr();
15
-
16
- const visibility = computed(() => {
17
- return scanState.value.Orientations.Volume.Visibility;
18
- });
19
-
20
- const icon = computed(() => {
21
- return visibility.value ? 'visibility' : 'visibility_off';
22
- });
23
-
24
- async function toggle(): Promise<void> {
25
- const message: ViewToggleData = { Version: '0.0.0', View: ScanView.Volume, Visibility: !visibility.value };
26
- await viewer3cr.viewSelectionToggleView(message);
27
- }
28
- </script>
@@ -1,38 +0,0 @@
1
- <template>
2
- <v-btn variant="text" size="small" @click="toggle">
3
- <v-icon start :icon="icon" size="20" />
4
- <span>{{ visibility ? 'Hide' : 'Show' }} all MCADs</span>
5
- </v-btn>
6
- </template>
7
-
8
- <script setup lang="ts">
9
- import { computed } from 'vue';
10
- import { DataOverlayMcad } from '@/types/data-overlay-mcad';
11
- import { ObjectVisibility } from '@3cr/types-ts';
12
- import { useViewer3cr } from '@/composables/useViewer3cr';
13
-
14
- interface Props {
15
- mcads: DataOverlayMcad[];
16
- }
17
-
18
- const props = defineProps<Props>();
19
-
20
- const viewer3cr = useViewer3cr();
21
-
22
- const visibility = computed(() => {
23
- return props.mcads.some((mcad) => mcad.Visibility);
24
- });
25
-
26
- const icon = computed(() => {
27
- return visibility.value ? 'visibility' : 'visibility_off';
28
- });
29
-
30
- async function toggle(): Promise<void> {
31
- for (const mcad of props.mcads) {
32
- const message: ObjectVisibility = { Version: '0.0.0', Id: mcad.Id, Visibility: !visibility.value };
33
- await viewer3cr.setMcadObjectVisibility(message);
34
- }
35
- }
36
-
37
- defineOptions({ inheritAttrs: false });
38
- </script>
@@ -1,236 +0,0 @@
1
- <template>
2
- <v-treeview
3
- class="py-0 annotation-treeview"
4
- :items="data"
5
- item-value="id"
6
- density="compact"
7
- open-strategy="single"
8
- @click:open="focusSlices"
9
- >
10
- <template #prepend="{ item }">
11
- <visibility-btn :is-visible="item.isVisible" @click.stop="toggleVisibility(item)" />
12
- </template>
13
- <template #title="{ item }">
14
- <object-label :label="item.title">
15
- <template #prepend>
16
- <mask-icon class="mr-2" :data="item.icon!" :color="getColor(item)" />
17
- </template>
18
- </object-label>
19
- </template>
20
- <template #item="{ props }">
21
- <v-row no-gutters class="px-6 py-2">
22
- <v-col cols="4">
23
- <b>{{ props.key }}</b>
24
- </v-col>
25
- <v-col>
26
- <span v-html="props.value"></span>
27
- <template v-for="action in props.actions">
28
- <v-chip
29
- v-if="action.isBtn"
30
- size="small"
31
- label
32
- variant="tonal"
33
- class="action text-wrap mb-2"
34
- @click="selectAction(action)"
35
- >
36
- {{ action.description }}
37
- </v-chip>
38
- <a v-else :href="action.url">{{ action.description }}</a>
39
- <br />
40
- </template>
41
- </v-col>
42
- </v-row>
43
- </template>
44
- </v-treeview>
45
- <AskAI
46
- v-model:modal="m_askAi"
47
- :title="title"
48
- :question-key="questionKey"
49
- :question-text="questionText"
50
- @askFollowup="askFollowUpQuestion"
51
- >
52
- </AskAI>
53
- <div class="px-4 py-2 text-caption" style="font-size: 9px !important; line-height: 12px !important">
54
- * 3Dicom's Annotiva AI is powered by AI Large Language Models (LLMs) which generate general health information for
55
- improved patient comprehension.
56
- <br /><br />It is NOT for diagnostic usage.
57
- </div>
58
- </template>
59
-
60
- <script setup lang="ts">
61
- import { nextTick, ref, watch } from 'vue';
62
- import { SlidersActions } from '@3cr/types-ts';
63
- import { initialScanState } from '@/models/scanState';
64
- import { GptService } from '@/services/gpt.service';
65
- import { useViewer3cr } from '@/composables/useViewer3cr';
66
- import { rgbaNormalizedToCss } from '@/functions/rgbaToCss';
67
- import { AnnotationTreeViewItem } from '@/components/views/types/annotation-tree-view-item';
68
- import { AnnotationTreeViewItemChildAction } from '@/components/views/types/annotation-tree-view-item-child-action';
69
- import { AnnotationTreeViewItemChild } from '@/components/views/types/annotation-tree-view-item-child';
70
- import { DataOverlayAnnotation } from '@/types/data-overlay-annotation';
71
- import { DataOverlayData } from '@/types/data-overlay-data';
72
- import { GptResponsePayload } from '@/types/gpt-response-payload';
73
- import { GptQuestion } from '@/types/gpt-question';
74
-
75
- interface Props {
76
- items: DataOverlayData<DataOverlayAnnotation>[];
77
- }
78
-
79
- const props = withDefaults(defineProps<Props>(), {
80
- items: () => []
81
- });
82
-
83
- const viewer3cr = useViewer3cr();
84
- const data = ref<AnnotationTreeViewItem[]>([]);
85
- const aiData = ref<Record<string, GptResponsePayload>>({});
86
- const m_askAi = ref<boolean>(false);
87
- const questionKey = ref<number>(0);
88
- const questionText = ref<string>('');
89
- const title = ref<string>('');
90
-
91
- function setTreeViewData(annotations: DataOverlayData<DataOverlayAnnotation>[]): void {
92
- data.value = annotations
93
- .sort((a, b) => a.Data.Title.localeCompare(b.Data.Title))
94
- .map((annotation) => mapToTreeViewItem(annotation));
95
- }
96
-
97
- watch(
98
- () => props.items,
99
- async (items) => {
100
- await generateAiData(items);
101
- setTreeViewData(items);
102
- },
103
- { immediate: true }
104
- );
105
-
106
- async function selectAction(action: AnnotationTreeViewItemChildAction): Promise<void> {
107
- questionKey.value = Number(action.url);
108
- questionText.value = action.description;
109
- title.value = action.title;
110
- m_askAi.value = true;
111
- }
112
-
113
- async function askFollowUpQuestion(question: GptQuestion): Promise<void> {
114
- m_askAi.value = false;
115
- await nextTick();
116
- questionKey.value = question.ApiPreFilledRequestKey;
117
- questionText.value = question.Question;
118
- m_askAi.value = true;
119
- }
120
-
121
- async function toggleVisibility(annotation: AnnotationTreeViewItem): Promise<void> {
122
- const value = { Id: annotation.id, Visibility: !annotation.isVisible };
123
- await viewer3cr.toggle2dAnnotation(value);
124
- await viewer3cr.toggle3dAnnotation(value);
125
- }
126
-
127
- function getColor(annotation: AnnotationTreeViewItem): string {
128
- const { r, g, b, a } = annotation.colour;
129
- return rgbaNormalizedToCss(r + 0.2, g + 0.2, b + 0.2, a - 0.2);
130
- }
131
-
132
- function mapToTreeViewItem(data: DataOverlayData<DataOverlayAnnotation>): AnnotationTreeViewItem {
133
- return {
134
- id: data.Data.Id,
135
- title: data.Data.Title,
136
- icon: data.Data.Icon2d,
137
- isVisible: !!data.Data.Visibility2d && !!data.Data.Visibility3d,
138
- colour: {
139
- r: data.Data.Colour2d.R,
140
- g: data.Data.Colour2d.G,
141
- b: data.Data.Colour2d.B,
142
- a: data.Data.Colour2d.A
143
- },
144
- position: {
145
- x: data.Data.Position.X,
146
- y: data.Data.Position.Y,
147
- z: data.Data.Position.Z
148
- },
149
- children: mapToTreeViewItemChild(data)
150
- };
151
- }
152
-
153
- function mapToTreeViewItemChild(data: DataOverlayData<DataOverlayAnnotation>): AnnotationTreeViewItemChild[] {
154
- return [
155
- {
156
- props: {
157
- key: data.Data.Description ? 'Description' : 'Smart Description',
158
- value: data.Data.Description || aiData.value[data.Data.Title]?.GptResponse || '',
159
- actions: []
160
- }
161
- },
162
- {
163
- props: {
164
- key: 'Resources',
165
- value: '',
166
- actions:
167
- data.Data.CallToAction?.Actions.map((action) => ({
168
- title: '',
169
- description: action.ActionData.Description,
170
- url: action.ActionData.Url,
171
- isBtn: false
172
- })) ?? []
173
- }
174
- },
175
- {
176
- props: {
177
- key: 'Annotiva AI',
178
- value: '',
179
- actions:
180
- aiData.value[data.Data.Title]?.FollowupQuestions.map((question) => ({
181
- title: data.Data.Title,
182
- description: question.Question,
183
- url: question.ApiPreFilledRequestKey.toString(),
184
- isBtn: true
185
- })) ?? []
186
- }
187
- }
188
- ];
189
- }
190
-
191
- async function generateAiData(data: DataOverlayData<DataOverlayAnnotation>[]): Promise<void> {
192
- await Promise.all(
193
- data.map(async (d) => {
194
- const key = d.Data.Title;
195
- if (!(key in aiData.value)) {
196
- aiData.value[key] = await GptService.Instantiate()
197
- .GenerateAnnotations(key)
198
- .then((data) => data.data)
199
- .catch(() => ({ GptResponse: 'failed to execute', FollowupQuestions: [] }));
200
- }
201
- })
202
- );
203
- }
204
-
205
- async function focusSlices(value: { id: unknown; value: boolean }): Promise<void> {
206
- const item = data.value.find((annotation) => annotation.id === value.id);
207
- if (value.value && item) {
208
- const sagittal = Math.round(item.position.x / (initialScanState.value.XSpacing || 1));
209
- const transverse = Math.round(item.position.y / (initialScanState.value.YSpacing || 1));
210
- const coronal = Math.round(item.position.z / (initialScanState.value.ZSpacing || 1));
211
-
212
- await viewer3cr.sliderHandler(SlidersActions.sl12, sagittal);
213
- await viewer3cr.sliderHandler(SlidersActions.sl09, coronal);
214
- await viewer3cr.sliderHandler(SlidersActions.sl15, transverse);
215
- }
216
- }
217
- </script>
218
-
219
- <style lang="scss">
220
- .annotation-treeview {
221
- font-size: 12px;
222
-
223
- .v-list-group ~ .v-list-group {
224
- border-top: thin solid rgb(100%, 100%, 100%, var(--v-border-opacity));
225
- }
226
-
227
- .v-chip.action {
228
- text-wrap: wrap;
229
- word-wrap: break-word;
230
- min-height: 42px;
231
- line-height: 14px !important;
232
- height: unset;
233
- padding: 4px 8px;
234
- }
235
- }
236
- </style>
@@ -1,94 +0,0 @@
1
- <template>
2
- <v-row class="flex-column" no-gutters>
3
- <v-row no-gutters>
4
- <v-col>
5
- <DoubleSliderSelector
6
- v-bind="huMinMax"
7
- v-model:model-value="windowSlider"
8
- id="skin-to-bone"
9
- label="Skin to Bone"
10
- />
11
- </v-col>
12
- </v-row>
13
- <v-row no-gutters>
14
- <v-col>
15
- <DoubleSliderSelector v-bind="huMinMax" v-model:model-value="thresholdSlider" label="Fine Adjustment" />
16
- </v-col>
17
- </v-row>
18
- <v-row no-gutters>
19
- <v-col>
20
- <v-select
21
- class="pt-4"
22
- data-testid="greyscale"
23
- :model-value="currentGreyscalePreset"
24
- :items="initialScanState.GreyscalePresets"
25
- label="Greyscale Preset"
26
- item-text="Name"
27
- density="compact"
28
- variant="outlined"
29
- persistent-placeholder
30
- hide-details
31
- return-object
32
- placeholder="None"
33
- @update:model-value="onGreyscalePresetChange"
34
- >
35
- <template #item="{ props, item }">
36
- <v-list-item v-bind="props" :title="item.raw.Name" lines="three">
37
- <template v-slot:subtitle>
38
- Skin Density:
39
- <span class="text-mono">{{ item.raw.Lower }}</span>
40
- <v-spacer />
41
- Bone Density:
42
- <span class="text-mono">{{ item.raw.Upper }}</span>
43
- </template>
44
- </v-list-item>
45
- </template>
46
- <template v-slot:selection="{ item }">
47
- <span>{{ item.raw.Name }}</span>
48
- </template>
49
- </v-select>
50
- </v-col>
51
- </v-row>
52
- <v-row no-gutters>
53
- <v-col>
54
- <v-select
55
- class="pt-4"
56
- data-testid="colour"
57
- :model-value="currentColourPreset"
58
- :items="initialScanState.ColourPresets"
59
- label="Colour Preset"
60
- variant="outlined"
61
- density="compact"
62
- item-title="Name"
63
- hide-details
64
- placeholder="Select a Colour Preset"
65
- return-object
66
- @update:model-value="onColourPresetChange"
67
- ></v-select>
68
- </v-col>
69
- </v-row>
70
- </v-row>
71
- </template>
72
-
73
- <script setup lang="ts">
74
- import {
75
- currentColourPreset,
76
- currentGreyscalePreset,
77
- huMinMax,
78
- initialScanState,
79
- thresholdSlider,
80
- windowSlider
81
- } from '@/models/scanState';
82
- import { ColourPresetData, GreyscalePresetData, PresetsActions } from '@3cr/types-ts';
83
- import { useViewer3cr } from '@/composables/useViewer3cr';
84
-
85
- const viewer3cr = useViewer3cr();
86
-
87
- async function onGreyscalePresetChange(preset: GreyscalePresetData): Promise<void> {
88
- await viewer3cr.setPreset(PresetsActions.pr01, preset);
89
- }
90
-
91
- async function onColourPresetChange(preset: ColourPresetData): Promise<void> {
92
- await viewer3cr.setPreset(PresetsActions.pr02, preset);
93
- }
94
- </script>