// Get access to the display info for each channel
def viewer = getCurrentViewer()
def channels = viewer.getImageDisplay().getAvailableChannels()
// Set the range for the first two channels
channels[0].setMinDisplay(0)
channels[0].setMaxDisplay(100)
channels[1].setMinDisplay(0)
channels[1].setMaxDisplay(500)
// Ensure the updates are visible
viewer.repaintEntireImage()
// Usually a good idea to print something, so we know it finished
print 'Done!'