fix(studyBrowserCustomization): fix thumbnail menu item actions in study browser (#5283)

This commit is contained in:
ZZzzaaKK 2025-10-02 23:05:45 +02:00 committed by GitHub
parent e04310a02d
commit 2f28a0deab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 20 deletions

View File

@ -65,6 +65,11 @@ const commandsModule = ({
* @param options.removeFirst - Optional flag to remove the display set first if it's already added
*/
addDisplaySetAsLayer: ({ viewportId, displaySetInstanceUID, removeFirst = false }) => {
if (!viewportId) {
const { activeViewportId } = servicesManager.services.viewportGridService.getState();
viewportId = activeViewportId;
}
if (!viewportId || !displaySetInstanceUID) {
console.warn('Missing required parameters for addDisplaySetAsLayer command');
return;

View File

@ -9,31 +9,13 @@ export default {
id: 'tagBrowser',
label: i18n.t('StudyBrowser:Tag Browser'),
iconName: 'DicomTagBrowser',
onClick: ({ commandsManager, displaySetInstanceUID }: withAppTypes) => {
commandsManager.runCommand('openDICOMTagViewer', {
displaySetInstanceUID,
});
},
commands: 'openDICOMTagViewer',
},
{
id: 'addAsLayer',
label: i18n.t('StudyBrowser:Add as Layer'),
iconName: 'ViewportViews',
onClick: ({ commandsManager, displaySetInstanceUID, servicesManager }: withAppTypes) => {
const { viewportGridService } = servicesManager.services;
// Get the active viewport
const { activeViewportId } = viewportGridService.getState();
if (!activeViewportId) {
return;
}
// Use the new command to add the display set as a layer
commandsManager.runCommand('addDisplaySetAsLayer', {
viewportId: activeViewportId,
displaySetInstanceUID,
});
},
commands: 'addDisplaySetAsLayer',
},
],
'studyBrowser.sortFunctions': [