feat(customization): new customization service api (#4688)

This commit is contained in:
Alireza authored and GitHub committed 2025-01-23 14:24:13 -05:00
1 parent fab52808cb
commit 55ad8efbab
124 files changed
+4261 -2517

No files matched your search

-69
View File
@@ -1,69 +0,0 @@
import React from 'react';
import {
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuSeparator,
DropdownMenuSub,
DropdownMenuSubContent,
DropdownMenuSubTrigger,
DropdownMenuPortal,
DropdownMenuLabel,
Icons,
} from '@ohif/ui-next';
export const performCustomizations = customizationService => {
// Set the custom SegmentationTable
customizationService.addModeCustomizations([
// To disable editing in the SegmentationTable
{
id: 'PanelSegmentation.disableEditing',
disableEditing: true,
},
// to only show current study in the panel study browser
// {
// id: 'PanelStudyBrowser.studyMode',
// mode: 'primary',
// },
// To disable editing in the MeasurementTable
// {
// id: 'PanelMeasurement.disableEditing',
// disableEditing: true,
// },
// {
// id: 'measurementLabels',
// labelOnMeasure: true,
// exclusive: true,
// items: [
// { value: 'Head', label: 'Head' },
// { value: 'Shoulder', label: 'Shoulder' },
// { value: 'Knee', label: 'Knee' },
// { value: 'Toe', label: 'Toe' },
// ],
// },
/**
* Custom Dropdown Menu Item
*/
// {
// id: 'PanelSegmentation.CustomDropdownMenuContent',
// content: ({
// activeSegmentation,
// onSegmentationAdd,
// onSegmentationRemoveFromViewport,
// onSegmentationEdit,
// onSegmentationDelete,
// allowExport,
// storeSegmentation,
// onSegmentationDownload,
// onSegmentationDownloadRTSS,
// t,
// }) => (
// <DropdownMenuContent align="start">
// <DropdownMenuItem onClick={() => onSegmentationDelete(activeSegmentation.id)}>
// <Icons.Delete className="text-red-600" />
// <span className="pl-2 text-red-600">{t('My Custom Dropdown Menu Item')}</span>
// </DropdownMenuItem>
// </DropdownMenuContent>
// ),
// },
]);
};
-4
View File
@@ -4,7 +4,6 @@ import { id } from './id';
import initToolGroups from './initToolGroups';
import toolbarButtons from './toolbarButtons';
import moreTools from './moreTools';
import { performCustomizations } from './customizations';
// Allow this mode by excluding non-imaging modalities such as SR, SEG
// Also, SM is not a simple imaging modalities, so exclude it.
@@ -89,15 +88,12 @@ function modeFactory({ modeConfiguration }) {
measurementService,
toolbarService,
toolGroupService,
customizationService,
panelService,
segmentationService,
} = servicesManager.services;
measurementService.clearMeasurements();
performCustomizations(customizationService);
// Init Default and SR ToolGroups
initToolGroups(extensionManager, toolGroupService, commandsManager, this.labelConfig);