def __init__(self, module_manager): SimpleVTKClassModuleBase.__init__( self, module_manager, vtk.vtkImageSobel3D(), 'Processing.', ('vtkImageData',), ('vtkImageData',), replaceDoc=True, inputFunctions=None, outputFunctions=None)
def __init__(self): """ Initialization """ MorphologicalFilter.__init__(self) self.vtkfilter = vtk.vtkImageSobel3D() self.vtkfilter.AddObserver('ProgressEvent', lib.messenger.send) lib.messenger.connect(self.vtkfilter, "ProgressEvent", self.updateProgress) self.filterDesc = "Applies Sobel operator for each pixel/voxel\nInput: Grayscale image\nOutput: Vector image"
def __init__(self, module_manager): SimpleVTKClassModuleBase.__init__(self, module_manager, vtk.vtkImageSobel3D(), 'Processing.', ('vtkImageData', ), ('vtkImageData', ), replaceDoc=True, inputFunctions=None, outputFunctions=None)
#!/usr/bin/env python import vtk from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # This script is for testing the 3D Sobel filter. # Displays the 3 components using color. # Image pipeline reader = vtk.vtkImageReader() reader.ReleaseDataFlagOff() reader.SetDataByteOrderToLittleEndian() reader.SetDataExtent(0, 63, 0, 63, 1, 93) reader.SetDataSpacing(3.2, 3.2, 1.5) reader.SetFilePrefix("" + str(VTK_DATA_ROOT) + "/Data/headsq/quarter") reader.SetDataMask(0x7fff) sobel = vtk.vtkImageSobel3D() sobel.SetInputConnection(reader.GetOutputPort()) sobel.ReleaseDataFlagOff() viewer = vtk.vtkImageViewer() #viewer DebugOn viewer.SetInputConnection(sobel.GetOutputPort()) viewer.SetZSlice(22) viewer.SetColorWindow(400) viewer.SetColorLevel(0) viewer.Render() # --- end of script --
#!/usr/bin/env python import vtk from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # This script is for testing the 3D Sobel filter. # Displays the 3 components using color. # Image pipeline reader = vtk.vtkImageReader() reader.ReleaseDataFlagOff() reader.SetDataByteOrderToLittleEndian() reader.SetDataExtent(0,63,0,63,1,93) reader.SetDataSpacing(3.2,3.2,1.5) reader.SetFilePrefix("" + str(VTK_DATA_ROOT) + "/Data/headsq/quarter") reader.SetDataMask(0x7fff) sobel = vtk.vtkImageSobel3D() sobel.SetInputConnection(reader.GetOutputPort()) sobel.ReleaseDataFlagOff() viewer = vtk.vtkImageViewer() #viewer DebugOn viewer.SetInputConnection(sobel.GetOutputPort()) viewer.SetZSlice(22) viewer.SetColorWindow(400) viewer.SetColorLevel(0) viewer.Render() # --- end of script --