2025-04-07 16:45:05 -04:00
|
|
|
import { AllInOneMenu } from '@ohif/ui-next';
|
2024-12-17 13:20:19 -05:00
|
|
|
import { Icons } from '@ohif/ui-next';
|
2024-04-02 09:35:30 -04:00
|
|
|
import React, { ReactElement } from 'react';
|
|
|
|
|
import { VolumeRenderingPresetsContent } from './VolumeRenderingPresetsContent';
|
2025-05-05 16:35:05 -04:00
|
|
|
import { useSystem } from '@ohif/core';
|
2025-05-15 12:08:12 -04:00
|
|
|
import { useViewportRendering } from '../../hooks/useViewportRendering';
|
2025-12-12 16:46:56 +01:00
|
|
|
import { useTranslation } from 'react-i18next';
|
2024-04-02 09:35:30 -04:00
|
|
|
|
2025-05-15 12:08:12 -04:00
|
|
|
export function VolumeRenderingPresets({ viewportId }: { viewportId?: string } = {}): ReactElement {
|
|
|
|
|
const { volumeRenderingPresets } = useViewportRendering(viewportId);
|
2025-05-05 16:35:05 -04:00
|
|
|
const { servicesManager } = useSystem();
|
2025-02-28 15:17:55 -05:00
|
|
|
const { uiDialogService } = servicesManager.services;
|
2025-12-12 16:46:56 +01:00
|
|
|
const { t } = useTranslation('WindowLevelActionMenu');
|
2024-04-02 09:35:30 -04:00
|
|
|
|
|
|
|
|
const onClickPresets = () => {
|
2025-02-28 15:17:55 -05:00
|
|
|
uiDialogService.show({
|
|
|
|
|
id: 'volume-rendering-presets',
|
2024-04-02 09:35:30 -04:00
|
|
|
content: VolumeRenderingPresetsContent,
|
2025-12-12 16:46:56 +01:00
|
|
|
title: t('Rendering Presets'),
|
2025-02-28 15:17:55 -05:00
|
|
|
isDraggable: true,
|
2024-04-02 09:35:30 -04:00
|
|
|
contentProps: {
|
|
|
|
|
presets: volumeRenderingPresets,
|
|
|
|
|
viewportId,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<AllInOneMenu.Item
|
2025-12-12 16:46:56 +01:00
|
|
|
label={t('Rendering Presets')}
|
2024-12-17 13:20:19 -05:00
|
|
|
icon={<Icons.VolumeRendering />}
|
|
|
|
|
rightIcon={<Icons.ByName name="action-new-dialog" />}
|
2024-04-02 09:35:30 -04:00
|
|
|
onClick={onClickPresets}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|