Recent improvements in window/level management

This is a quick summary of image window/level (brightness/contrast) adjustment changes introduced in recent Slicer Preview (formerly known as “Nightly”) releases.

  1. Improved automatic window/level algorithm

Images that do not contain preferred window/level information are displayed with automatically computed values. The complex automatic computation algorithm that had been used in Slicer worked marginally better for some images, but sometimes generated too bright images and overall the results were somewhat unpredictable.

The algorithm is replaced by a simpler one, which adjust the window to display intensity values between 0.1 and 99.9 percentiles.

  1. Improved manual window/level adjustment

New mouse mode is added for window/level adjustment. This prevents accidental modification of window/level when interacting in slice views and allows new window/level adjustment methods. Click on the corresponding icon on the toolbar to activate the new mode. The icon consists of color and grayscale gradients and a mouse pointer:


Window/level setting options:

  • Click-and-drag adjusts window/level (same as before)
  • Ctrl + left-click-and-drag sets optimal window/level for the selected region. Pressing Escape or right-click during the drag cancels the operation.
  • Double-click resets window/level (using automatic window/level algorithm, for the entire image)

Region-based auto window/level example:

Demo video:


Could there be an option in settings to enable windowing using the normal mouse cursor as well? working with multiple series and needing to change windows on the go is awkward, i guess for people who are familiar with slicer this will be a bigger bother than of the window accidentally changing, unless there is a planned better use of the regular left click.

If you find that you need to modify window/level of multiple volumes then you can keep the mouse mode in window/level mode. You can still pan, zoom, browse slices, etc. and adjust window/level with left-click-and-drag the same way as before.

Also, we plan to make it easier to switch between mouse modes (using right-click context menu and keyboard shortcuts).

1 Like

Thanks, keyboard shortcuts would be fine, the issue was more prominent when using segment editor as clicking “none” tool or Esc key disables the windowing mouse, and there is a need to switch back and forth when tweaking the window multiple times

A post was split to a new topic: How to change window/level programmatically

works great, thank you

Hi, when I load DICOM series, 3D slicer uses the Window/level found in DICOM tags. However, DICOM series come with a lot of files, it seems 3D slicer uses the DICOM tag found in the first slice. While ITK-SNAP uses the last slice’s DICOM tag. ITK-SNAP usually gives me a better display result. Not sure the window level found in DICOM tags is set by doctor or the machine?

Have you found any reference in ITK-Snap source code that it uses window center&width stored in the DICOM file at all? (I have not, but I’m not that familiar with its source code) Maybe it just applies histogram-based auto-brightness/contrast.

Can you check if ITK-Snap’s brightness/contrast for DICOM files is the same (or similar to) Slicer’s auto brightness/contrast (that you get when you double-click on the image when the mouse mode is Window/level adjustment mode)?

It’s true that choosing to use the first slice’s window center/width is arbitrary, but I would expect that the last slice’s window would be just as bad. Maybe we could consider using a slice near the center of the image, as it may be more representative of content clinicians are most interested in.

Check these screenshots:

3D Slicer with auto brightness/contrast

Maybe you’re right, we could consider using the middle slice’s DICOM tag.

I haven’t encountered a case when window/level was drastically different in first/middle slice. If this is the case for this data set then it would be great to have it for testing.

Is this from a public image database? If not, could you anonymize and share it? (you can send me the download link in a private message)

I’ve added an issue to keep track of this issue and potential fix:

I’m so sorry. The data is from a hospital. We have no permission to share it even after anonymize it.