Adjust Window Level Tool disabled

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

You can check if you modify enabled actions in the view. 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.

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)

I suspect this is related to this issue. See Calling vtkMRMLSliceViewInteractorStyle::SetActionEnabled systematically disable SetCursorPosition · Issue #5175 · Slicer/Slicer · GitHub

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