Custom window/level presets

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

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

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 file to set these defaults persistently.

1 Like