fix(studyBrowserCustomization): fix thumbnail menu item actions in study browser (#5283)
This commit is contained in:
parent
e04310a02d
commit
2f28a0deab
@ -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;
|
||||
|
||||
@ -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': [
|
||||
|
||||
Loading…
Reference in New Issue
Block a user