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

Python module_mixins.ScriptedConfigModuleMixin类代码示例

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

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



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

示例1: close

    def close(self):
        ScriptedConfigModuleMixin.close(self)

        # get rid of our reference
        del self._icp

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


示例2: __init__

    def __init__(self, module_manager):
        ModuleBase.__init__(self, module_manager)

        self._extract = vtk.vtkImageExtractComponents()

        module_utils.setup_vtk_object_progress(self, self._extract,
                                           'Extracting components.')
        

        self._config.component1 = 0
        self._config.component2 = 1
        self._config.component3 = 2
        self._config.numberOfComponents = 1
        self._config.fileLowerLeft = False

        configList = [
            ('Component 1:', 'component1', 'base:int', 'text',
             'Zero-based index of first component to extract.'),
            ('Component 2:', 'component2', 'base:int', 'text',
             'Zero-based index of second component to extract.'),
            ('Component 3:', 'component3', 'base:int', 'text',
             'Zero-based index of third component to extract.'),
            ('Number of components:', 'numberOfComponents', 'base:int',
             'choice',
             'Number of components to extract.  Only this number of the '
             'above-specified component indices will be used.',
             ('1', '2', '3'))]

        ScriptedConfigModuleMixin.__init__(
            self, configList,
            {'Module (self)' : self,
             'vtkImageExtractComponents' : self._extract})

        self.sync_module_logic_with_config()
开发者ID:fvpolpeta,项目名称:devide,代码行数:34,代码来源:extractImageComponents.py


示例3: __init__

    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)

        self._writer = vtk.vtkMetaImageWriter()

        module_utils.setup_vtk_object_progress(
            self, self._writer,
            'Writing VTK ImageData')

        # set up some defaults
        self._config.filename = ''
        self._config.compression = True

        config_list = [
                ('Filename:', 'filename', 'base:str', 'filebrowser',
                    'Output filename for MetaImage file.',
                    {'fileMode' : wx.SAVE,
                     'fileMask' : 'MetaImage single file (*.mha)|*.mha|MetaImage separate header/(z)raw files (*.mhd)|*.mhd|All files (*)|*',
                     'defaultExt' : '.mha'}
                    ),
                ('Compression:', 'compression', 'base:bool', 'checkbox',
                    'Compress the image / volume data')
                ]

        ScriptedConfigModuleMixin.__init__(self, config_list,
                {'Module (self)' : self})
开发者ID:fvpolpeta,项目名称:devide,代码行数:28,代码来源:metaImageWRT.py


示例4: __init__

    def __init__(self, module_manager):

        ModuleBase.__init__(self, module_manager)

        # setup defaults
        self._config.propagationScaling = 1.0
        self._config.curvatureScaling = 1.0
        self._config.advectionScaling = 1.0
        self._config.numberOfIterations = 100

        configList = [
            ('Propagation scaling:', 'propagationScaling', 'base:float',
             'text', 'Propagation scaling parameter for the geodesic active '
             'contour, '
             'i.e. balloon force.  Positive for outwards, negative for '
             'inwards.'),
            ('Curvature scaling:', 'curvatureScaling', 'base:float', 'text',
             'Curvature scaling term weighting.'),
            ('Advection scaling:', 'advectionScaling', 'base:float', 'text',
             'Advection scaling term weighting.'),
            ('Number of iterations:', 'numberOfIterations', 'base:int', 'text',
             'Number of iterations that the algorithm should be run for')
        ]

        ScriptedConfigModuleMixin.__init__(self, configList,
                                           {'Module (self)': self})

        # create all pipeline thingies
        self._createITKPipeline()

        self.sync_module_logic_with_config()
开发者ID:sanguinariojoe,项目名称:devide,代码行数:31,代码来源:tpgac.py


