当前位置: 首页>>代码示例>>Python>>正文


Python NoConfigModuleMixin.__init__方法代码示例

本文整理汇总了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()
开发者ID:fvpolpeta,项目名称:devide,代码行数:36,代码来源:probeFilter.py

示例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()     
开发者ID:fvpolpeta,项目名称:devide,代码行数:27,代码来源:testModule2.py

示例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()
开发者ID:sanguinariojoe,项目名称:devide,代码行数:9,代码来源:PassThrough.py

示例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()
开发者ID:fvpolpeta,项目名称:devide,代码行数:27,代码来源:testModule.py

示例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})
开发者ID:fvpolpeta,项目名称:devide,代码行数:36,代码来源:reconstructSurface.py

示例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()
开发者ID:fvpolpeta,项目名称:devide,代码行数:12,代码来源:DICOMAligner.py

示例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()
开发者ID:fvpolpeta,项目名称:devide,代码行数:54,代码来源:modifyHomotopySlow.py

示例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()
开发者ID:fvpolpeta,项目名称:devide,代码行数:15,代码来源:polyDataNormals.py

示例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()
开发者ID:fvpolpeta,项目名称:devide,代码行数:15,代码来源:transformPolyData.py

示例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()
开发者ID:sanguinariojoe,项目名称:devide,代码行数:17,代码来源:VTKtoITKF3.py

示例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()
开发者ID:sanguinariojoe,项目名称:devide,代码行数:18,代码来源:imageEigenvectors.py

示例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()
开发者ID:fvpolpeta,项目名称:devide,代码行数:19,代码来源:greyReconstruct.py

示例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()
开发者ID:fvpolpeta,项目名称:devide,代码行数:19,代码来源:StreamerVTK.py

示例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()
开发者ID:fvpolpeta,项目名称:devide,代码行数:19,代码来源:imageGradientMagnitude.py

示例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()
开发者ID:fvpolpeta,项目名称:devide,代码行数:20,代码来源:imageFlip.py


注:本文中的module_mixins.NoConfigModuleMixin.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。