@ohif/extension-default 3.14.0-beta.98 → 3.14.0-beta.99

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 (215) hide show
  1. package/dist/ohif-extension-default.umd.js +1 -1
  2. package/package.json +9 -6
  3. package/src/Actions/createReportAsync.tsx +45 -0
  4. package/src/Components/DataSourceConfigurationComponent.tsx +142 -0
  5. package/src/Components/DataSourceConfigurationModalComponent.tsx +200 -0
  6. package/src/Components/ItemListComponent.tsx +95 -0
  7. package/src/Components/LineChartViewport/LineChartViewport.tsx +31 -0
  8. package/src/Components/LineChartViewport/index.ts +1 -0
  9. package/src/Components/MoreDropdownMenu.tsx +112 -0
  10. package/src/Components/ProgressDropdownWithService.tsx +101 -0
  11. package/src/Components/SidePanelWithServices.tsx +122 -0
  12. package/src/CustomizableContextMenu/ContextMenuController.tsx +216 -0
  13. package/src/CustomizableContextMenu/ContextMenuItemsBuilder.test.js +29 -0
  14. package/src/CustomizableContextMenu/ContextMenuItemsBuilder.ts +176 -0
  15. package/src/CustomizableContextMenu/index.ts +5 -0
  16. package/src/CustomizableContextMenu/types.ts +126 -0
  17. package/src/DataSourceConfigurationAPI/GoogleCloudDataSourceConfigurationAPI.ts +236 -0
  18. package/src/DicomJSONDataSource/index.js +326 -0
  19. package/src/DicomLocalDataSource/index.js +273 -0
  20. package/src/DicomTagBrowser/DicomTagBrowser.css +49 -0
  21. package/src/DicomTagBrowser/DicomTagBrowser.tsx +454 -0
  22. package/src/DicomTagBrowser/DicomTagTable.tsx +311 -0
  23. package/src/DicomWebDataSource/dcm4cheeReject.js +45 -0
  24. package/src/DicomWebDataSource/exampleInstances.js +280 -0
  25. package/src/DicomWebDataSource/index.ts +808 -0
  26. package/src/DicomWebDataSource/qido.js +215 -0
  27. package/src/DicomWebDataSource/retrieveBulkData.test.ts +35 -0
  28. package/src/DicomWebDataSource/retrieveBulkData.ts +31 -0
  29. package/src/DicomWebDataSource/retrieveRendered.test.ts +147 -0
  30. package/src/DicomWebDataSource/retrieveRendered.ts +141 -0
  31. package/src/DicomWebDataSource/retrieveStudyMetadata.js +108 -0
  32. package/src/DicomWebDataSource/retrieveStudyMetadata.test.js +75 -0
  33. package/src/DicomWebDataSource/retrieveThumbnail.ts +346 -0
  34. package/src/DicomWebDataSource/serviceUrls.test.ts +143 -0
  35. package/src/DicomWebDataSource/utils/StaticWadoClient.ts +272 -0
  36. package/src/DicomWebDataSource/utils/cleanDenaturalizedDataset.ts +78 -0
  37. package/src/DicomWebDataSource/utils/findIndexOfString.ts +47 -0
  38. package/src/DicomWebDataSource/utils/fixBulkDataURI.test.ts +68 -0
  39. package/src/DicomWebDataSource/utils/fixBulkDataURI.ts +78 -0
  40. package/src/DicomWebDataSource/utils/fixMultiValueKeys.ts +12 -0
  41. package/src/DicomWebDataSource/utils/fixMultipart.ts +70 -0
  42. package/src/DicomWebDataSource/utils/getImageId.js +54 -0
  43. package/src/DicomWebDataSource/utils/getWADORSImageId.js +51 -0
  44. package/src/DicomWebDataSource/utils/index.ts +9 -0
  45. package/src/DicomWebDataSource/utils/retrieveMetadataFiltered.js +61 -0
  46. package/src/DicomWebDataSource/wado/retrieveMetadata.js +41 -0
  47. package/src/DicomWebDataSource/wado/retrieveMetadataLoader.js +64 -0
  48. package/src/DicomWebDataSource/wado/retrieveMetadataLoaderAsync.js +159 -0
  49. package/src/DicomWebDataSource/wado/retrieveMetadataLoaderSync.js +58 -0
  50. package/src/DicomWebProxyDataSource/index.ts +90 -0
  51. package/src/MergeDataSource/index.test.ts +212 -0
  52. package/src/MergeDataSource/index.ts +319 -0
  53. package/src/MergeDataSource/types.ts +46 -0
  54. package/src/Panels/DataSourceSelector.tsx +55 -0
  55. package/src/Panels/StudyBrowser/PanelStudyBrowser.tsx +612 -0
  56. package/src/Panels/StudyBrowser/PanelStudyBrowserHeader.tsx +88 -0
  57. package/src/Panels/StudyBrowser/constants/actionIcons.ts +12 -0
  58. package/src/Panels/StudyBrowser/constants/index.ts +4 -0
  59. package/src/Panels/StudyBrowser/constants/viewPresets.ts +16 -0
  60. package/src/Panels/StudyBrowser/resolveThumbnailDetails.test.ts +197 -0
  61. package/src/Panels/StudyBrowser/resolveThumbnailDetails.ts +132 -0
  62. package/src/Panels/StudyBrowser/types/actionIcon.ts +9 -0
  63. package/src/Panels/StudyBrowser/types/index.ts +4 -0
  64. package/src/Panels/StudyBrowser/types/viewPreset.ts +7 -0
  65. package/src/Panels/WrappedPanelStudyBrowser.tsx +61 -0
  66. package/src/Panels/createReportDialogPrompt.tsx +128 -0
  67. package/src/Panels/debounce.js +25 -0
  68. package/src/Panels/getImageSrcFromImageId.js +16 -0
  69. package/src/Panels/getStudiesForPatientByMRN.js +19 -0
  70. package/src/Panels/index.js +5 -0
  71. package/src/Panels/requestDisplaySetCreationForStudy.js +19 -0
  72. package/src/SOPClassHandlers/chartSOPClassHandler.test.ts +81 -0
  73. package/src/SOPClassHandlers/chartSOPClassHandler.ts +127 -0
  74. package/src/Toolbar/ToolBoxWrapper.tsx +64 -0
  75. package/src/Toolbar/ToolButtonListWrapper.tsx +77 -0
  76. package/src/Toolbar/ToolButtonWrapper.tsx +32 -0
  77. package/src/Toolbar/ToolRowWrapper.tsx +41 -0
  78. package/src/Toolbar/Toolbar.tsx +98 -0
  79. package/src/Toolbar/ToolbarDivider.tsx +5 -0
  80. package/src/Toolbar/ToolbarLayoutSelector.tsx +195 -0
  81. package/src/Toolbar/index.ts +7 -0
  82. package/src/ViewerLayout/HeaderPatientInfo/HeaderPatientInfo.tsx +96 -0
  83. package/src/ViewerLayout/HeaderPatientInfo/index.js +3 -0
  84. package/src/ViewerLayout/HeaderUndoRedo.tsx +47 -0
  85. package/src/ViewerLayout/ResizablePanelsHook.tsx +334 -0
  86. package/src/ViewerLayout/ViewerHeader.tsx +124 -0
  87. package/src/ViewerLayout/constants/panels.ts +42 -0
  88. package/src/ViewerLayout/index.tsx +227 -0
  89. package/src/ViewerLayout/useUndoRedoState.ts +75 -0
  90. package/src/__tests__/commandsModuleToggleOneUp.test.ts +147 -0
  91. package/src/commandsModule.ts +970 -0
  92. package/src/customizations/aboutModalCustomization.tsx +42 -0
  93. package/src/customizations/appearanceModalCustomization.tsx +143 -0
  94. package/src/customizations/contextMenuCustomization.ts +25 -0
  95. package/src/customizations/contextMenuUICustomization.ts +5 -0
  96. package/src/customizations/customRoutesCustomization.ts +6 -0
  97. package/src/customizations/dataSourceConfigurationCustomization.ts +19 -0
  98. package/src/customizations/datasourcesCustomization.tsx +14 -0
  99. package/src/customizations/defaultContextMenuCustomization.ts +22 -0
  100. package/src/customizations/hangingProtocolsCustomization.ts +15 -0
  101. package/src/customizations/headerRightSideCustomization.ts +19 -0
  102. package/src/customizations/helloPageCustomization.tsx +14 -0
  103. package/src/customizations/hideHeaderUndoRedoCustomization.ts +22 -0
  104. package/src/customizations/hotkeyBindingsCustomization.ts +5 -0
  105. package/src/customizations/instanceSortingCriteriaCustomization.ts +6 -0
  106. package/src/customizations/labellingFlowCustomization.tsx +5 -0
  107. package/src/customizations/loadingIndicatorProgressCustomization.tsx +5 -0
  108. package/src/customizations/loadingIndicatorTotalPercentCustomization.tsx +5 -0
  109. package/src/customizations/menuContentCustomization.tsx +67 -0
  110. package/src/customizations/metadataContextCustomization.test.ts +22 -0
  111. package/src/customizations/metadataContextCustomization.ts +28 -0
  112. package/src/customizations/metadataDisplaySetCustomization.ts +55 -0
  113. package/src/customizations/missingReferenceDisplaySetHandler.ts +5 -0
  114. package/src/customizations/multimonitorCustomization.ts +63 -0
  115. package/src/customizations/notificationCustomization.ts +29 -0
  116. package/src/customizations/onDropHandlerCustomization.ts +5 -0
  117. package/src/customizations/onboardingCustomization.ts +200 -0
  118. package/src/customizations/overlayItemCustomization.tsx +33 -0
  119. package/src/customizations/progressDropdownCustomization.ts +5 -0
  120. package/src/customizations/progressLoadingBarCustomization.tsx +5 -0
  121. package/src/customizations/reportDialogCustomization.test.ts +701 -0
  122. package/src/customizations/reportDialogCustomization.tsx +661 -0
  123. package/src/customizations/sortingCriteriaCustomization.ts +14 -0
  124. package/src/customizations/studyBrowserCustomization.test.ts +69 -0
  125. package/src/customizations/studyBrowserCustomization.ts +95 -0
  126. package/src/customizations/thumbnailDetailsCustomization.ts +91 -0
  127. package/src/customizations/userPreferencesCustomization.tsx +342 -0
  128. package/src/customizations/workListCustomization.ts +107 -0
  129. package/src/displaySetSplitting/makeDisplaySetFromInstanceGroup.test.ts +181 -0
  130. package/src/displaySetSplitting/makeDisplaySetFromInstanceGroup.ts +240 -0
  131. package/src/displaySetSplitting/makeImageSetDisplaySet.ts +276 -0
  132. package/src/displaySetSplitting/stackSopClassUids.ts +60 -0
  133. package/src/displaySetSplitting/urlSplitModules.test.ts +333 -0
  134. package/src/findViewportsByPosition.ts +102 -0
  135. package/src/getCustomizationModule.tsx +109 -0
  136. package/src/getDataSourcesModule.js +44 -0
  137. package/src/getDisplaySetMessages.ts +54 -0
  138. package/src/getDisplaySetsFromUnsupportedSeries.js +63 -0
  139. package/src/getDisplaySetsFromUnsupportedSeries.test.js +14 -0
  140. package/src/getHangingProtocolModule.js +155 -0
  141. package/src/getLayoutTemplateModule.js +28 -0
  142. package/src/getPTImageIdInstanceMetadata.test.ts +102 -0
  143. package/src/getPTImageIdInstanceMetadata.ts +124 -0
  144. package/src/getPanelModule.tsx +29 -0
  145. package/src/getSopClassHandlerModule.js +152 -0
  146. package/src/getSopClassHandlerModule.test.js +78 -0
  147. package/src/getToolbarModule.tsx +63 -0
  148. package/src/getViewportModule.tsx +12 -0
  149. package/src/hangingprotocols/hpCompare.ts +189 -0
  150. package/src/hangingprotocols/hpEcgCustomization.test.ts +104 -0
  151. package/src/hangingprotocols/hpMNGrid.test.ts +120 -0
  152. package/src/hangingprotocols/hpMNGrid.ts +419 -0
  153. package/src/hangingprotocols/hpMammo.ts +202 -0
  154. package/src/hangingprotocols/hpScale.ts +132 -0
  155. package/src/hangingprotocols/index.ts +16 -0
  156. package/src/hangingprotocols/protocolMatchChanges.test.ts +73 -0
  157. package/src/hangingprotocols/utils/isNewestOfModality.ts +19 -0
  158. package/src/hangingprotocols/utils/laterality.ts +9 -0
  159. package/src/hangingprotocols/utils/mammoDisplaySetSelector.ts +214 -0
  160. package/src/hangingprotocols/utils/registerHangingProtocolAttributes.ts +14 -0
  161. package/src/hangingprotocols/utils/seriesSelectors.ts +62 -0
  162. package/src/hangingprotocols/utils/studySelectors.ts +14 -0
  163. package/src/hangingprotocols/utils/viewCode.test.js +25 -0
  164. package/src/hangingprotocols/utils/viewCode.ts +17 -0
  165. package/src/hangingprotocols/utils/viewportOptions.ts +18 -0
  166. package/src/hooks/usePatientInfo.tsx +63 -0
  167. package/src/id.js +5 -0
  168. package/src/index.ts +113 -0
  169. package/src/init.ts +169 -0
  170. package/src/stores/index.ts +7 -0
  171. package/src/stores/useDisplaySetSelectorStore.ts +83 -0
  172. package/src/stores/useHangingProtocolStageIndexStore.ts +76 -0
  173. package/src/stores/useToggleHangingProtocolStore.ts +76 -0
  174. package/src/stores/useToggleOneUpViewportGridStore.ts +19 -0
  175. package/src/stores/useUIStateStore.ts +87 -0
  176. package/src/stores/useViewportGridStore.ts +89 -0
  177. package/src/stores/useViewportsByPositionStore.ts +100 -0
  178. package/src/types/AppTypes.ts +20 -0
  179. package/src/types/commandModuleTypes.tsx +6 -0
  180. package/src/utils/Toolbox.tsx +123 -0
  181. package/src/utils/_shared/PROMPT_RESPONSES.ts +10 -0
  182. package/src/utils/addIcon.ts +6 -0
  183. package/src/utils/appendFrameQueryToImageId.js +9 -0
  184. package/src/utils/callInputDialog.tsx +126 -0
  185. package/src/utils/colorPickerDialog.css +4 -0
  186. package/src/utils/colorPickerDialog.tsx +45 -0
  187. package/src/utils/createRenderedRetrieve.js +32 -0
  188. package/src/utils/createRenderedRetrieve.test.js +46 -0
  189. package/src/utils/dicomWriter.test.ts +228 -0
  190. package/src/utils/dicomWriter.ts +110 -0
  191. package/src/utils/getBulkdataValue.js +45 -0
  192. package/src/utils/getBulkdataValue.test.js +105 -0
  193. package/src/utils/getDirectURL.test.ts +207 -0
  194. package/src/utils/getDirectURL.ts +65 -0
  195. package/src/utils/getSRSeriesAndInstanceNumber.js +48 -0
  196. package/src/utils/index.ts +2 -0
  197. package/src/utils/layerConfigurationUtils.ts +202 -0
  198. package/src/utils/promptLabelAnnotation.js +47 -0
  199. package/src/utils/promptSaveReport.test.ts +106 -0
  200. package/src/utils/promptSaveReport.tsx +117 -0
  201. package/src/utils/registerNaturalizedDatasetForLocalWadouri.js +146 -0
  202. package/src/utils/registerNaturalizedDatasetForLocalWadouri.test.js +177 -0
  203. package/src/utils/registerStoredInstanceImageId.test.ts +73 -0
  204. package/src/utils/registerStoredInstanceImageId.ts +66 -0
  205. package/src/utils/reuseCachedLayouts.ts +92 -0
  206. package/src/utils/secureConfigFetch.js +115 -0
  207. package/src/utils/secureConfigFetch.test.js +163 -0
  208. package/src/utils/seriesDescriptionHistory.ts +83 -0
  209. package/src/utils/validations/areAllImageComponentsEqual.ts +24 -0
  210. package/src/utils/validations/areAllImageDimensionsEqual.test.ts +41 -0
  211. package/src/utils/validations/areAllImageDimensionsEqual.ts +27 -0
  212. package/src/utils/validations/areAllImagePositionsEqual.ts +75 -0
  213. package/src/utils/validations/areAllImageSpacingEqual.ts +66 -0
  214. package/src/utils/validations/checkMultiframe.ts +25 -0
  215. package/src/utils/validations/checkSingleFrames.ts +36 -0
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import { AboutModal } from '@ohif/ui-next';
3
+ import detect from 'browser-detect';
4
+ import { useTranslation } from 'react-i18next';
5
+
6
+ function AboutModalDefault() {
7
+ const { t } = useTranslation('AboutModal');
8
+ const { os, version, name } = detect();
9
+ const browser = `${name[0].toUpperCase()}${name.substr(1)} ${version}`;
10
+ const versionNumber = process.env.VERSION_NUMBER;
11
+ const commitHash = process.env.COMMIT_HASH;
12
+
13
+ const [main, beta] = versionNumber.split('-');
14
+
15
+ return (
16
+ <AboutModal className="w-[400px]">
17
+ <AboutModal.ProductName>OHIF Viewer</AboutModal.ProductName>
18
+ <AboutModal.ProductVersion>{main}</AboutModal.ProductVersion>
19
+ {beta && <AboutModal.ProductBeta>{beta}</AboutModal.ProductBeta>}
20
+
21
+ <AboutModal.Body>
22
+ <AboutModal.DetailItem
23
+ label={t('Commit Hash')}
24
+ value={commitHash}
25
+ />
26
+ <AboutModal.DetailItem
27
+ label={t('Current Browser & OS')}
28
+ value={`${browser}, ${os}`}
29
+ />
30
+ <AboutModal.SocialItem
31
+ icon="SocialGithub"
32
+ url="OHIF/Viewers"
33
+ text="github.com/OHIF/Viewers"
34
+ />
35
+ </AboutModal.Body>
36
+ </AboutModal>
37
+ );
38
+ }
39
+
40
+ export default {
41
+ 'ohif.aboutModal': AboutModalDefault,
42
+ };
@@ -0,0 +1,143 @@
1
+ import React from 'react';
2
+ import {
3
+ AppearanceModal,
4
+ Select,
5
+ SelectTrigger,
6
+ SelectValue,
7
+ SelectContent,
8
+ SelectItem,
9
+ Button,
10
+ useActiveTheme,
11
+ themePresets,
12
+ } from '@ohif/ui-next';
13
+ import { useTranslation } from 'react-i18next';
14
+
15
+ function AppearanceModalDefault() {
16
+ const { activeTheme, setActiveTheme, customCss, applyCustomTheme, clearCustomTheme } =
17
+ useActiveTheme();
18
+ const { t } = useTranslation('AppearanceModal');
19
+
20
+ const [draftCss, setDraftCss] = React.useState(() => customCss);
21
+ const [isCustomOpen, setIsCustomOpen] = React.useState(() => activeTheme === 'custom');
22
+ const [parseFailed, setParseFailed] = React.useState(false);
23
+
24
+ const handleToggleCustom = () => {
25
+ setIsCustomOpen(!isCustomOpen);
26
+ };
27
+
28
+ const handleSave = () => {
29
+ setParseFailed(!applyCustomTheme(draftCss));
30
+ };
31
+
32
+ const handleClear = () => {
33
+ clearCustomTheme();
34
+ setDraftCss('');
35
+ setParseFailed(false);
36
+ setIsCustomOpen(false);
37
+ };
38
+
39
+ const handlePresetChange = (value: string) => {
40
+ if (value === 'custom') {
41
+ // Selecting "Custom" restores the saved custom theme; the draft is only
42
+ // committed through the explicit Apply button.
43
+ setIsCustomOpen(true);
44
+ if (customCss) {
45
+ applyCustomTheme(customCss);
46
+ }
47
+ } else {
48
+ setIsCustomOpen(false);
49
+ setActiveTheme(value);
50
+ }
51
+ };
52
+
53
+ const handleTextChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
54
+ setDraftCss(e.target.value);
55
+ setParseFailed(false);
56
+ };
57
+
58
+ return (
59
+ <AppearanceModal>
60
+ <AppearanceModal.Body>
61
+ <div className="grid grid-cols-[auto_1fr] items-center gap-x-6 gap-y-4">
62
+ <AppearanceModal.SectionLabel>{t('Theme')}</AppearanceModal.SectionLabel>
63
+ <div>
64
+ <Select
65
+ value={activeTheme}
66
+ onValueChange={handlePresetChange}
67
+ >
68
+ <SelectTrigger
69
+ className="w-[200px]"
70
+ aria-label={t('Theme')}
71
+ >
72
+ <SelectValue />
73
+ </SelectTrigger>
74
+ <SelectContent>
75
+ <SelectItem value="default">{t('Default Theme')}</SelectItem>
76
+ {themePresets.map(preset => (
77
+ <SelectItem
78
+ key={preset.name}
79
+ value={preset.name}
80
+ >
81
+ {preset.label}
82
+ </SelectItem>
83
+ ))}
84
+ {(customCss || draftCss) && <SelectItem value="custom">{t('Custom')}</SelectItem>}
85
+ </SelectContent>
86
+ </Select>
87
+ </div>
88
+
89
+ <div className="col-start-2">
90
+ <Button
91
+ variant="ghost"
92
+ size="sm"
93
+ onClick={handleToggleCustom}
94
+ >
95
+ {isCustomOpen ? t('Hide') : t('Custom Theme')}
96
+ </Button>
97
+ </div>
98
+ </div>
99
+
100
+ {isCustomOpen && (
101
+ <div className="mt-4 flex flex-col space-y-2">
102
+ <textarea
103
+ value={draftCss}
104
+ onChange={handleTextChange}
105
+ placeholder={t('Paste your custom theme color tokens here')}
106
+ aria-label={t('Paste your custom theme color tokens here')}
107
+ rows={8}
108
+ className="bg-muted text-foreground border-input placeholder:text-muted-foreground focus:ring-ring rounded-md border px-3 py-2 font-mono text-sm focus:outline-none focus:ring-1 focus:ring-inset"
109
+ />
110
+ {parseFailed && (
111
+ <span
112
+ className="text-destructive text-sm"
113
+ role="alert"
114
+ >
115
+ {t('No valid theme tokens found')}
116
+ </span>
117
+ )}
118
+ <div className="flex space-x-2">
119
+ <Button
120
+ variant="default"
121
+ size="sm"
122
+ onClick={handleSave}
123
+ >
124
+ {t('Apply')}
125
+ </Button>
126
+ <Button
127
+ variant="ghost"
128
+ size="sm"
129
+ onClick={handleClear}
130
+ >
131
+ {t('Clear')}
132
+ </Button>
133
+ </div>
134
+ </div>
135
+ )}
136
+ </AppearanceModal.Body>
137
+ </AppearanceModal>
138
+ );
139
+ }
140
+
141
+ export default {
142
+ 'ohif.appearanceModal': AppearanceModalDefault,
143
+ };
@@ -0,0 +1,25 @@
1
+ import { CustomizationService } from '@ohif/core';
2
+
3
+ export default {
4
+ 'ohif.contextMenu': {
5
+ $transform: function (customizationService: CustomizationService) {
6
+ /**
7
+ * Applies the inheritsFrom to all the menu items.
8
+ * This function clones the object and child objects to prevent
9
+ * changes to the original customization object.
10
+ */
11
+ // Don't modify the children, as those are copied by reference
12
+ const clonedObject = { ...this };
13
+ clonedObject.menus = this.menus.map(menu => ({ ...menu }));
14
+
15
+ for (const menu of clonedObject.menus) {
16
+ const { items: originalItems } = menu;
17
+ menu.items = [];
18
+ for (const item of originalItems) {
19
+ menu.items.push(customizationService.transform(item));
20
+ }
21
+ }
22
+ return clonedObject;
23
+ },
24
+ },
25
+ };
@@ -0,0 +1,5 @@
1
+ import { ContextMenuViewport } from '@ohif/ui-next';
2
+
3
+ export default {
4
+ 'ui.contextMenu': ContextMenuViewport,
5
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ 'routes.customRoutes': {
3
+ routes: [],
4
+ notFoundRoute: null,
5
+ },
6
+ };
@@ -0,0 +1,19 @@
1
+ import DataSourceConfigurationComponent from '../Components/DataSourceConfigurationComponent';
2
+ import { GoogleCloudDataSourceConfigurationAPI } from '../DataSourceConfigurationAPI/GoogleCloudDataSourceConfigurationAPI';
3
+
4
+ export default function getDataSourceConfigurationCustomization({
5
+ servicesManager,
6
+ extensionManager,
7
+ }) {
8
+ return {
9
+ // the generic GUI component to configure a data source using an instance of a BaseDataSourceConfigurationAPI
10
+ 'ohif.dataSourceConfigurationComponent': DataSourceConfigurationComponent.bind(null, {
11
+ servicesManager,
12
+ extensionManager,
13
+ }),
14
+
15
+ // The factory for creating an instance of a BaseDataSourceConfigurationAPI for Google Cloud Healthcare
16
+ 'ohif.dataSourceConfigurationAPI.google': (dataSourceName: string) =>
17
+ new GoogleCloudDataSourceConfigurationAPI(dataSourceName, servicesManager, extensionManager),
18
+ };
19
+ }
@@ -0,0 +1,14 @@
1
+ import DataSourceSelector from '../Panels/DataSourceSelector';
2
+
3
+ export default {
4
+ 'routes.customRoutes': {
5
+ routes: {
6
+ $push: [
7
+ {
8
+ path: '/datasources',
9
+ children: DataSourceSelector,
10
+ },
11
+ ],
12
+ },
13
+ },
14
+ };
@@ -0,0 +1,22 @@
1
+ export default {
2
+ measurementsContextMenu: {
3
+ inheritsFrom: 'ohif.contextMenu',
4
+ menus: [
5
+ // Get the items from the UI Customization for the menu name (and have a custom name)
6
+ {
7
+ id: 'forExistingMeasurement',
8
+ selector: ({ nearbyToolData }) => !!nearbyToolData,
9
+ items: [
10
+ {
11
+ label: 'Delete measurement',
12
+ commands: 'removeMeasurement',
13
+ },
14
+ {
15
+ label: 'Add Label',
16
+ commands: 'setMeasurementLabel',
17
+ },
18
+ ],
19
+ },
20
+ ],
21
+ },
22
+ };
@@ -0,0 +1,15 @@
1
+ import { hpMN, hpMN8 } from '../hangingprotocols/hpMNGrid';
2
+
3
+ /**
4
+ * The grid protocols as `hangingProtocols.<id>` customizations, so that a
5
+ * `?customization=` JSONC file can change one with `$merge`, or replace it
6
+ * with `$set`. The `hangingProtocolService` reads the customization in place of
7
+ * the protocol that `getHangingProtocolModule` registers.
8
+ *
9
+ * `hpMN8` copies the stages of `hpMN` in code, so a change to the mnGrid
10
+ * customization does not change mnGrid8.
11
+ */
12
+ export default {
13
+ [`hangingProtocols.${hpMN.id}`]: hpMN,
14
+ [`hangingProtocols.${hpMN8.id}`]: hpMN8,
15
+ };
@@ -0,0 +1,19 @@
1
+ import HeaderUndoRedo from '../ViewerLayout/HeaderUndoRedo';
2
+ import HeaderPatientInfo from '../ViewerLayout/HeaderPatientInfo';
3
+
4
+ /**
5
+ * The right side of the viewer header's menu bar, ahead of the settings menu.
6
+ * The key is named for the area, not its contents: `items` is an ordered list
7
+ * of components, so reordering the array reorders the header (patient info
8
+ * ahead of undo/redo, say), adding to it adds a slot, and removing an entry
9
+ * removes one — see `hideHeaderUndoRedoCustomization` for that last case.
10
+ *
11
+ * `ViewerHeader` renders each entry as a component, so an item is a normal
12
+ * component that may use hooks (these two use `useSystem()`), and each gets its
13
+ * own separator. An item that renders `null` collapses its slot and separator.
14
+ */
15
+ export default {
16
+ 'ohif.headerRightSide': {
17
+ items: [HeaderUndoRedo, HeaderPatientInfo],
18
+ },
19
+ };
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+
3
+ export default {
4
+ 'routes.customRoutes': {
5
+ routes: {
6
+ $push: [
7
+ {
8
+ path: '/custom',
9
+ children: () => <h1 style={{ color: 'white' }}>Hello Custom Route</h1>,
10
+ },
11
+ ],
12
+ },
13
+ },
14
+ };
@@ -0,0 +1,22 @@
1
+ import HeaderUndoRedo from '../ViewerLayout/HeaderUndoRedo';
2
+
3
+ /**
4
+ * Opt-in customization that drops the undo/redo buttons from the right side of
5
+ * the viewer header's menu bar, leaving every other item there (patient info,
6
+ * plus anything a site added) untouched. Add it to the app config:
7
+ *
8
+ * ```js
9
+ * window.config = {
10
+ * customizationService: ['@ohif/extension-default.customizationModule.hideHeaderUndoRedo'],
11
+ * };
12
+ * ```
13
+ *
14
+ * `$filter` keeps the items its predicate returns true for, so this removes one
15
+ * entry from the shipped `ohif.headerRightSide` list rather than replacing the
16
+ * list — a site that added its own items keeps them.
17
+ */
18
+ export default {
19
+ 'ohif.headerRightSide': {
20
+ items: { $filter: (item: unknown) => item !== HeaderUndoRedo },
21
+ },
22
+ };
@@ -0,0 +1,5 @@
1
+ import { defaults } from '@ohif/core';
2
+
3
+ export default {
4
+ 'ohif.hotkeyBindings': defaults.hotkeyBindings,
5
+ };
@@ -0,0 +1,6 @@
1
+ export default {
2
+ instanceSortingCriteria: {
3
+ sortFunctions: {},
4
+ defaultSortFunctionName: '',
5
+ },
6
+ };
@@ -0,0 +1,5 @@
1
+ import { LabellingFlow } from '@ohif/ui-next';
2
+
3
+ export default {
4
+ 'ui.labellingComponent': LabellingFlow,
5
+ };
@@ -0,0 +1,5 @@
1
+ import { LoadingIndicatorProgress } from '@ohif/ui-next';
2
+
3
+ export default {
4
+ 'ui.loadingIndicatorProgress': LoadingIndicatorProgress,
5
+ };
@@ -0,0 +1,5 @@
1
+ import { LoadingIndicatorTotalPercent } from '@ohif/ui-next';
2
+
3
+ export default {
4
+ 'ui.loadingIndicatorTotalPercent': LoadingIndicatorTotalPercent,
5
+ };
@@ -0,0 +1,67 @@
1
+ import React from 'react';
2
+ import {
3
+ DropdownMenuSub,
4
+ DropdownMenuSubTrigger,
5
+ DropdownMenuPortal,
6
+ DropdownMenuSubContent,
7
+ DropdownMenuItem,
8
+ Icons,
9
+ } from '@ohif/ui-next';
10
+
11
+ export default {
12
+ 'ohif.menuContent': function (props) {
13
+ const { item: topLevelItem, commandsManager, servicesManager, ...rest } = props;
14
+
15
+ const content = function (subProps) {
16
+ const { item: subItem } = subProps;
17
+
18
+ // Regular menu item
19
+ const isDisabled = subItem.selector && !subItem.selector({ servicesManager });
20
+
21
+ return (
22
+ <DropdownMenuItem
23
+ disabled={isDisabled}
24
+ onSelect={() => {
25
+ commandsManager.runAsync(subItem.commands, {
26
+ ...subItem.commandOptions,
27
+ ...rest,
28
+ });
29
+ }}
30
+ className="gap-[6px]"
31
+ >
32
+ {subItem.iconName && (
33
+ <Icons.ByName
34
+ name={subItem.iconName}
35
+ className="-ml-1"
36
+ />
37
+ )}
38
+ {subItem.label}
39
+ </DropdownMenuItem>
40
+ );
41
+ };
42
+
43
+ // If item has sub-items, render a submenu
44
+ if (topLevelItem.items) {
45
+ return (
46
+ <DropdownMenuSub>
47
+ <DropdownMenuSubTrigger className="gap-[6px]">
48
+ {topLevelItem.iconName && (
49
+ <Icons.ByName
50
+ name={topLevelItem.iconName}
51
+ className="-ml-1"
52
+ />
53
+ )}
54
+ {topLevelItem.label}
55
+ </DropdownMenuSubTrigger>
56
+ <DropdownMenuPortal>
57
+ <DropdownMenuSubContent>
58
+ {topLevelItem.items.map(subItem => content({ ...props, item: subItem }))}
59
+ </DropdownMenuSubContent>
60
+ </DropdownMenuPortal>
61
+ </DropdownMenuSub>
62
+ );
63
+ }
64
+
65
+ return content({ ...props, item: topLevelItem });
66
+ },
67
+ };
@@ -0,0 +1,22 @@
1
+ import { chartSopClassUids, displaySetRuleOrder, displaySetRules } from '@cornerstonejs/metadata';
2
+ import getMetadataContextCustomization from './metadataContextCustomization';
3
+ import getMetadataDisplaySetCustomization from './metadataDisplaySetCustomization';
4
+ import { ChartDataSOPClassUid } from '../SOPClassHandlers/chartSOPClassHandler';
5
+
6
+ describe('split customization defaults', () => {
7
+ const { metadataContext } = getMetadataContextCustomization();
8
+
9
+ it('holds no function in the metadataContext default, so a server can read it as data', () => {
10
+ expect(JSON.parse(JSON.stringify(metadataContext))).toEqual(metadataContext);
11
+ });
12
+
13
+ it('adds the private chart SOP class to the CS3D chart list', () => {
14
+ expect(metadataContext.chartSopClassUids).toEqual([...chartSopClassUids, ChartDataSOPClassUid]);
15
+ });
16
+
17
+ it('uses the CS3D default rule set as the default split rules', () => {
18
+ const { useMetadataDisplaySet } = getMetadataDisplaySetCustomization({} as never);
19
+ expect(useMetadataDisplaySet.displaySetRules).toBe(displaySetRules);
20
+ expect(useMetadataDisplaySet.displaySetRuleOrder).toBe(displaySetRuleOrder);
21
+ });
22
+ });
@@ -0,0 +1,28 @@
1
+ import { chartSopClassUids, defaultMetadataContext } from '@cornerstonejs/metadata';
2
+ import { ChartDataSOPClassUid } from '../SOPClassHandlers/chartSOPClassHandler';
3
+
4
+ /**
5
+ * The `metadataContext` customization: the named lists and expressions that
6
+ * the split rules read, for example `imageSopClassUids` and `isImage`.
7
+ *
8
+ * The value is the `@cornerstonejs/metadata` `defaultMetadataContext`, with
9
+ * the OHIF private chart SOP class added to the end of `chartSopClassUids`
10
+ * (the same result as a `$push`). It is data only, so a server that applies
11
+ * the same customization files with `immutability-helper` gets the same
12
+ * context. A site changes a list with a standard command:
13
+ *
14
+ * ```jsonc
15
+ * { "metadataContext": { "imageSopClassUids": { "$push": ["1.2.3.4"] } } }
16
+ * ```
17
+ *
18
+ * It is a customization of its own, and not a part of `useMetadataDisplaySet`,
19
+ * so that other features can read it when the split rules are off.
20
+ */
21
+ export default function getMetadataContextCustomization() {
22
+ return {
23
+ metadataContext: {
24
+ ...defaultMetadataContext,
25
+ chartSopClassUids: [...chartSopClassUids, ChartDataSOPClassUid],
26
+ },
27
+ };
28
+ }
@@ -0,0 +1,55 @@
1
+ import { displaySetRuleOrder, displaySetRules } from '@cornerstonejs/metadata';
2
+ import type { GroupInstancesOptions, InstanceGroup } from '@cornerstonejs/metadata';
3
+ import { makeDisplaySetFromInstanceGroup } from '../displaySetSplitting/makeDisplaySetFromInstanceGroup';
4
+ import type { ImageSetFactoryContext } from '../displaySetSplitting/makeImageSetDisplaySet';
5
+
6
+ /**
7
+ * The `useMetadataDisplaySet` customization (default OFF).
8
+ *
9
+ * When enabled, DisplaySetService splits series instances into display sets
10
+ * with the `@cornerstonejs/metadata` split-rules engine. A rule with a
11
+ * `handler` name gives its display sets to the SOP class handler of the mode
12
+ * that declares that name in `handlerNames`.
13
+ *
14
+ * Enable per mode, in the `onModeEnter` of the mode. `setCustomizations` uses
15
+ * `CustomizationScope.Mode` by default, and `onModeExit` clears that scope:
16
+ * ```js
17
+ * customizationService.setCustomizations({
18
+ * useMetadataDisplaySet: { enabled: { $set: true } },
19
+ * });
20
+ * ```
21
+ * or globally via the named module entry
22
+ * `'@ohif/extension-default.customizationModule.metadataDisplaySet'`,
23
+ * or from the URL with `?customization=split/enableNewSplit`.
24
+ *
25
+ * `displaySetRules` (the registry, keyed by rule id) and `displaySetRuleOrder`
26
+ * (the rule ids in evaluation order) are the `@cornerstonejs/metadata`
27
+ * defaults, with no OHIF copy. A customization changes a rule by its id in the
28
+ * registry, and adds, removes or replaces an id of the order with
29
+ * `$spliceById`, which takes a rule id as the position:
30
+ * ```js
31
+ * { displaySetRuleOrder: { $spliceById: [['volume3d', 0, 'dwiByBValue']] } }
32
+ * ```
33
+ * DisplaySetService compiles the rules of the order with
34
+ * `createDisplaySetSplitRules`, with the `metadataContext` customization as
35
+ * the context.
36
+ *
37
+ * A rule error stops display set creation; OHIF does not drop the rule, and
38
+ * does not fall back to the SOP class handlers. See `DisplaySetService`.
39
+ */
40
+ export default function getMetadataDisplaySetCustomization(context: ImageSetFactoryContext) {
41
+ return {
42
+ useMetadataDisplaySet: {
43
+ enabled: false,
44
+ displaySetRules,
45
+ displaySetRuleOrder,
46
+ createDisplaySetFromGroup: (
47
+ group: InstanceGroup,
48
+ options: {
49
+ splitNumber: number;
50
+ compareInstances?: GroupInstancesOptions['compareInstances'];
51
+ }
52
+ ) => makeDisplaySetFromInstanceGroup(group, options, context),
53
+ },
54
+ };
55
+ }
@@ -0,0 +1,5 @@
1
+ export default {
2
+ missingReferenceDisplaySetHandler: () => {
3
+ return Promise.resolve({ handled: false });
4
+ },
5
+ };
@@ -0,0 +1,63 @@
1
+ export default {
2
+ 'studyBrowser.studyMenuItems': {
3
+ $push: [
4
+ {
5
+ id: 'applyHangingProtocol',
6
+ label: 'Apply Hanging Protocol',
7
+ iconName: 'ViewportViews',
8
+ items: [
9
+ {
10
+ id: 'applyDefaultProtocol',
11
+ label: 'Default',
12
+ commands: [
13
+ 'loadStudy',
14
+ {
15
+ commandName: 'setHangingProtocol',
16
+ commandOptions: {
17
+ protocolId: 'default',
18
+ },
19
+ },
20
+ ],
21
+ },
22
+ {
23
+ id: 'applyMPRProtocol',
24
+ label: '2x2 Grid',
25
+ commands: [
26
+ 'loadStudy',
27
+ {
28
+ commandName: 'setHangingProtocol',
29
+ commandOptions: {
30
+ protocolId: '@ohif/mnGrid',
31
+ },
32
+ },
33
+ ],
34
+ },
35
+ ],
36
+ },
37
+ {
38
+ id: 'showInOtherMonitor',
39
+ label: 'Launch On Second Monitor',
40
+ iconName: 'DicomTagBrowser',
41
+ selector: ({ servicesManager }) => {
42
+ const { multiMonitorService } = servicesManager.services;
43
+ return multiMonitorService.isMultimonitor;
44
+ },
45
+ commands: {
46
+ commandName: 'multimonitor',
47
+ commandOptions: {
48
+ hashParams: '&hangingProtocolId=@ohif/mnGrid8',
49
+ commands: [
50
+ 'loadStudy',
51
+ {
52
+ commandName: 'setHangingProtocol',
53
+ commandOptions: {
54
+ protocolId: '@ohif/mnGrid8',
55
+ },
56
+ },
57
+ ],
58
+ },
59
+ },
60
+ },
61
+ ],
62
+ },
63
+ };
@@ -0,0 +1,29 @@
1
+ import i18n from '@ohif/i18n';
2
+ import { ViewportDialog } from '@ohif/ui-next';
3
+
4
+ const beginTrackingMessage = i18n.t('MeasurementTable:Track measurements for this series?');
5
+ const trackNewSeriesMessage = i18n.t('Do you want to add this measurement to the existing report?');
6
+ const discardSeriesMessage = i18n.t(
7
+ 'You have existing tracked measurements. What would you like to do with your existing tracked measurements?'
8
+ );
9
+ const trackNewStudyMessage = i18n.t('MeasurementTable:Track measurements for this series?');
10
+ const discardStudyMessage = i18n.t(
11
+ 'Measurements cannot span across multiple studies. Do you want to save your tracked measurements?'
12
+ );
13
+ const hydrateSRMessage = i18n.t('Do you want to continue tracking measurements for this study?');
14
+ const hydrateRTMessage = i18n.t('Do you want to open this Segmentation?');
15
+ const hydrateSEGMessage = i18n.t('Do you want to open this Segmentation?');
16
+ const discardDirtyMessage = i18n.t('There are unsaved measurements. Do you want to save it?');
17
+
18
+ export default {
19
+ 'ui.notificationComponent': ViewportDialog,
20
+ 'viewportNotification.beginTrackingMessage': beginTrackingMessage,
21
+ 'viewportNotification.trackNewSeriesMessage': trackNewSeriesMessage,
22
+ 'viewportNotification.discardSeriesMessage': discardSeriesMessage,
23
+ 'viewportNotification.trackNewStudyMessage': trackNewStudyMessage,
24
+ 'viewportNotification.discardStudyMessage': discardStudyMessage,
25
+ 'viewportNotification.hydrateSRMessage': hydrateSRMessage,
26
+ 'viewportNotification.hydrateRTMessage': hydrateRTMessage,
27
+ 'viewportNotification.hydrateSEGMessage': hydrateSEGMessage,
28
+ 'viewportNotification.discardDirtyMessage': discardDirtyMessage,
29
+ };