示例5: __init__

    def __init__(self, module_manager):

        ModuleBase.__init__(self, module_manager)

        # setup defaults
        self._config.propagationScaling = 1.0
        self._config.advectionScaling = 1.0
        self._config.curvatureScaling = 1.0
        self._config.numberOfIterations = 500

        configList = [
            (
                "Propagation scaling:",
                "propagationScaling",
                "base:float",
                "text",
                "Weight factor for the propagation term",
            ),
            ("Advection scaling:", "advectionScaling", "base:float", "text", "Weight factor for the advection term"),
            ("Curvature scaling:", "curvatureScaling", "base:float", "text", "Weight factor for the curvature term"),
            (
                "Number of iterations:",
                "numberOfIterations",
                "base:int",
                "text",
                "Number of iterations that the algorithm should be run for",
            ),
        ]

        ScriptedConfigModuleMixin.__init__(self, configList, {"Module (self)": self})

        # create all pipeline thingies
        self._createITKPipeline()

        self.sync_module_logic_with_config()
开发者ID:sanguinariojoe,项目名称:devide,代码行数:35,代码来源:nbCurvesLevelSet.py


示例6: __init__

    def __init__(self, module_manager):
        ModuleBase.__init__(self, module_manager)

        self._config.gaussianSigma = 0.7
        self._config.normaliseAcrossScale = False

        configList = [
            ('Gaussian sigma', 'gaussianSigma', 'base:float', 'text',
             'Sigma in terms of image spacing.'),
            ('Normalise across scale', 'normaliseAcrossScale', 'base:bool',
             'checkbox', 'Determine normalisation factor.')]
        
        ScriptedConfigModuleMixin.__init__(self, configList)

        # setup the pipeline
        g = itk.itkGradientMagnitudeRecursiveGaussianImageFilterF3F3_New()
        self._gradientMagnitude = g
        
        module_utilsITK.setupITKObjectProgress(
            self, g,
            'itkGradientMagnitudeRecursiveGaussianImageFilter',
            'Calculating gradient image')

        self._createWindow(
            {'Module (self)' : self,
             'itkGradientMagnitudeRecursiveGaussianImageFilter' :
             self._gradientMagnitude})

        self.config_to_logic()
        self.syncViewWithLogic()
开发者ID:fvpolpeta,项目名称:devide,代码行数:30,代码来源:hessianDoG.py


示例7: __init__

    def __init__(self, module_manager):
        ModuleBase.__init__(self, module_manager)

        self._config.alpha = - 0.5
        self._config.beta = 3.0
        self._config.min = 0.0
        self._config.max = 1.0
        
        configList = [
            ('Alpha:', 'alpha', 'base:float', 'text',
             'Alpha parameter for the sigmoid filter'),
            ('Beta:', 'beta', 'base:float', 'text',
             'Beta parameter for the sigmoid filter'),
            ('Minimum:', 'min', 'base:float', 'text',
             'Minimum output of sigmoid transform'),
            ('Maximum:', 'max', 'base:float', 'text',
             'Maximum output of sigmoid transform')]
        


        if3 = itk.Image[itk.F, 3]
        self._sigmoid = itk.SigmoidImageFilter[if3,if3].New()
        
        itk_kit.utils.setupITKObjectProgress(
            self, self._sigmoid,
            'itkSigmoidImageFilter',
            'Performing sigmoid transformation')

        ScriptedConfigModuleMixin.__init__(
            self, configList,
            {'Module (self)' : self,
             'itkSigmoidImageFilter' :
             self._sigmoid})

        self.sync_module_logic_with_config()
开发者ID:fvpolpeta,项目名称:devide,代码行数:35,代码来源:sigmoid.py


示例8: __init__

    def __init__(self, module_manager):
        ModuleBase.__init__(self, module_manager)

        # setup config
        self._config.resolution = 40

        # and then our scripted config
        configList = [
            ('Resolution: ', 'resolution', 'base:int', 'text',
             'x, y and z resolution of sampled volume.  '
             'According to the article, should be 40 to be '
             'at Nyquist.')]

        # now create the necessary VTK modules
        self._es = vtk.vtkImageEllipsoidSource()
        self._es.SetOutputScalarTypeToFloat()

        self._ic = vtk.vtkImageChangeInformation()
        self._ic.SetInputConnection(self._es.GetOutputPort())

        self._output = vtk.vtkImageData()

        # mixin ctor
        ScriptedConfigModuleMixin.__init__(
            self, configList,
            {'Module (self)' : self})

        self.sync_module_logic_with_config()
开发者ID:fvpolpeta,项目名称:devide,代码行数:28,代码来源:MarschnerLobb.py


