Open jlopes90 opened 1 year ago
I found an example here: https://www.cornerstonejs.org/live-examples/modifierkeys
But there is a small problem: the circle doesn't move and it only paints or erases invisibly.
Here is the code I did like this:
cornerstoneTools.addTool(cornerstoneTools.SegmentationDisplayTool);
cornerstoneTools.addTool(cornerstoneTools.BrushTool);
const toolGroup = cornerstoneTools.ToolGroupManager.createToolGroup(toolGroupId);
toolGroup.addTool(cornerstoneTools.SegmentationDisplayTool.toolName);
toolGroup.addToolInstance(
"CircularBrush",
cornerstoneTools.BrushTool.toolName,
{
activeStrategy: "FILL_INSIDE_CIRCLE",
}
);
toolGroup.addToolInstance(
"CircularEraser",
cornerstoneTools.BrushTool.toolName,
{
activeStrategy: "ERASE_INSIDE_CIRCLE",
}
);
toolGroup.setToolActive("CircularBrush", {
bindings: [
{
mouseButton: cornerstoneTools.Enums.MouseBindings.Primary // Left Click
}
],
});
toolGroup.setToolActive("CircularEraser", {
bindings: [
{
mouseButton: cornerstoneTools.Enums.MouseBindings.Primary, // Left Click
modifierKey: cornerstoneTools.Enums.KeyboardBindings.Ctrl
}
],
});
Hmmm, that might be a bug that we have, thanks for the report
It's possible? For example, I created a "keydown" event when clicking "control" and it ends up changing to "Circular Eraser" but it doesn't seem to be working. When I click "control" the brush gets stuck and doesn't move or paint.