cornerstoneTools icon indicating copy to clipboard operation
cornerstoneTools copied to clipboard

Clear brush data invalid

Open xiaoxiao5 opened this issue 4 years ago • 2 comments

cornerstoneTools.clearToolState(element, "Brush");

xiaoxiao5 avatar Oct 22 '21 07:10 xiaoxiao5

cornerstoneTools.addToolState is also invalid

xiaoxiao5 avatar Oct 22 '21 10:10 xiaoxiao5

To solve this issue, you can use the clearToolState function. You have several examples and issues concerning this problem, that you may follow. However, it seems a good option to use the clearToolState function in your case. The clearToolState function will remove all states from the state manager corresponding to the name and element of that tool.

Indeed, the documentation describes the clearToolState function as:

Removes all toolState from the toolStateManager corresponding to the toolName and element.

It is also important to understand how does the cornerstoneTool store its values. Additionally, you can also follow similar answers when using a new tool or function.

FMCalisto avatar Mar 14 '23 20:03 FMCalisto