Open the studies and segmentation sidepanels by clicking respective buttons on the toolbar

I want to open the left and right sidepanels by clicking on respective buttons on the the toolbar instead of the default way. How do I set this up?

  • I tried to add a test configuration to modes\longitudinal\src\toolbarButtons.js to add the toggle button but how do add the command?
  • Currently using v3

Config in toolbarButtons.js

  {
    id: 'Studies',
    type: 'ohif.action',
    props: {
      type: 'toggle',
      icon: 'icon-studies',
      label: 'Studies',
      commands: [
        {
          commandName: 'toggleStudies',
          commandOptions: {},
          context: 'DEFAULT',
        },
      ],
    },
  },

This config does not render the button either.

Thanks for using this community forum.

In order for the button to be added to the longitudinal toolbar, add it to the button section in modes\longitudinal\src\index.js. So something like this maybe…

      toolbarService.createButtonSection('primary', [
        'MeasurementTools',
        'Zoom',
        'WindowLevel',
        'Pan',
        'Capture',
        'Layout',
        'MPR',
        'Crosshairs',
        'MoreTools',
        'Studies'
      ]);

At present, the side panels can only be opened and not closed via the PanelService. However you could adjust PanelService to close a panel too I suppose.

So following your code snippet you posted, in a commandsModule, create a toggleStudies command that uses the PanelService to open the desired panel.

Hope this helps.