# Adjust Window Level Tool disabled

**URL:** <https://discourse.slicer.org/t/adjust-window-level-tool-disabled/14059>\
**Category:** Development\
**Created:** [October 15, 2020, 5:38pm UTC](https://discourse.slicer.org/t/adjust-window-level-tool-disabled/14059 "2020-10-15T17:38:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohan\_n](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rohan_n/32/78474_2.png) [@rohan\_n](https://discourse.slicer.org/u/rohan_n)\
**Post date:** [October 15, 2020, 5:38pm UTC](https://discourse.slicer.org/t/adjust-window-level-tool-disabled/14059/1 "2020-10-15T17:38:57Z")

</div>

I don’t know why, but for some reason one of the functions in my scripted module disables the ability of the user to use the Adjust Window Level mouse tool on the Red slice. Is there a simple command that re-enables the use of Adjust Window Level tool on the Red slice?  
Thanks,  
Rohan

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 15, 2020, 6:53pm UTC](https://discourse.slicer.org/t/adjust-window-level-tool-disabled/14059/2 "2020-10-15T18:53:27Z")

</div>

You can check if you [modify enabled actions in the view](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Disable_certain_user_interactions_in_slice_views). If you don’t do anything like that then it may be a side effect of some operations, in which case you can comment out/deactivate parts of your code until you find the function that causes this behavior. Let us know what you find.

---

<div class="post-metadata">

**Author:** ![rohan\_n](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rohan_n/32/78474_2.png) [@rohan\_n](https://discourse.slicer.org/u/rohan_n)\
**Post date:** [October 15, 2020, 8:51pm UTC](https://discourse.slicer.org/t/adjust-window-level-tool-disabled/14059/3 "2020-10-15T20:51:03Z")

</div>

Thanks.  
Apparently the lines of code that enable or disable scrolling through slices with the mouse have the unintended effect of disabling the Adjust Window Level tool. I fixed the problem by commenting out lines such as this.

```
  #interactorStyle = slicer.app.layoutManager().sliceWidget('Red').sliceView().sliceViewInteractorStyle()
  #interactorStyle.SetActionEnabled(interactorStyle.BrowseSlice, False)

```

or this

```
  #interactorStyle = slicer.app.layoutManager().sliceWidget('Red').sliceView().sliceViewInteractorStyle()
  #interactorStyle.SetActionEnabled(interactorStyle.BrowseSlice, True)
```

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [October 15, 2020, 8:57pm UTC](https://discourse.slicer.org/t/adjust-window-level-tool-disabled/14059/4 "2020-10-15T20:57:34Z")

</div>

> [@rohan\_n](#):
>
> enable or disable scrolling through slices with the mouse have the unintended effect of disabling the Adjust Window Level tool

I suspect this is related to this issue. See [Calling vtkMRMLSliceViewInteractorStyle::SetActionEnabled systematically disable SetCursorPosition · Issue #5175 · Slicer/Slicer · GitHub](https://github.com/Slicer/Slicer/issues/5175)

If you would like to help address the root cause, the issue report contains enough details to help you move forward the process.
