# Custom window/level presets

**URL:** <https://discourse.slicer.org/t/custom-window-level-presets/5051>\
**Category:** Feature requests\
**Created:** [December 11, 2018, 11:49pm UTC](https://discourse.slicer.org/t/custom-window-level-presets/5051 "2018-12-11T23:49:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![emckenzi123](https://avatars.discourse-cdn.com/v4/letter/e/f6c823/32.png) [@emckenzi123](https://discourse.slicer.org/u/emckenzi123)\
**Post date:** [December 11, 2018, 11:49pm UTC](https://discourse.slicer.org/t/custom-window-level-presets/5051/1 "2018-12-11T23:49:24Z")

</div>

Hello,

I often import many images of the same type, and they all should be the same window/level which I would like to set (when Slicer loads them they are washed out with the auto W/L). It is very tedious to go through each one on the Volumes module and type in the appropriate window and level value for each image. Is there a way I could customize a preset window/level setting? Or maybe just change a bunch of them at the same time? I welcome GUI or programmatic advice.

~E

---

<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:** [December 12, 2018, 12:00am UTC](https://discourse.slicer.org/t/custom-window-level-presets/5051/2 "2018-12-12T00:00:12Z")

</div>

You can set default window/level settings like this (the example sets minimum/maximum to 30/60):

```auto
defaultVolumeDisplayNode = slicer.mrmlScene.CreateNodeByClass("vtkMRMLScalarVolumeDisplayNode")
defaultVolumeDisplayNode.AutoWindowLevelOff()
defaultVolumeDisplayNode.SetWindowLevelMinMax(30,60)
slicer.mrmlScene.AddDefaultNode(defaultVolumeDisplayNode)

```

You can add this code snippet to your [.slicerrc.py](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Python_scripting#How_to_systematically_execute_custom_python_code_at_startup_.3F) file to set these defaults persistently.
