def __init__(self, module_manager): ModuleBase.__init__(self, module_manager) self._imageBorderMask = vtkdevide.vtkImageBorderMask() # input image value for border self._imageBorderMask.SetBorderMode(1) # maximum of output for interior self._imageBorderMask.SetInteriorMode(3) self._imageGreyReconstruct = vtkdevide.vtkImageGreyscaleReconstruct3D() # we're going to use the dual, instead of inverting mask and image, # performing greyscale reconstruction, and then inverting the result # again. (we should compare results though) self._imageGreyReconstruct.SetDual(1) # marker J is second input self._imageGreyReconstruct.SetInput(1, self._imageBorderMask.GetOutput()) module_utils.setup_vtk_object_progress(self, self._imageBorderMask, 'Creating image mask.') module_utils.setup_vtk_object_progress(self, self._imageGreyReconstruct, 'Performing reconstruction.') self._config.holesTouchEdges = (0, 0, 0, 0, 0, 0) configList = [ ('Allow holes to touch edges:', 'holesTouchEdges', 'tuple:int,6', 'text', 'Indicate which edges (minX, maxX, minY, maxY, minZ, maxZ) may\n' 'be touched by holes. In other words, a hole touching such an\n' 'edge will not be considered background and will be filled.') ] ScriptedConfigModuleMixin.__init__( self, configList, { 'Module (self)': self, 'vtkImageBorderMask': self._imageBorderMask, 'vtkImageGreyReconstruct': self._imageGreyReconstruct }) self.sync_module_logic_with_config()
def __init__(self, module_manager): ModuleBase.__init__(self, module_manager) self._imageBorderMask = vtkdevide.vtkImageBorderMask() # input image value for border self._imageBorderMask.SetBorderMode(1) # maximum of output for interior self._imageBorderMask.SetInteriorMode(3) self._imageGreyReconstruct = vtkdevide.vtkImageGreyscaleReconstruct3D() # we're going to use the dual, instead of inverting mask and image, # performing greyscale reconstruction, and then inverting the result # again. (we should compare results though) self._imageGreyReconstruct.SetDual(1) # marker J is second input self._imageGreyReconstruct.SetInput( 1, self._imageBorderMask.GetOutput()) module_utils.setup_vtk_object_progress(self, self._imageBorderMask, 'Creating image mask.') module_utils.setup_vtk_object_progress(self, self._imageGreyReconstruct, 'Performing reconstruction.') self._config.holesTouchEdges = (0,0,0,0,0,0) configList = [ ('Allow holes to touch edges:', 'holesTouchEdges', 'tuple:int,6', 'text', 'Indicate which edges (minX, maxX, minY, maxY, minZ, maxZ) may\n' 'be touched by holes. In other words, a hole touching such an\n' 'edge will not be considered background and will be filled.') ] ScriptedConfigModuleMixin.__init__( self, configList, {'Module (self)' : self, 'vtkImageBorderMask' : self._imageBorderMask, 'vtkImageGreyReconstruct' : self._imageGreyReconstruct}) self.sync_module_logic_with_config()
def __init__(self, module_manager): simpleVTKClassModuleBase.__init__( self, module_manager, vtkdevide.vtkImageBorderMask(), 'Creating border mask.', ('VTK Image Data',), ('Border Mask (vtkImageData)',))