Hello,
I am trying to add a few my own cornorstone-based tools into OHIF, but it turns out that the Cornorstone in OHIF is in a packaged status, and I have no idea how to deal with that. So what shall I do if I want to modify the tools in OHIF?
Looking forward to your reply!
The core team can probably answer this question better. But I hope this example can help with modifying csTool in the confine of its extension capabilities.
Let's say you want to change the default wwwcTool window leveling strategy. You can do the following
const appConfig = {
cornerstoneExtensionConfig: {
tools: {
Wwwc: wwwcToolConfig
}
}
}
where key (Wwwc here) must match the name of the tool.
const wwwcToolConfig = {
defaultStrategy: myLevelingStrategy.name,
strategies: { myLevelingStrategy }
}
function myLevelingStrategy(evt) {
.... code of my strategy.
}
See the wwwc tool basicLevelingStrategy implemented in cornerstoneTool.
The strategies object will be merged and contain both basic and my leveling strategy. Setting the defaultStrategy will tell the tool which strategy to apply when user W/L.
On the other hand, the tools seems to be added in the init.js of extensions/cornerstone extension.
If you are working in your own fork/branch, then perhaps create your own tools and add them to the list?
Thank you for your help! I tried and it seems worked!
Most helpful comment
Thank you for your help! I tried and it seems worked!