示例9: __init__

    def __init__(self, module_manager):
        # initialise our base class
        ModuleBase.__init__(self, module_manager)


        self._imageMath = vtk.vtkImageMathematics()
        self._imageMath.SetInput1(None)
        self._imageMath.SetInput2(None)
        
        module_utils.setup_vtk_object_progress(self, self._imageMath,
                                           'Performing image math')
        
                                           
        self._config.operation = 'subtract'
        self._config.constantC = 0.0
        self._config.constantK = 1.0


        configList = [
            ('Operation:', 'operation', 'base:str', 'choice',
             'The operation that should be performed.',
             tuple(OPS_DICT.keys())),
            ('Constant C:', 'constantC', 'base:float', 'text',
             'The constant C used in some operations.'),
            ('Constant K:', 'constantK', 'base:float', 'text',
             'The constant C used in some operations.')]

        ScriptedConfigModuleMixin.__init__(
            self, configList,
            {'Module (self)' : self,
             'vtkImageMathematics' : self._imageMath})

        self.sync_module_logic_with_config()
开发者ID:fvpolpeta,项目名称:devide,代码行数:33,代码来源:imageMathematics.py


示例10: __init__

    def __init__(self, module_manager):
        # initialise our base class
        ModuleBase.__init__(self, module_manager)

        self._implicitModeller = vtk.vtkImplicitModeller()

        module_utils.setup_vtk_object_progress(
            self, self._implicitModeller,
            'Converting surface to distance field')
                                           
        self._config.bounds = (-1, 1, -1, 1, -1, 1)
        self._config.dimensions = (64, 64, 64)
        self._config.maxDistance = 0.1
        
        configList = [
            ('Bounds:', 'bounds', 'tuple:float,6', 'text',
             'The physical location of the sampled volume in space '
             '(x0, x1, y0, y1, z0, z1)'),
            ('Dimensions:', 'dimensions', 'tuple:int,3', 'text',
             'The number of points that should be sampled in each dimension.'),
            ('Maximum distance:', 'maxDistance', 'base:float', 'text',
             'The distance will only be calculated up to this maximum.')]

        ScriptedConfigModuleMixin.__init__(
            self, configList,
            {'Module (self)' : self,
             'vtkImplicitModeller' : self._implicitModeller})

        self.sync_module_logic_with_config()
开发者ID:fvpolpeta,项目名称:devide,代码行数:29,代码来源:surfaceToDistanceField.py


示例11: __init__

    def __init__(self, module_manager):
        ModuleBase.__init__(self, module_manager)

        self._reader = vtk.vtkMetaImageReader()

        module_utils.setup_vtk_object_progress(self, self._reader,
                                           'Reading MetaImage data.')
        

        self._config.filename = ''

        configList = [
            ('File name:', 'filename', 'base:str', 'filebrowser',
             'The name of the MetaImage file you want to load.',
             {'fileMode' : wx.OPEN,
              'fileMask' :
              'MetaImage single file (*.mha)|*.mha|MetaImage separate header '
              '(*.mhd)|*.mhd|All files (*.*)|*.*'})]

        ScriptedConfigModuleMixin.__init__(
            self, configList,
            {'Module (self)' : self,
             'vtkMetaImageReader' : self._reader})

        self.sync_module_logic_with_config()
开发者ID:fvpolpeta,项目名称:devide,代码行数:25,代码来源:metaImageRDR.py


示例12: __init__

    def __init__(self, module_manager):
        ModuleBase.__init__(self, module_manager)
        InputArrayChoiceMixin.__init__(self)
        
        self._config.scaleFactor = 1

        configList = [
            ('Scale factor:', 'scaleFactor', 'base:float', 'text',
             'The warping will be scaled by this factor'),
            ('Vectors selection:', 'vectorsSelection', 'base:str', 'choice',
             'The attribute that will be used as vectors for the warping.',
             (self._defaultVectorsSelectionString, self._userDefinedString))]

        self._warpVector = vtk.vtkWarpVector()

        ScriptedConfigModuleMixin.__init__(
            self, configList,
            {'Module (self)' : self,
             'vtkWarpVector' : self._warpVector})
        
        module_utils.setup_vtk_object_progress(self, self._warpVector,
                                           'Warping points.')
        

        self.sync_module_logic_with_config()
