本文整理汇总了Python中module_mixins.NoConfigModuleMixin.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python NoConfigModuleMixin.__init__方法的具体用法?Python NoConfigModuleMixin.__init__怎么用?Python NoConfigModuleMixin.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类module_mixins.NoConfigModuleMixin
的用法示例。
在下文中一共展示了NoConfigModuleMixin.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from module_mixins import NoConfigModuleMixin [as 别名]
# 或者: from module_mixins.NoConfigModuleMixin import __init__ [as 别名]
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()
示例2: __init__
# 需要导入模块: from module_mixins import NoConfigModuleMixin [as 别名]
# 或者: from module_mixins.NoConfigModuleMixin import __init__ [as 别名]
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()
示例3: __init__
# 需要导入模块: from module_mixins import NoConfigModuleMixin [as 别名]
# 或者: from module_mixins.NoConfigModuleMixin import __init__ [as 别名]
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()
示例4: __init__
# 需要导入模块: from module_mixins import NoConfigModuleMixin [as 别名]
# 或者: from module_mixins.NoConfigModuleMixin import __init__ [as 别名]
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()
示例5: __init__
# 需要导入模块: from module_mixins import NoConfigModuleMixin [as 别名]
# 或者: from module_mixins.NoConfigModuleMixin import __init__ [as 别名]
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})
示例6: __init__
# 需要导入模块: from module_mixins import NoConfigModuleMixin [as 别名]
# 或者: from module_mixins.NoConfigModuleMixin import __init__ [as 别名]
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()
示例7: __init__
# 需要导入模块: from module_mixins import NoConfigModuleMixin [as 别名]
# 或者: from module_mixins.NoConfigModuleMixin import __init__ [as 别名]
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()
示例8: __init__
# 需要导入模块: from module_mixins import NoConfigModuleMixin [as 别名]
# 或者: from module_mixins.NoConfigModuleMixin import __init__ [as 别名]
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()
示例9: __init__
# 需要导入模块: from module_mixins import NoConfigModuleMixin [as 别名]
# 或者: from module_mixins.NoConfigModuleMixin import __init__ [as 别名]
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()
示例10: __init__
# 需要导入模块: from module_mixins import NoConfigModuleMixin [as 别名]
# 或者: from module_mixins.NoConfigModuleMixin import __init__ [as 别名]
def __init__(self, module_manager):
ModuleBase.__init__(self, module_manager)
# setup the pipeline
self._imageCast = vtk.vtkImageCast()
self._imageCast.SetOutputScalarTypeToFloat()
self._vtk2itk = itk.VTKImageToImageFilter[itk.Image[itk.F, 3]].New()
self._vtk2itk.SetInput(self._imageCast.GetOutput())
NoConfigModuleMixin.__init__(
self, {"Module (self)": self, "vtkImageCast": self._imageCast, "VTKImageToImageFilter": self._vtk2itk}
)
self.sync_module_logic_with_config()
示例11: __init__
# 需要导入模块: from module_mixins import NoConfigModuleMixin [as 别名]
# 或者: from module_mixins.NoConfigModuleMixin import __init__ [as 别名]
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
NoConfigModuleMixin.__init__(self)
self._imageEigenvectors = vtktud.vtkImageEigenvectors()
# module_utils.setup_vtk_object_progress(self, self._clipPolyData,
# 'Calculating normals')
self._viewFrame = self._createViewFrame({"ImageEigenvectors": self._imageEigenvectors})
# 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()
示例12: __init__
# 需要导入模块: from module_mixins import NoConfigModuleMixin [as 别名]
# 或者: from module_mixins.NoConfigModuleMixin import __init__ [as 别名]
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
self._greyReconstruct = vtkdevide.vtkImageGreyscaleReconstruct3D()
NoConfigModuleMixin.__init__(
self,
{'Module (self)' : self,
'vtkImageGreyscaleReconstruct3D' : self._greyReconstruct})
module_utils.setup_vtk_object_progress(
self, self._greyReconstruct,
'Performing greyscale reconstruction')
self.sync_module_logic_with_config()
示例13: __init__
# 需要导入模块: from module_mixins import NoConfigModuleMixin [as 别名]
# 或者: from module_mixins.NoConfigModuleMixin import __init__ [as 别名]
def __init__(self, module_manager):
ModuleBase.__init__(self, module_manager)
self._image_data_streamer = vtk.vtkImageDataStreamer()
self._poly_data_streamer = vtk.vtkPolyDataStreamer()
NoConfigModuleMixin.__init__(self,
{'module (self)' : self,
'vtkImageDataStreamer' : self._image_data_streamer,
'vtkPolyDataStreamer' : self._poly_data_streamer})
module_utils.setup_vtk_object_progress(self,
self._image_data_streamer, 'Streaming image data')
self._current_mode = None
self.sync_module_logic_with_config()
示例14: __init__
# 需要导入模块: from module_mixins import NoConfigModuleMixin [as 别名]
# 或者: from module_mixins.NoConfigModuleMixin import __init__ [as 别名]
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
self._imageGradientMagnitude = vtk.vtkImageGradientMagnitude()
self._imageGradientMagnitude.SetDimensionality(3)
module_utils.setup_vtk_object_progress(self, self._imageGradientMagnitude,
'Calculating gradient magnitude')
NoConfigModuleMixin.__init__(
self,
{'Module (self)' : self,
'vtkImageGradientMagnitude' : self._imageGradientMagnitude})
self.sync_module_logic_with_config()
示例15: __init__
# 需要导入模块: from module_mixins import NoConfigModuleMixin [as 别名]
# 或者: from module_mixins.NoConfigModuleMixin import __init__ [as 别名]
def __init__(self, module_manager):
# initialise our base class
ModuleBase.__init__(self, module_manager)
self._imageFlip = vtk.vtkImageFlip()
self._imageFlip.SetFilteredAxis(2)
self._imageFlip.GetOutput().SetUpdateExtentToWholeExtent()
module_utils.setup_vtk_object_progress(self, self._imageFlip,
'Flipping image')
NoConfigModuleMixin.__init__(
self,
{'vtkImageFlip' : self._imageFlip})
self.sync_module_logic_with_config()