# Turning off mouse adjustment of contrast and brightness

**URL:** https://discourse.slicer.org/t/turning-off-mouse-adjustment-of-contrast-and-brightness/596
**Category:** Support
**Tags:** feature
**Created:** [June 29, 2017, 2:19pm UTC](https://discourse.slicer.org/t/turning-off-mouse-adjustment-of-contrast-and-brightness/596 "2017-06-29T14:19:20Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![bobread](https://avatars.discourse-cdn.com/v4/letter/b/8797f3/32.png) [@bobread](https://discourse.slicer.org/u/bobread)
#### Post date: [June 29, 2017, 2:19pm UTC](https://discourse.slicer.org/t/turning-off-mouse-adjustment-of-contrast-and-brightness/596/1 "2017-06-29T14:19:20Z")

</div>

Is it possible to turn off the left mouse button adjustment of contrast and brightness in the Segment Editor? When manually painting a segment I keep accidentally changing the values and it is driving me up the wall!

---

<div class="post-metadata">

### Author: ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)
#### Post date: [June 29, 2017, 3:48pm UTC](https://discourse.slicer.org/t/turning-off-mouse-adjustment-of-contrast-and-brightness/596/2 "2017-06-29T15:48:53Z")

</div>

This would indeed be a very useful feature to be able to “lock” window/level for a given volume, but I don’t think it is possible right now, unfortunately.

---

<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: [June 29, 2017, 4:09pm UTC](https://discourse.slicer.org/t/turning-off-mouse-adjustment-of-contrast-and-brightness/596/3 "2017-06-29T16:09:45Z")

</div>

We’ve added this recently to the nightly version. See [https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Disable\_certain\_user\_interactions\_in\_slice\_views](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Disable_certain_user_interactions_in_slice_views)

Currently there is no graphical user interface to activate this, so you have to write 2-3 lines of Python code (get list of slice views from the layout manager, iterate through all of them and disable interactions that you don’t need).

---

<div class="post-metadata">

### Author: ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)
#### Post date: [June 29, 2017, 4:12pm UTC](https://discourse.slicer.org/t/turning-off-mouse-adjustment-of-contrast-and-brightness/596/4 "2017-06-29T16:12:29Z")

</div>

> [@lassoan](#):
>
> We’ve added this recently to the nightly version

Excellent news! I think this deserves an announcement, unless I missed it. Thank you!

---

<div class="post-metadata">

### Author: ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)
#### Post date: [June 29, 2017, 4:32pm UTC](https://discourse.slicer.org/t/turning-off-mouse-adjustment-of-contrast-and-brightness/596/5 "2017-06-29T16:32:39Z")

</div>

I have to say that for some of the use cases I have in mind, it would be a lot more convenient to toggle these properties (or at least w/l) on the volume node, not for individual viewers.

---

<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: [June 30, 2017, 1:20pm UTC](https://discourse.slicer.org/t/turning-off-mouse-adjustment-of-contrast-and-brightness/596/6 "2017-06-30T13:20:32Z")

</div>

I agree that locking W/L of volume display nodes could be useful, too. Ultimately, I think the most useful would be to have better mouse mode management (so that you could choose the mouse drag-and-drop to do nothing).

Do you have a specific use case where per-volume W/L locking would be preferred over disabling W/L adjustment by drag-and-drop in all views?

---

<div class="post-metadata">

### Author: ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)
#### Post date: [June 30, 2017, 2:06pm UTC](https://discourse.slicer.org/t/turning-off-mouse-adjustment-of-contrast-and-brightness/596/7 "2017-06-30T14:06:52Z")

</div>

> [@lassoan](#):
>
> Do you have a specific use case where per-volume W/L locking would be preferred over disabling W/L adjustment by drag-and-drop in all views?

Yes, I do!

In one of our use cases, we do Standardized Uptake Value (SUV) correction for the PET data. While viewing SUV images, since the measurements are more or less normalized, W/L is fixed for the given tracer at certain level. It should never be changed while reviewing the data. Here is the code in the plugin that sets W/L based on the tracer for an SUV volume loaded:

> <https://github.com/QIICR/Slicer-PETDICOMExtension/blob/master/DICOMRWVMPlugin/DICOMRWVMPlugin.py#L270-L281>

As you understand, it will be quite cumbersome to keep W/L settings fixed with the current functionality. But I still think it is better than nothing, and I definitely understand there are situations where it is important and convenient to keep W/L fixed on a per-viewer basis.

---

<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: [July 1, 2017, 12:03am UTC](https://discourse.slicer.org/t/turning-off-mouse-adjustment-of-contrast-and-brightness/596/8 "2017-07-01T00:03:19Z")

</div>

I’ve added window/level locking in Volumes module (r26142). It’ll available in tomorrow’s nightly build. Let me know if you have any comments or suggestions.

---

<div class="post-metadata">

### Author: ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)
#### Post date: [July 2, 2017, 8:09pm UTC](https://discourse.slicer.org/t/turning-off-mouse-adjustment-of-contrast-and-brightness/596/9 "2017-07-02T20:09:26Z")

</div>

Thanks a lot @lassoan! It works as expected, and I made a PR to leverage this feature in the PET SUV DICOM plugin: [https://github.com/QIICR/Slicer-PETDICOMExtension/pull/6](https://github.com/QIICR/Slicer-PETDICOMExtension/pull/6).

I believe this feature will be very useful for quantitative imaging applications! 👍

---

<div class="post-metadata">

### Author: ![Joshua\_Broder](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@Joshua\_Broder](https://discourse.slicer.org/u/Joshua_Broder)
#### Post date: [February 21, 2020, 3:38pm UTC](https://discourse.slicer.org/t/turning-off-mouse-adjustment-of-contrast-and-brightness/596/10 "2020-02-21T15:38:40Z")

</div>

I seem to have lost the ability to adjust brightness and contrast in the planar views in the current stable release (4.10.2, reision 28257) and the nightly build (4.11.0, revision 28783). I see the discussion about intentionally locking these, but is there a way to unlock these (as the default)? This is crucial fundamental feature. Thanks!

I’m running Windows 10.

Josh

---

<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: [February 21, 2020, 3:47pm UTC](https://discourse.slicer.org/t/turning-off-mouse-adjustment-of-contrast-and-brightness/596/11 "2020-02-21T15:47:02Z")

</div>

This should help: [Adjust Window Level is not working (nightly release 4.11.0)](https://discourse.slicer.org/t/adjust-window-level-is-not-working-nightly-release-4-11-0/6817/3). If you have any remaining questions then let us know.

We plan to add mouse mode selection to right-click menu so that you don’t need to move the mouse to the toolbar.