开发者ID:fvpolpeta,项目名称:devide,代码行数:25,代码来源:warpPoints.py


示例13: __init__

    def __init__(self, module_manager):
        ModuleBase.__init__(self, module_manager)

        self._config.numberOfIterations = 3
        self._config.timeStep = 0.05

        configList = [
            ('Number of iterations:', 'numberOfIterations', 'base:int',
             'text',
             'Number of update iterations that will be performed.'),

            ('Timestep:', 'timeStep', 'base:float',
             'text', 'Timestep between update iterations.')]

        



        # setup the pipeline
        if3 = itk.Image[itk.F, 3]
        self._cfif = itk.CurvatureFlowImageFilter[if3, if3].New()
        
        itk_kit.utils.setupITKObjectProgress(
            self, self._cfif, 'itkCurvatureFlowImageFilter',
            'Denoising data')

        ScriptedConfigModuleMixin.__init__(
            self, configList,
            {'Module (self)' : self,
             'itkCurvatureFlowImageFilter' : self._cfif})
            
        self.sync_module_logic_with_config()
开发者ID:fvpolpeta,项目名称:devide,代码行数:32,代码来源:curvatureFlowDenoising.py


示例14: __init__

    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)
        

        self._imageInput = None
        self._meshInput = None

        
        self._flipper = vtk.vtkImageFlip()
        self._flipper.SetFilteredAxis(1)
        module_utils.setup_vtk_object_progress(
            self, self._flipper, 'Flipping Y axis.')

        self._config.cpt_driver_path = \
                'd:\\misc\\stuff\\driver.bat'
            #'/home/cpbotha/build/cpt/3d/driver/driver.exe'
        self._config.max_distance = 5

        config_list = [
                ('CPT driver path', 'cpt_driver_path',
                'base:str', 'filebrowser', 
                'Path to CPT driver executable',
                {'fileMode' : module_mixins.wx.OPEN,
                 'fileMask' : 'All files (*.*)|*.*'}), 
                ('Maximum distance', 'max_distance', 
                'base:float', 'text', 
                'The maximum (absolute) distance up to which the field is computed.')]

        ScriptedConfigModuleMixin.__init__(
            self, config_list,
            {'Module (self)' : self})
            
        self.sync_module_logic_with_config()
开发者ID:fvpolpeta,项目名称:devide,代码行数:35,代码来源:cptDistanceField.py


示例15: __init__

    def __init__(self, module_manager):
        # initialise our base class
        ModuleBase.__init__(self, module_manager)


        self._glyph3d = vtktud.vtkMyGlyph3D()
        
        module_utils.setup_vtk_object_progress(self, self._glyph3d,
                                           'Making 3D glyphs')
        
                                           
        self._config.scaling = 1.0
        self._config.scalemode = 1.0

        configList = [
            ('Scaling:', 'scaling', 'base:float', 'text',
             'Glyphs will be scaled by this factor.'),
            ('Scalemode:', 'scalemode', 'base:int', 'text',
             'Scaling will occur by scalar, vector direction or magnitude.')]
        ScriptedConfigModuleMixin.__init__(self, configList)        
        

        self._viewFrame = self._createWindow(
            {'Module (self)' : self,
             'vtkMyGlyph3D' : self._glyph3d})

        # 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.logic_to_config()
        self.config_to_view()
开发者ID:fvpolpeta,项目名称:devide,代码行数:31,代码来源:MyGlyph3D.py


示例16: __init__

    def __init__(self, module_manager):
        # initialise our base class
        ModuleBase.__init__(self, module_manager)

        #for o in self._objectDict.values():
        #    

        # setup some config defaults
        self._config.threshold = 1250
        self._config.interpolation = 0 # nearest
        # this is not in the interface yet, change by introspection
        self._config.mip_colour = (0.0, 0.0, 1.0)
        config_list = [
            ('Threshold:', 'threshold', 'base:float', 'text',
             'Used to generate transfer function if none is supplied'),
            ('Interpolation:', 'interpolation', 'base:int', 'choice',
             'Linear (high quality, slower) or nearest neighbour (lower '
             'quality, faster) interpolation',
             ('Nearest Neighbour', 'Linear'))]

        ScriptedConfigModuleMixin.__init__(
            self, config_list,
            {'Module (self)' : self})
        
        self._create_pipeline()

        self.sync_module_logic_with_config()
