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
|
// Instantiate the tools
|
||||||
toolManager.instantiateTools();
|
toolManager.instantiateTools(element);
|
||||||
|
|
||||||
// Use the tool manager to enable the currently active tool for this
|
// Use the tool manager to enable the currently active tool for this
|
||||||
// newly rendered element
|
// newly rendered element
|
||||||
|
|||||||
@ -173,12 +173,12 @@ export const toolManager = {
|
|||||||
Session.set('ToolManagerActiveToolUpdated', Random.id());
|
Session.set('ToolManagerActiveToolUpdated', Random.id());
|
||||||
},
|
},
|
||||||
|
|
||||||
instantiateTools() {
|
instantiateTools(element) {
|
||||||
// Instantiate all cornerstone tools for all enabled elements
|
// Instantiate all cornerstone tools for the given element
|
||||||
Object.keys(tools).forEach(toolName => {
|
Object.keys(tools).forEach(toolName => {
|
||||||
const apiTool = cornerstoneTools[tools[toolName]];
|
const apiTool = cornerstoneTools[tools[toolName]];
|
||||||
if (apiTool) {
|
if (apiTool) {
|
||||||
cornerstoneTools.addTool(apiTool, {
|
cornerstoneTools.addToolForElement(element, apiTool, {
|
||||||
name: toolName,
|
name: toolName,
|
||||||
configuration: defaultToolConfig
|
configuration: defaultToolConfig
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user