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


Python module_mixins.NoConfigModuleMixin类代码示例

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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