开发者ID:fvpolpeta,项目名称:devide,代码行数:27,代码来源:MIPRender.py


示例17: __init__

    def __init__(self, module_manager):

        # call parent constructor
        ModuleBase.__init__(self, module_manager)
        # ctor for this specific mixin
        # FilenameViewModuleMixin.__init__(self)

        self._input_image = None
        self._foreground_points = None
        self._background_points = None
       
        self._config.filename = ''

        configList = [
            ('Result file name:', 'filename', 'base:str', 'filebrowser',
             'Y/N result will be written to this file.',
             {'fileMode' : WX_SAVE,
              'fileMask' :
              'All files (*.*)|*.*'})]

        ScriptedConfigModuleMixin.__init__(
            self, configList,
            {'Module (self)' : self})
            
        self.sync_module_logic_with_config()
开发者ID:fvpolpeta,项目名称:devide,代码行数:25,代码来源:isolated_points_check.py


示例18: __init__

    def __init__(self, module_manager):
        ModuleBase.__init__(self, module_manager)

        # setup config
        self._config.order = 0
        self._config.standardDeviation = 1.0
        self._config.support = 3.0 * self._config.standardDeviation

        # and then our scripted config
        configList = [
            ("Order: ", "order", "base:int", "text", "The order of the gaussian kernel (0-2)."),
            (
                "Standard deviation: ",
                "standardDeviation",
                "base:float",
                "text",
                "The standard deviation (width) of the gaussian kernel.",
            ),
            ("Support: ", "support", "base:float", "text", "The support of the gaussian kernel."),
        ]

        # mixin ctor
        ScriptedConfigModuleMixin.__init__(self, configList)

        # now create the necessary VTK modules
        self._gaussianKernel = vtktud.vtkGaussianKernel()

        # setup progress for the processObject
        #        module_utils.setup_vtk_object_progress(self, self._superquadricSource,
        #                                           "Synthesizing polydata.")

        self._createWindow({"Module (self)": self, "vtkGaussianKernel": self._gaussianKernel})

        self.config_to_logic()
        self.syncViewWithLogic()
开发者ID:sanguinariojoe,项目名称:devide,代码行数:35,代码来源:gaussianKernel.py


示例19: __init__

    def __init__(self, module_manager):
        # initialise our base class
        ModuleBase.__init__(self, module_manager)

        self._imageSepConvolution = vtktud.vtkImageSepConvolution()

#        module_utils.setup_vtk_object_progress(self, self._clipper,
#                                           'Reading PNG images.')

        # set information for ScriptedConfigModuleMixin
        self._config.axis = 0

        # FIXME: include options for kernel normalisation?
        configList = [
            ('Axis:', 'axis', 'base:int', 'choice',
             'Axis over which convolution is to be performed.', ("X", "Y", "Z") ) ] 

        ScriptedConfigModuleMixin.__init__(self, configList)

        self._viewFrame = self._createViewFrame(
            {'Module (self)' : self,
             'vtkImageSepConvolution' : self._imageSepConvolution})

        # 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,代码来源:imageSepConvolution.py


示例20: __init__

    def __init__(self, module_manager):
        # initialise our base class
        ModuleBase.__init__(self, module_manager)


        self._shepardFilter = vtk.vtkShepardMethod()
        
        module_utils.setup_vtk_object_progress(self, self._shepardFilter,
                                           'Applying Shepard Method.')
        
                                           
        self._config.maximum_distance = 1.0
        
                                           
                                           

        configList = [
            ('Kernel size:', 'kernelSize', 'tuple:int,3', 'text',
             'Size of the kernel in x,y,z dimensions.')]

        ScriptedConfigModuleMixin.__init__(
            self, configList,
            {'Module (self)' : self,
             'vtkImageContinuousDilate3D' : self._imageDilate})

        self.sync_module_logic_with_config()
开发者ID:fvpolpeta,项目名称:devide,代码行数:26,代码来源:ShepardMethod.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python module_utils.setup_vtk_object_progress函数代码示例发布时间:2022-05-27
下一篇:
Python module_mixins.NoConfigModuleMixin类代码示例发布时间: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