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


Python ScriptedConfigModuleMixin.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from module_mixins import ScriptedConfigModuleMixin [as 别名]
# 或者: from module_mixins.ScriptedConfigModuleMixin import __init__ [as 别名]
    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,代码行数:27,代码来源:warpPoints.py

示例2: __init__

# 需要导入模块: from module_mixins import ScriptedConfigModuleMixin [as 别名]
# 或者: from module_mixins.ScriptedConfigModuleMixin import __init__ [as 别名]
    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,代码行数:31,代码来源:surfaceToDistanceField.py

示例3: __init__

# 需要导入模块: from module_mixins import ScriptedConfigModuleMixin [as 别名]
# 或者: from module_mixins.ScriptedConfigModuleMixin import __init__ [as 别名]
    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,代码行数:34,代码来源:curvatureFlowDenoising.py

示例4: __init__

# 需要导入模块: from module_mixins import ScriptedConfigModuleMixin [as 别名]
# 或者: from module_mixins.ScriptedConfigModuleMixin import __init__ [as 别名]
    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,代码行数:33,代码来源:MyGlyph3D.py

示例5: __init__

# 需要导入模块: from module_mixins import ScriptedConfigModuleMixin [as 别名]
# 或者: from module_mixins.ScriptedConfigModuleMixin import __init__ [as 别名]
    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.')]
        


        # setup the pipeline
        self._gradientMagnitude = None
        img_type = itk.Image.F3
        self._create_pipeline(img_type)
        
        ScriptedConfigModuleMixin.__init__(
            self, configList,
            {'Module (self)' : self,
             'itkGradientMagnitudeRecursiveGaussianImageFilter' :
             self._gradientMagnitude})
            
        self.sync_module_logic_with_config()
开发者ID:fvpolpeta,项目名称:devide,代码行数:28,代码来源:gradientMagnitudeGaussian.py

示例6: __init__

# 需要导入模块: from module_mixins import ScriptedConfigModuleMixin [as 别名]
# 或者: from module_mixins.ScriptedConfigModuleMixin import __init__ [as 别名]
    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,代码行数:29,代码来源:imageSepConvolution.py

示例7: __init__

# 需要导入模块: from module_mixins import ScriptedConfigModuleMixin [as 别名]
# 或者: from module_mixins.ScriptedConfigModuleMixin import __init__ [as 别名]
    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,代码行数:37,代码来源:sigmoid.py

示例8: __init__

# 需要导入模块: from module_mixins import ScriptedConfigModuleMixin [as 别名]
# 或者: from module_mixins.ScriptedConfigModuleMixin import __init__ [as 别名]
    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,代码行数:27,代码来源:isolated_points_check.py

示例9: __init__

# 需要导入模块: from module_mixins import ScriptedConfigModuleMixin [as 别名]
# 或者: from module_mixins.ScriptedConfigModuleMixin import __init__ [as 别名]
    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,代码行数:27,代码来源:metaImageRDR.py

示例10: __init__

# 需要导入模块: from module_mixins import ScriptedConfigModuleMixin [as 别名]
# 或者: from module_mixins.ScriptedConfigModuleMixin import __init__ [as 别名]
    def __init__(self, module_manager):
        # initialise our base class
        ModuleBase.__init__(self, module_manager)

        self._tubeFilter = vtk.vtkTubeFilter()
        
        module_utils.setup_vtk_object_progress(self, self._tubeFilter,
                                           'Generating tubes.')
                                           
        self._config.NumberOfSides = 3
        self._config.Radius = 0.01

        configList = [
            ('Number of sides:', 'NumberOfSides', 'base:int', 'text',
             'Number of sides that the tube should have.'),
            ('Tube radius:', 'Radius', 'base:float', 'text',
             'Radius of the generated tube.')]
        ScriptedConfigModuleMixin.__init__(self, configList)        
        
        self._viewFrame = self._createWindow(
            {'Module (self)' : self,
             'vtkTubeFilter' : self._tubeFilter})

        # 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,代码行数:29,代码来源:myTubeFilter.py

示例11: __init__

