This is my code
colors = vtk.vtkImageMapToWindowLevelColors()
colors.SetInputConnection(reslice.GetOutputPort())
colors.SetWindow(auto_w)
colors.SetLevel(auto_l)
imageActor = vtk.vtkImageActor()
imageActor.GetMapper().SetInputConnection(colors.GetOutputPort())
####
lut2 = vtk.vtkLookupTable()
lut2.SetTableRange(reader2.GetOutput().GetScalarRange())
lut2.SetNumberOfColors(2)
lut2.Build()
lut2.SetTableValue(0, 0.0, 0.0, 0.0, 1.0)
lut2.SetTableValue(1, 1.0, 0.0, 0.0, 1.0)
mapper2 = vtk.vtkImageMapToColors()
mapper2.SetLookupTable(lut2)
mapper2.SetInputConnection(reslice2.GetOutputPort())
mapper2.Update()
vesselActor = vtk.vtkImageActor()
vesselActor.GetMapper().SetInputConnection(mapper2.GetOutputPort())
ren = vtk.vtkRenderer()
# ren.SetBackground(0, 0, 0)
ren.AddViewProp(imageActor)
ren.AddViewProp(vesselActor)
when I adjusted the image window width and level, the red part will change. How do I keep the red areas the same color?
Original Image
After changing