<commit_before># Tool States

Each CornerstoneTool can be in one of four states: **disabled, enabled, active, passive**. You can see a quick demo of these states in action in [this codepen](https://codepen.io/dannyrb/full/GyjEqW/).

You set the state per tool, per [enabled element](./../api/enable-element.md). That means you can have multiple enabled canvases displaying images, with a different set of tools active in each.

> Note: examples below use a "mouseButtonTool". The API may differ slightly for tools with a different flavor of input (ie. touch tools)

### Disabled (default)

This is the default state for all tools. Tools that are disabled cannot be intereacted with and are not rendered on the enabled element.

```js
const enabledElement = document.querySelector('.my-cornerstone-canvas')

// Ex. cornerstoneTools.toolName.disable(enabledElement)
// Disables the length tool, not rendered, and cannot be interacted with
cornerstoneTools.length.disable(enabledElement)
```<commit_msg>Add second example<commit_after># Tool States

Each CornerstoneTool can be in one of four states: **disabled, enabled, active, passive**. You can see a quick demo of these states in action in [this codepen](https://codepen.io/dannyrb/full/GyjEqW/), or in the [pixel probe example](https://rawgit.com/chafey/cornerstoneTools/master/examples/probe/index.html).

You set the state per tool, per [enabled element](./../api/enable-element.md). That means you can have multiple enabled canvases displaying images, with a different set of tools active in each.

> Note: examples below use a "mouseButtonTool". The API may differ slightly for tools with a different flavor of input (ie. touch tools)

### Disabled (default)

This is the default state for all tools. Tools that are disabled cannot be intereacted with and are not rendered on the enabled element.

```js
const enabledElement = document.querySelector('.my-cornerstone-canvas')

// Ex. cornerstoneTools.toolName.disable(enabledElement)
// Disables the length tool, not rendered, and cannot be interacted with
cornerstoneTools.length.disable(enabledElement)
```
{'fraction_non_alphanumeric': 0.08983451536643026, 'fraction_numerical': 0.0, 'mean_word_length': 4.8292011019283745, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6790206', 'n_tokens_mistral': 568, 'n_tokens_neox': 555, 'n_words': 260}