# 需要导入模块: from module_mixins import ScriptedConfigModuleMixin [as 别名]
# 或者: from module_mixins.ScriptedConfigModuleMixin import __init__ [as 别名]
    def __init__(self, module_manager):
        ModuleBase.__init__(self, module_manager)

        self._config.squared_distance = False
        self._config.binary_input = True
        self._config.image_spacing = True

        configList = [
            ('Squared distance:', 'squared_distance', 'base:bool', 'checkbox',
             'Should the distance output be squared (faster) or true.'),
            ('Use image spacing:', 'image_spacing', 'base:bool',
             'checkbox', 'Use image spacing in distance calculation.'),
            ('Binary input:', 'binary_input', 'base:bool', 'checkbox',
             'Does the input contain marked objects, or binary (yes/no) '
             'objects.')]
             
        # setup the pipeline
        imageF3 = itk.Image[itk.F, 3]
        self._dist_filter = None
        self._create_pipeline(imageF3)
        
        # THIS HAS TO BE ON.  SO THERE.
        #self._dist_filter.SetUseImageSpacing(True)
        
        ScriptedConfigModuleMixin.__init__(
            self, configList,
            {'Module (self)' : self,
             'itkDanielssonDistanceMapImageFilter' : self._dist_filter})

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

示例12: __init__

# 需要导入模块: from module_mixins import ScriptedConfigModuleMixin [as 别名]
# 或者: from module_mixins.ScriptedConfigModuleMixin import __init__ [as 别名]
    def __init__(self, module_manager):
        # initialise our base class
        ModuleBase.__init__(self, module_manager)

        self._reslicer = vtk.vtkImageReslice()
        self._probefilter = vtk.vtkProbeFilter()

        self._config.paddingValue = 0.0
        
        #This is 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()

        configList = [
            ('Padding value:', 'paddingValue', 'base:float', 'text',
             'The value used to pad regions that are outside the supplied volume.')]        
        
        # initialise any mixins we might have
        ScriptedConfigModuleMixin.__init__(
            self, configList,
            {'Module (self)': self,
             'vtkImageReslice': self._reslicer,
             'vtkProbeFilter': self._probefilter,
             'vtkImageConstantPad': self._padder})

        module_utils.setup_vtk_object_progress(self, self._reslicer,
                                               'Transforming image (Image Reslice)')
        module_utils.setup_vtk_object_progress(self, self._probefilter,
                                               'Performing remapping (Probe Filter)')

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

示例13: __init__

# 需要导入模块: from module_mixins import ScriptedConfigModuleMixin [as 别名]
# 或者: from module_mixins.ScriptedConfigModuleMixin import __init__ [as 别名]
    def __init__(self, module_manager):
        ModuleBase.__init__(self, module_manager)

        self._histogram = vtkdevide.vtkImageHistogram2D()
        module_utils.setup_vtk_object_progress(self, self._histogram,
                                           'Calculating 2D histogram')


        self._config.input1Bins = 256
        self._config.input2Bins = 256
        self._config.maxSamplesPerBin = 512

        configList = [
            ('Number of bins for input 1', 'input1Bins', 'base:int', 'text',
             'The full range of input 1 values will be divided into this many '
             'classes.'),
            ('Number of bins for input 2', 'input2Bins', 'base:int', 'text',
             'The full range of input 2 values will be divided into this many '
             'classes.'),
            ('Maximum samples per bin', 'maxSamplesPerBin', 'base:int', 'text',
             'The number of samples per 2D bin/class will be truncated to '
             'this value.')]

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

        self.sync_module_logic_with_config()

        self._input0 = None
        self._input1 = None
开发者ID:fvpolpeta,项目名称:devide,代码行数:34,代码来源:histogram2D.py

示例14: __init__

# 需要导入模块: from module_mixins import ScriptedConfigModuleMixin [as 别名]
# 或者: from module_mixins.ScriptedConfigModuleMixin import __init__ [as 别名]
    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,代码行数:37,代码来源:gaussianKernel.py

示例15: __init__

# 需要导入模块: from module_mixins import ScriptedConfigModuleMixin [as 别名]
# 或者: from module_mixins.ScriptedConfigModuleMixin import __init__ [as 别名]
    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,代码行数:28,代码来源:ShepardMethod.py


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