本文整理汇总了Python中module_mixins.NoConfigModuleMixin类的典型用法代码示例。如果您正苦于以下问题:Python NoConfigModuleMixin类的具体用法?Python NoConfigModuleMixin怎么用?Python NoConfigModuleMixin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NoConfigModuleMixin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
# initialise any mixins we might have
NoConfigModuleMixin.__init__(self)
# we'll be playing around with some vtk objects, this could
# be anything
self._thresh = vtk.vtkThresholdPoints()
# this is wacked syntax!
self._thresh.ThresholdByUpper(1)
self._reconstructionFilter = vtk.vtkSurfaceReconstructionFilter()
self._reconstructionFilter.SetInput(self._thresh.GetOutput())
self._mc = vtk.vtkMarchingCubes()
self._mc.SetInput(self._reconstructionFilter.GetOutput())
self._mc.SetValue(0, 0.0)
module_utils.setup_vtk_object_progress(self, self._thresh,
'Extracting points...')
module_utils.setup_vtk_object_progress(self, self._reconstructionFilter,
'Reconstructing...')
module_utils.setup_vtk_object_progress(self, self._mc,
'Extracting surface...')
self._iObj = self._thresh
self._oObj = self._mc
self._viewFrame = self._createViewFrame({'threshold' :
self._thresh,
'reconstructionFilter' :
self._reconstructionFilter,
'marchingCubes' :
self._mc})
示例2: __init__
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
NoConfigModuleMixin.__init__(self, {'Module (self)': self})
self.sync_module_logic_with_config()
示例3: __init__
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
# what a lame-assed filter, we have to make dummy inputs!
# if we don't have a dummy input (but instead a None input) it
# bitterly complains when we do a GetOutput() (it needs the input
# to know the type of the output) - and GetPolyDataOutput() also
# doesn't work.
# NB: this does mean that our probeFilter NEEDS a PolyData as
# probe geometry!
ss = vtk.vtkSphereSource()
ss.SetRadius(0)
self._dummyInput = ss.GetOutput()
#This is also retarded - we (sometimes, see below) need the "padder"
#to get the image extent big enough to satisfy the probe filter.
#No apparent logical reason, but it throws an exception if we don't.
self._padder = vtk.vtkImageConstantPad()
self._source = None
self._input = None
self._probeFilter = vtk.vtkProbeFilter()
self._probeFilter.SetInput(self._dummyInput)
NoConfigModuleMixin.__init__(
self,
{'Module (self)' : self,
'vtkProbeFilter' : self._probeFilter})
module_utils.setup_vtk_object_progress(self, self._probeFilter,
'Mapping source on input')
self.sync_module_logic_with_config()
示例4: __init__
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
# initialise any mixins we might have
NoConfigModuleMixin.__init__(self)
self._imageReslice = vtk.vtkImageReslice()
self._imageReslice.SetInterpolationModeToCubic()
self._matrixToHT = vtk.vtkMatrixToHomogeneousTransform()
self._matrixToHT.Inverse()
module_utils.setup_vtk_object_progress(self, self._imageReslice,
'Resampling volume')
self._viewFrame = self._createViewFrame(
{'Module (self)' : self,
'vtkImageReslice' : self._imageReslice})
# pass the data down to the underlying logic
self.config_to_logic()
# and all the way up from logic -> config -> view to make sure
self.syncViewWithLogic()
示例5: __init__
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
# we'll be playing around with some vtk objects, this could
# be anything
self._triangleFilter = vtk.vtkTriangleFilter()
self._curvatures = vtk.vtkCurvatures()
self._curvatures.SetCurvatureTypeToMaximum()
self._curvatures.SetInput(self._triangleFilter.GetOutput())
# initialise any mixins we might have
NoConfigModuleMixin.__init__(self,
{'Module (self)' : self,
'vtkTriangleFilter' : self._triangleFilter,
'vtkCurvatures' : self._curvatures})
module_utils.setup_vtk_object_progress(self, self._triangleFilter,
'Triangle filtering...')
module_utils.setup_vtk_object_progress(self, self._curvatures,
'Calculating curvatures...')
self.sync_module_logic_with_config()
示例6: close
def close(self):
# we play it safe... (the graph_editor/module_manager should have
# disconnected us by now)
for input_idx in range(len(self.get_input_descriptions())):
self.set_input(input_idx, None)
# this will take care of all display thingies
NoConfigModuleMixin.close(self)
示例7: close
def close(self):
# disconnect all inputs
self.set_input(0, None)
self.set_input(1, None)
# take care of critical instances
self._outputPolyData = None
# mixin close
NoConfigModuleMixin.close(self)
示例8: close
def close(self):
# we play it safe... (the graph_editor/module_manager should have
# disconnected us by now)
for input_idx in range(len(self.get_input_descriptions())):
self.set_input(input_idx, None)
# don't forget to call the close() method of the vtkPipeline mixin
NoConfigModuleMixin.close(self)
# get rid of our reference
del self._imageReslice
示例9: __init__
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
NoConfigModuleMixin.__init__(
self, {'Module (self)' : self})
self.sync_module_logic_with_config()
self._ir = vtk.vtkImageReslice()
self._ici = vtk.vtkImageChangeInformation()
示例10: close
def close(self):
# we play it safe... (the graph_editor/module_manager should have
# disconnected us by now)
self.set_input(0, None)
self.set_input(1, None)
# don't forget to call the close() method of the vtkPipeline mixin
NoConfigModuleMixin.close(self)
# take out our view interface
del self._imageBacktracker
ModuleBase.close(self)
示例11: close
def close(self):
# we play it safe... (the graph_editor/module_manager should have
# disconnected us by now)
for input_idx in range(len(self.get_input_descriptions())):
self.set_input(input_idx, None)
# this will take care of all display thingies
NoConfigModuleMixin.close(self)
# get rid of our reference
del self._imageGradientStructureTensor
示例12: __init__
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
NoConfigModuleMixin.__init__(self)
# these will be our markers
self._inputPoints = None
# we can't connect the image input directly to the masksource,
# so we have to keep track of it separately.
self._inputImage = None
self._inputImageObserverID = None
# we need to modify the mask (I) as well. The problem with a
# ProgrammableFilter is that you can't request GetOutput() before
# the input has been set...
self._maskSource = vtk.vtkProgrammableSource()
self._maskSource.SetExecuteMethod(self._maskSourceExecute)
# we'll use this to synthesise a volume according to the seed points
self._markerSource = vtk.vtkProgrammableSource()
self._markerSource.SetExecuteMethod(self._markerSourceExecute)
# second input is J (the marker)
# we'll use this to change the markerImage into something we can use
self._imageThreshold = vtk.vtkImageThreshold()
# everything equal to or above 1.0 will be "on"
self._imageThreshold.ThresholdByUpper(1.0)
self._imageThresholdObserverID = self._imageThreshold.AddObserver(
'EndEvent', self._observerImageThreshold)
self._viewFrame = self._createViewFrame(
{'Module (self)' : self})
# we're not going to give imageErode any input... that's going to
# to happen manually in the execute_module function :)
self._imageErode = vtk.vtkImageContinuousErode3D()
self._imageErode.SetKernelSize(3,3,3)
module_utils.setup_vtk_object_progress(self, self._imageErode,
'Performing greyscale 3D erosion')
self._sup = vtk.vtkImageMathematics()
self._sup.SetOperationToMax()
self._sup.SetInput1(self._imageErode.GetOutput())
self._sup.SetInput2(self._maskSource.GetStructuredPointsOutput())
# pass the data down to the underlying logic
self.config_to_logic()
# and all the way up from logic -> config -> view to make sure
self.syncViewWithLogic()
示例13: __init__
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
self._pdNormals = vtk.vtkPolyDataNormals()
module_utils.setup_vtk_object_progress(self, self._pdNormals,
'Calculating normals')
NoConfigModuleMixin.__init__(
self, {'vtkPolyDataNormals' : self._pdNormals})
self.sync_module_logic_with_config()
示例14: close
def close(self):
# we play it safe... (the graph_editor/module_manager should have
# disconnected us by now)
for input_idx in range(len(self.get_input_descriptions())):
self.set_input(input_idx, None)
# this will take care of all display thingies
NoConfigModuleMixin.close(self)
# and the baseclass close
ModuleBase.close(self)
# remove all bindings
del self._laplacian
示例15: __init__
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
self._transformPolyData = vtk.vtkTransformPolyDataFilter()
NoConfigModuleMixin.__init__(
self, {'vtkTransformPolyDataFilter' : self._transformPolyData})
module_utils.setup_vtk_object_progress(self, self._transformPolyData,
'Transforming geometry')
self.sync_module_logic_with_config()