Add shortcut to adjust window/level in any mouse mode python script not working

I am trying to use this python script for Brightness/contrast shortcut but it gives me error . Can someone help me

Traceback (most recent call last):
File “”, line 1, in
AttributeError: ‘MRMLDisplayableManagerPython.vtkMRMLScalarBarDispl’ object has no attribute ‘GetWindowLevelWidget’

discourse 1

You need to use a recent Slicer Preview Release for this.

For reference, the complete example that allows using Ctrl+Right-click-and-drag for adjusting window/level in Red slice view is available here.

1 Like