fix(tool-manager): Instantiate cornerstone tools by element
This commit is contained in:
parent
e947f1fad0
commit
635c8b9119
@ -278,7 +278,7 @@ const loadDisplaySetIntoViewport = (data, templateData) => {
|
||||
}
|
||||
|
||||
// Instantiate the tools
|
||||
toolManager.instantiateTools();
|
||||
toolManager.instantiateTools(element);
|
||||
|
||||
// Use the tool manager to enable the currently active tool for this
|
||||
// newly rendered element
|
||||
|
||||
@ -173,12 +173,12 @@ export const toolManager = {
|
||||
Session.set('ToolManagerActiveToolUpdated', Random.id());
|
||||
},
|
||||
|
||||
instantiateTools() {
|
||||
// Instantiate all cornerstone tools for all enabled elements
|
||||
instantiateTools(element) {
|
||||
// Instantiate all cornerstone tools for the given element
|
||||
Object.keys(tools).forEach(toolName => {
|
||||
const apiTool = cornerstoneTools[tools[toolName]];
|
||||
if (apiTool) {
|
||||
cornerstoneTools.addTool(apiTool, {
|
||||
cornerstoneTools.addToolForElement(element, apiTool, {
|
||||
name: toolName,
|
||||
configuration: defaultToolConfig
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user