Dear community,
we are trying to create an extension to integrate a ML app. For the first version, this should be just accomplished through a simple button in the right panel calling a Python script and displaying the results.
However, when we try to develop an extension, we cannot display it in the interface or the DOM.
(prostatecancer.ai is, unfortunately, not feasible for us due to our windows OS and react framework requirements)
What we have followed:
- Created an extension template using the CLI
- Implemented index.tsx and a Panel class
- Linking the extension to the OHIF viewer
Problem:
Luckily, the alert shows up, i.e., the extension is correctly linked. However, we cannot get the “XAIResultsPanel
” running. And, as the documentation has no specific details about OHIF v3 extension, we are unsure how to position our module in the right panel (similar to “segmentation” or “measurements” in the default viewer).
The index.tsx (simplified):
...
import { XAIResultsPanel } from './Panels';
export default {
onModeEnter({ servicesManager }) {
alert("viewer opened")
},
getPanelModule: ({
...
}) => {
const wrappedXAIPanel = () => {
return (
<XAIResultsPanel
commandsManager={commandsManager}
servicesManager={servicesManager}
extensionManager={extensionManager}
/>
)
};
return [
{
name: 'xai-nodule-panel',
iconName: 'th-list',
iconLabel: 'XAI Results',
label: 'XAI Nodule Detection Results',
component: XAIResultsPanel,
defaultContext: ['VIEWER'],
}
]
},
}
The panel’s XAIResultsPanel.tsx (simplified):
import React from 'react';
import { Button, MeasurementTable, Input } from '@ohif/ui';
export default function XAIResultsPanel({ servicesManager, commandsManager, extensionManager }) {
return (
<div>
<Button>Run AI</Button>
</div>
);
}
Do you have any ideas how we get this working?
We highly appreciate any hints.
Thank you so much in advance…
Luis