[OHIF-Viewers]医疗数字阅片-医学影像-Module: Panel-自定义面板-上
[OHIF-Viewers]医疗数字阅片-医学影像-Module: Panel-自定义面板-上
https://docs.ohif.org/extensions/modules/panel.html
Module: Panel
An extension can register a Panel Module by defining a getPanelModule
method. The panel module provides the ability to define menuOptions
and components
that can be used by the consuming application. components
are React Components that can be displayed in the consuming application's "Panel" Component.
The menuOptions
's target
key points to a registered components
's id
. A defaultContext
is applied to all menuOption
s; however, each menuOption
can optional provide it's own context
value.
The getPanelModule
receives an object containing the ExtensionManager
's associated ServicesManager
and CommandsManager
.
import MyComponent from './MyComponent.js'; export default { id: 'example-panel-module', /** * @param {object} params * @param {ServicesManager} params.servicesManager * @param {CommandsManager} params.commandsManager */ getPanelModule({ servicesManager, commandsManager }) { return { menuOptions: [ { // A suggested icon // Available icons determined by consuming app icon: 'list', // A suggested label label: 'Magic', // 'right' or 'left' from: 'right', // The target component to toggle open/close target: 'target-component-id', // UI Hint; If the target panel is in a "disabled" state isDisabled: studies => { return false; }, // Overrides `defaultContext`, if specified context: ['ACTIVE_VIEWPORT:MAGIC'], }, ], components: [ { id: 'target-component-id', component: MyComponent, }, ], defaultContext: ['ROUTE:VIEWER'], }; }, };
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步