def __init__(self, module_manager): SimpleVTKClassModuleBase.__init__( self, module_manager, vtk.vtkImageHSIToRGB(), 'Processing.', ('vtkImageData',), ('vtkImageData',), replaceDoc=True, inputFunctions=None, outputFunctions=None)
def __init__(self, module_manager): SimpleVTKClassModuleBase.__init__(self, module_manager, vtk.vtkImageHSIToRGB(), 'Processing.', ('vtkImageData', ), ('vtkImageData', ), replaceDoc=True, inputFunctions=None, outputFunctions=None)
imageCanvas.SetDrawColor(255,255,255) imageCanvas.FillBox(250,300,110,210) # saturation scale imageCanvas.SetDrawColor(245,0,0) imageCanvas.FillBox(0,50,220,320) imageCanvas.SetDrawColor(213,16,16) imageCanvas.FillBox(50,100,220,320) imageCanvas.SetDrawColor(181,32,32) imageCanvas.FillBox(100,150,220,320) imageCanvas.SetDrawColor(149,48,48) imageCanvas.FillBox(150,200,220,320) imageCanvas.SetDrawColor(117,64,64) imageCanvas.FillBox(200,250,220,320) imageCanvas.SetDrawColor(85,80,80) imageCanvas.FillBox(250,300,220,320) convert = vtk.vtkImageRGBToHSI() convert.SetInputConnection(imageCanvas.GetOutputPort()) convertBack = vtk.vtkImageHSIToRGB() convertBack.SetInputConnection(convert.GetOutputPort()) cast = vtk.vtkImageCast() cast.SetInputConnection(convertBack.GetOutputPort()) cast.SetOutputScalarTypeToFloat() cast.ReleaseDataFlagOff() viewer = vtk.vtkImageViewer() viewer.SetInputConnection(convertBack.GetOutputPort()) #viewer SetInputConnection [imageCanvas GetOutputPort] viewer.SetColorWindow(256) viewer.SetColorLevel(127.5) viewer.Render() # --- end of script --
imageCanvas.SetDrawColor(255, 255, 255) imageCanvas.FillBox(250, 300, 110, 210) # saturation scale imageCanvas.SetDrawColor(245, 0, 0) imageCanvas.FillBox(0, 50, 220, 320) imageCanvas.SetDrawColor(213, 16, 16) imageCanvas.FillBox(50, 100, 220, 320) imageCanvas.SetDrawColor(181, 32, 32) imageCanvas.FillBox(100, 150, 220, 320) imageCanvas.SetDrawColor(149, 48, 48) imageCanvas.FillBox(150, 200, 220, 320) imageCanvas.SetDrawColor(117, 64, 64) imageCanvas.FillBox(200, 250, 220, 320) imageCanvas.SetDrawColor(85, 80, 80) imageCanvas.FillBox(250, 300, 220, 320) convert = vtk.vtkImageRGBToHSI() convert.SetInputConnection(imageCanvas.GetOutputPort()) convertBack = vtk.vtkImageHSIToRGB() convertBack.SetInputConnection(convert.GetOutputPort()) cast = vtk.vtkImageCast() cast.SetInputConnection(convertBack.GetOutputPort()) cast.SetOutputScalarTypeToFloat() cast.ReleaseDataFlagOff() viewer = vtk.vtkImageViewer() viewer.SetInputConnection(convertBack.GetOutputPort()) #viewer SetInputConnection [imageCanvas GetOutputPort] viewer.SetColorWindow(256) viewer.SetColorLevel(127.5) viewer.Render() # --- end of script --