• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python module_mixins.NoConfigModuleMixin类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中module_mixins.NoConfigModuleMixin的典型用法代码示例。如果您正苦于以下问题:Python NoConfigModuleMixin类的具体用法?Python NoConfigModuleMixin怎么用?Python NoConfigModuleMixin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了NoConfigModuleMixin类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: close

    def close(self):
        # just in case
        self.set_input(0, None)
        self.set_input(1, None)

        # take care of our refs so that things can disappear
        self._destroyPipelines()
        del self._itkExporterStack
        del self._imageAppend

        NoConfigModuleMixin.close(self)

        ModuleBase.close(self)
开发者ID:fvpolpeta,项目名称:devide,代码行数:13,代码来源:transform2D.py


示例17: 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._probeFilter
        del self._dummyInput
        del self._padder
        del self._source
        del self._input
开发者ID:fvpolpeta,项目名称:devide,代码行数:15,代码来源:probeFilter.py


示例18: __init__

    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,代码行数:15,代码来源:VTKtoITKF3.py


示例19: __init__

    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,代码行数:16,代码来源:imageEigenvectors.py


示例20: __init__

    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,代码行数:17,代码来源:greyReconstruct.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python module_mixins.ScriptedConfigModuleMixin类代码示例发布时间:2022-05-27
下一篇:
Python module_locator.module_path函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap