It looks like I also misread your initial question as pertaining to the volume rendering “Shift” slider when you wrote that you were interested in the threshold slider of the Volumes module. My mistake! As @rbumm pointed out, there are very easy ways to set those values. The only thing I would add is that you can get the display node for your volume of interest using GetDisplayNode()
. For example:
volumeName = "MR_Head" # replace with the name of your volume
volNode = getNode(volumeName)
dispNode = volNode.GetDisplayNode()
lowerThreshValue = 100 # for example
upperThreshValue = 500 # for example
dispNode.SetThreshold(lowerThreshValue, upperThreshValue)