@ohif/extension-default 3.14.0-beta.1 → 3.14.0-beta.100
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.
- package/dist/ohif-extension-default.css +1 -1
- package/dist/ohif-extension-default.umd.js +1 -1
- package/package.json +14 -10
- package/src/Actions/createReportAsync.tsx +45 -0
- package/src/Components/DataSourceConfigurationComponent.tsx +142 -0
- package/src/Components/DataSourceConfigurationModalComponent.tsx +200 -0
- package/src/Components/ItemListComponent.tsx +95 -0
- package/src/Components/LineChartViewport/LineChartViewport.tsx +31 -0
- package/src/Components/LineChartViewport/index.ts +1 -0
- package/src/Components/MoreDropdownMenu.tsx +112 -0
- package/src/Components/ProgressDropdownWithService.tsx +101 -0
- package/src/Components/SidePanelWithServices.tsx +122 -0
- package/src/CustomizableContextMenu/ContextMenuController.tsx +216 -0
- package/src/CustomizableContextMenu/ContextMenuItemsBuilder.test.js +29 -0
- package/src/CustomizableContextMenu/ContextMenuItemsBuilder.ts +176 -0
- package/src/CustomizableContextMenu/index.ts +5 -0
- package/src/CustomizableContextMenu/types.ts +126 -0
- package/src/DataSourceConfigurationAPI/GoogleCloudDataSourceConfigurationAPI.ts +236 -0
- package/src/DicomJSONDataSource/index.js +326 -0
- package/src/DicomLocalDataSource/index.js +273 -0
- package/src/DicomTagBrowser/DicomTagBrowser.css +49 -0
- package/src/DicomTagBrowser/DicomTagBrowser.tsx +454 -0
- package/src/DicomTagBrowser/DicomTagTable.tsx +311 -0
- package/src/DicomWebDataSource/dcm4cheeReject.js +45 -0
- package/src/DicomWebDataSource/exampleInstances.js +280 -0
- package/src/DicomWebDataSource/index.ts +808 -0
- package/src/DicomWebDataSource/qido.js +215 -0
- package/src/DicomWebDataSource/retrieveBulkData.test.ts +35 -0
- package/src/DicomWebDataSource/retrieveBulkData.ts +31 -0
- package/src/DicomWebDataSource/retrieveRendered.test.ts +147 -0
- package/src/DicomWebDataSource/retrieveRendered.ts +141 -0
- package/src/DicomWebDataSource/retrieveStudyMetadata.js +108 -0
- package/src/DicomWebDataSource/retrieveStudyMetadata.test.js +75 -0
- package/src/DicomWebDataSource/retrieveThumbnail.ts +346 -0
- package/src/DicomWebDataSource/serviceUrls.test.ts +143 -0
- package/src/DicomWebDataSource/utils/StaticWadoClient.ts +272 -0
- package/src/DicomWebDataSource/utils/cleanDenaturalizedDataset.ts +78 -0
- package/src/DicomWebDataSource/utils/findIndexOfString.ts +47 -0
- package/src/DicomWebDataSource/utils/fixBulkDataURI.test.ts +68 -0
- package/src/DicomWebDataSource/utils/fixBulkDataURI.ts +78 -0
- package/src/DicomWebDataSource/utils/fixMultiValueKeys.ts +12 -0
- package/src/DicomWebDataSource/utils/fixMultipart.ts +70 -0
- package/src/DicomWebDataSource/utils/getImageId.js +54 -0
- package/src/DicomWebDataSource/utils/getWADORSImageId.js +51 -0
- package/src/DicomWebDataSource/utils/index.ts +9 -0
- package/src/DicomWebDataSource/utils/retrieveMetadataFiltered.js +61 -0
- package/src/DicomWebDataSource/wado/retrieveMetadata.js +41 -0
- package/src/DicomWebDataSource/wado/retrieveMetadataLoader.js +64 -0
- package/src/DicomWebDataSource/wado/retrieveMetadataLoaderAsync.js +159 -0
- package/src/DicomWebDataSource/wado/retrieveMetadataLoaderSync.js +58 -0
- package/src/DicomWebProxyDataSource/index.ts +90 -0
- package/src/MergeDataSource/index.test.ts +212 -0
- package/src/MergeDataSource/index.ts +319 -0
- package/src/MergeDataSource/types.ts +46 -0
- package/src/Panels/DataSourceSelector.tsx +55 -0
- package/src/Panels/StudyBrowser/PanelStudyBrowser.tsx +612 -0
- package/src/Panels/StudyBrowser/PanelStudyBrowserHeader.tsx +88 -0
- package/src/Panels/StudyBrowser/constants/actionIcons.ts +12 -0
- package/src/Panels/StudyBrowser/constants/index.ts +4 -0
- package/src/Panels/StudyBrowser/constants/viewPresets.ts +16 -0
- package/src/Panels/StudyBrowser/resolveThumbnailDetails.test.ts +197 -0
- package/src/Panels/StudyBrowser/resolveThumbnailDetails.ts +132 -0
- package/src/Panels/StudyBrowser/types/actionIcon.ts +9 -0
- package/src/Panels/StudyBrowser/types/index.ts +4 -0
- package/src/Panels/StudyBrowser/types/viewPreset.ts +7 -0
- package/src/Panels/WrappedPanelStudyBrowser.tsx +61 -0
- package/src/Panels/createReportDialogPrompt.tsx +128 -0
- package/src/Panels/debounce.js +25 -0
- package/src/Panels/getImageSrcFromImageId.js +16 -0
- package/src/Panels/getStudiesForPatientByMRN.js +19 -0
- package/src/Panels/index.js +5 -0
- package/src/Panels/requestDisplaySetCreationForStudy.js +19 -0
- package/src/SOPClassHandlers/chartSOPClassHandler.test.ts +81 -0
- package/src/SOPClassHandlers/chartSOPClassHandler.ts +127 -0
- package/src/Toolbar/ToolBoxWrapper.tsx +64 -0
- package/src/Toolbar/ToolButtonListWrapper.tsx +77 -0
- package/src/Toolbar/ToolButtonWrapper.tsx +32 -0
- package/src/Toolbar/ToolRowWrapper.tsx +41 -0
- package/src/Toolbar/Toolbar.tsx +98 -0
- package/src/Toolbar/ToolbarDivider.tsx +5 -0
- package/src/Toolbar/ToolbarLayoutSelector.tsx +195 -0
- package/src/Toolbar/index.ts +7 -0
- package/src/ViewerLayout/HeaderPatientInfo/HeaderPatientInfo.tsx +96 -0
- package/src/ViewerLayout/HeaderPatientInfo/index.js +3 -0
- package/src/ViewerLayout/HeaderUndoRedo.tsx +47 -0
- package/src/ViewerLayout/ResizablePanelsHook.tsx +334 -0
- package/src/ViewerLayout/ViewerHeader.tsx +124 -0
- package/src/ViewerLayout/constants/panels.ts +42 -0
- package/src/ViewerLayout/index.tsx +227 -0
- package/src/ViewerLayout/useUndoRedoState.ts +75 -0
- package/src/__tests__/commandsModuleToggleOneUp.test.ts +147 -0
- package/src/commandsModule.ts +970 -0
- package/src/customizations/aboutModalCustomization.tsx +42 -0
- package/src/customizations/appearanceModalCustomization.tsx +143 -0
- package/src/customizations/contextMenuCustomization.ts +25 -0
- package/src/customizations/contextMenuUICustomization.ts +5 -0
- package/src/customizations/customRoutesCustomization.ts +6 -0
- package/src/customizations/dataSourceConfigurationCustomization.ts +19 -0
- package/src/customizations/datasourcesCustomization.tsx +14 -0
- package/src/customizations/defaultContextMenuCustomization.ts +22 -0
- package/src/customizations/hangingProtocolsCustomization.ts +15 -0
- package/src/customizations/headerRightSideCustomization.ts +19 -0
- package/src/customizations/helloPageCustomization.tsx +14 -0
- package/src/customizations/hideHeaderUndoRedoCustomization.ts +22 -0
- package/src/customizations/hotkeyBindingsCustomization.ts +5 -0
- package/src/customizations/instanceSortingCriteriaCustomization.ts +6 -0
- package/src/customizations/labellingFlowCustomization.tsx +5 -0
- package/src/customizations/loadingIndicatorProgressCustomization.tsx +5 -0
- package/src/customizations/loadingIndicatorTotalPercentCustomization.tsx +5 -0
- package/src/customizations/menuContentCustomization.tsx +67 -0
- package/src/customizations/metadataContextCustomization.test.ts +22 -0
- package/src/customizations/metadataContextCustomization.ts +28 -0
- package/src/customizations/metadataDisplaySetCustomization.ts +55 -0
- package/src/customizations/missingReferenceDisplaySetHandler.ts +5 -0
- package/src/customizations/multimonitorCustomization.ts +63 -0
- package/src/customizations/notificationCustomization.ts +29 -0
- package/src/customizations/onDropHandlerCustomization.ts +5 -0
- package/src/customizations/onboardingCustomization.ts +200 -0
- package/src/customizations/overlayItemCustomization.tsx +33 -0
- package/src/customizations/progressDropdownCustomization.ts +5 -0
- package/src/customizations/progressLoadingBarCustomization.tsx +5 -0
- package/src/customizations/reportDialogCustomization.test.ts +701 -0
- package/src/customizations/reportDialogCustomization.tsx +661 -0
- package/src/customizations/sortingCriteriaCustomization.ts +14 -0
- package/src/customizations/studyBrowserCustomization.test.ts +69 -0
- package/src/customizations/studyBrowserCustomization.ts +95 -0
- package/src/customizations/thumbnailDetailsCustomization.ts +91 -0
- package/src/customizations/userPreferencesCustomization.tsx +342 -0
- package/src/customizations/workListCustomization.ts +107 -0
- package/src/displaySetSplitting/makeDisplaySetFromInstanceGroup.test.ts +181 -0
- package/src/displaySetSplitting/makeDisplaySetFromInstanceGroup.ts +240 -0
- package/src/displaySetSplitting/makeImageSetDisplaySet.ts +276 -0
- package/src/displaySetSplitting/stackSopClassUids.ts +60 -0
- package/src/displaySetSplitting/urlSplitModules.test.ts +333 -0
- package/src/findViewportsByPosition.ts +102 -0
- package/src/getCustomizationModule.tsx +109 -0
- package/src/getDataSourcesModule.js +44 -0
- package/src/getDisplaySetMessages.ts +54 -0
- package/src/getDisplaySetsFromUnsupportedSeries.js +63 -0
- package/src/getDisplaySetsFromUnsupportedSeries.test.js +14 -0
- package/src/getHangingProtocolModule.js +155 -0
- package/src/getLayoutTemplateModule.js +28 -0
- package/src/getPTImageIdInstanceMetadata.test.ts +102 -0
- package/src/getPTImageIdInstanceMetadata.ts +124 -0
- package/src/getPanelModule.tsx +29 -0
- package/src/getSopClassHandlerModule.js +152 -0
- package/src/getSopClassHandlerModule.test.js +78 -0
- package/src/getToolbarModule.tsx +63 -0
- package/src/getViewportModule.tsx +12 -0
- package/src/hangingprotocols/hpCompare.ts +189 -0
- package/src/hangingprotocols/hpEcgCustomization.test.ts +104 -0
- package/src/hangingprotocols/hpMNGrid.test.ts +120 -0
- package/src/hangingprotocols/hpMNGrid.ts +419 -0
- package/src/hangingprotocols/hpMammo.ts +202 -0
- package/src/hangingprotocols/hpScale.ts +132 -0
- package/src/hangingprotocols/index.ts +16 -0
- package/src/hangingprotocols/protocolMatchChanges.test.ts +73 -0
- package/src/hangingprotocols/utils/isNewestOfModality.ts +19 -0
- package/src/hangingprotocols/utils/laterality.ts +9 -0
- package/src/hangingprotocols/utils/mammoDisplaySetSelector.ts +214 -0
- package/src/hangingprotocols/utils/registerHangingProtocolAttributes.ts +14 -0
- package/src/hangingprotocols/utils/seriesSelectors.ts +62 -0
- package/src/hangingprotocols/utils/studySelectors.ts +14 -0
- package/src/hangingprotocols/utils/viewCode.test.js +25 -0
- package/src/hangingprotocols/utils/viewCode.ts +17 -0
- package/src/hangingprotocols/utils/viewportOptions.ts +18 -0
- package/src/hooks/usePatientInfo.tsx +63 -0
- package/src/id.js +5 -0
- package/src/index.ts +113 -0
- package/src/init.ts +169 -0
- package/src/stores/index.ts +7 -0
- package/src/stores/useDisplaySetSelectorStore.ts +83 -0
- package/src/stores/useHangingProtocolStageIndexStore.ts +76 -0
- package/src/stores/useToggleHangingProtocolStore.ts +76 -0
- package/src/stores/useToggleOneUpViewportGridStore.ts +19 -0
- package/src/stores/useUIStateStore.ts +87 -0
- package/src/stores/useViewportGridStore.ts +89 -0
- package/src/stores/useViewportsByPositionStore.ts +100 -0
- package/src/types/AppTypes.ts +20 -0
- package/src/types/commandModuleTypes.tsx +6 -0
- package/src/utils/Toolbox.tsx +123 -0
- package/src/utils/_shared/PROMPT_RESPONSES.ts +10 -0
- package/src/utils/addIcon.ts +6 -0
- package/src/utils/appendFrameQueryToImageId.js +9 -0
- package/src/utils/callInputDialog.tsx +126 -0
- package/src/utils/colorPickerDialog.css +4 -0
- package/src/utils/colorPickerDialog.tsx +45 -0
- package/src/utils/createRenderedRetrieve.js +32 -0
- package/src/utils/createRenderedRetrieve.test.js +46 -0
- package/src/utils/dicomWriter.test.ts +228 -0
- package/src/utils/dicomWriter.ts +110 -0
- package/src/utils/getBulkdataValue.js +45 -0
- package/src/utils/getBulkdataValue.test.js +105 -0
- package/src/utils/getDirectURL.test.ts +207 -0
- package/src/utils/getDirectURL.ts +65 -0
- package/src/utils/getSRSeriesAndInstanceNumber.js +48 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/layerConfigurationUtils.ts +202 -0
- package/src/utils/promptLabelAnnotation.js +47 -0
- package/src/utils/promptSaveReport.test.ts +106 -0
- package/src/utils/promptSaveReport.tsx +117 -0
- package/src/utils/registerNaturalizedDatasetForLocalWadouri.js +146 -0
- package/src/utils/registerNaturalizedDatasetForLocalWadouri.test.js +177 -0
- package/src/utils/registerStoredInstanceImageId.test.ts +73 -0
- package/src/utils/registerStoredInstanceImageId.ts +66 -0
- package/src/utils/reuseCachedLayouts.ts +92 -0
- package/src/utils/secureConfigFetch.js +115 -0
- package/src/utils/secureConfigFetch.test.js +163 -0
- package/src/utils/seriesDescriptionHistory.ts +83 -0
- package/src/utils/validations/areAllImageComponentsEqual.ts +24 -0
- package/src/utils/validations/areAllImageDimensionsEqual.test.ts +41 -0
- package/src/utils/validations/areAllImageDimensionsEqual.ts +27 -0
- package/src/utils/validations/areAllImagePositionsEqual.ts +75 -0
- package/src/utils/validations/areAllImageSpacingEqual.ts +66 -0
- package/src/utils/validations/checkMultiframe.ts +25 -0
- 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,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,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,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,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,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
|
+
};
|