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

Python module_utils.setup_vtk_object_progress函数代码示例

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

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



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

示例1: __init__

    def __init__(self, module_manager):

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

        self._writer = vtk.vtkStructuredPointsWriter()

        module_utils.setup_vtk_object_progress(
            self, self._writer,
            'Writing vtk structured points data')

        

        # we do this to save space - if you're going to be transporting files
        # to other architectures, change this to ASCII
        # we've set this back to ASCII.  Seems the binary mode is screwed
        # for some files and manages to produce corrupt files that segfault
        # VTK on Windows.
        self._writer.SetFileTypeToASCII()
        
        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'VTK data (*.vtk)|*.vtk|All files (*)|*',
            {'vtkStructuredPointsWriter': self._writer},
            fileOpen=False)


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

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


示例2: __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


示例3: __init__

    def __init__(self, module_manager):

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

        self._writer = vtk.vtkPolyDataWriter()
        # sorry about this, but the files get REALLY big if we write them
        # in ASCII - I'll make this a gui option later.
        self._writer.SetFileTypeToBinary()

        module_utils.setup_vtk_object_progress(
            self, self._writer,
            'Writing VTK Polygonal data')

        
        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'VTK data (*.vtk)|*.vtk|All files (*)|*',
            {'vtkPolyDataWriter': self._writer},
            fileOpen=False)

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

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


示例4: __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


示例5: __init__

    def __init__(self, module_manager):

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

        self._writer = vtk.vtkIVWriter()
        # sorry about this, but the files get REALLY big if we write them
        # in ASCII - I'll make this a gui option later.
        #self._writer.SetFileTypeToBinary()

        # following is the standard way of connecting up the devide progress
        # callback to a VTK object; you should do this for all objects in
        module_utils.setup_vtk_object_progress(
            self, self._writer, 'Writing polydata to Inventor Viewer format')

        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'InventorViewer data (*.iv)|*.iv|All files (*)|*',
            {'vtkIVWriter': self._writer},
            fileOpen=False)
        
        # set up some defaults
        self._config.filename = ''
        self.sync_module_logic_with_config()
开发者ID:fvpolpeta,项目名称:devide,代码行数:26,代码来源:ivWRT.py


示例6: __init__

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

        self._imageDilate = vtk.vtkImageContinuousDilate3D()
        self._imageErode = vtk.vtkImageContinuousErode3D()
        self._imageErode.SetInput(self._imageDilate.GetOutput())
        
        module_utils.setup_vtk_object_progress(self, self._imageDilate,
                                           'Performing greyscale 3D dilation')
        

        module_utils.setup_vtk_object_progress(self, self._imageErode,
                                           'Performing greyscale 3D erosion')
        

        self._config.kernelSize = (3, 3, 3)


        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,
             'vtkImageContinuousErode3D' : self._imageErode})
        
        self.sync_module_logic_with_config()
开发者ID:fvpolpeta,项目名称:devide,代码行数:30,代码来源:closing.py


示例7: __init__

    def __init__(self, module_manager, contourFilterText):

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

        self._contourFilterText = contourFilterText
        if contourFilterText == 'marchingCubes':
            self._contourFilter = vtk.vtkMarchingCubes()
        else: # contourFilter == 'contourFilter'
            self._contourFilter = vtk.vtkContourFilter()

        module_utils.setup_vtk_object_progress(self, self._contourFilter,
                                           'Extracting iso-surface')

        # now setup some defaults before our sync
        self._config.isoValue = 128;

        self._viewFrame = None
        self._createViewFrame()

        # transfer these defaults to the logic
        self.config_to_logic()

        # then make sure they come all the way back up via self._config
        self.logic_to_config()
        self.config_to_view()
开发者ID:fvpolpeta,项目名称:devide,代码行数:26,代码来源:contourFLTBase.py


示例8: __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


示例9: __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


示例10: __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


示例11: __init__

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


示例12: __init__

    def __init__(self, module_manager):
        """Constructor (initialiser) for the PD reader.

        This is almost standard code for most of the modules making use of
        the FilenameViewModuleMixin mixin.
        """
        
        # call the constructor in the "base"
        ModuleBase.__init__(self, module_manager)

        # setup necessary VTK objects
	self._reader = vtk.vtkOBJReader()
        
        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'Wavefront OBJ data (*.obj)|*.obj|All files (*)|*',
            {'vtkOBJReader': self._reader})

        module_utils.setup_vtk_object_progress(self, self._reader,
                                           'Reading Wavefront OBJ data')

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

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


示例13: _create_pipeline

    def _create_pipeline(self):
        # setup our pipeline

        self._otf = vtk.vtkPiecewiseFunction()
        self._ctf = vtk.vtkColorTransferFunction()

        self._volume_property = vtk.vtkVolumeProperty()
        self._volume_property.SetScalarOpacity(self._otf)
        self._volume_property.SetColor(self._ctf)
        self._volume_property.ShadeOn()
        self._volume_property.SetAmbient(0.1)
        self._volume_property.SetDiffuse(0.7)
        self._volume_property.SetSpecular(0.2)
        self._volume_property.SetSpecularPower(10)

        self._volume_raycast_function = vtk.vtkVolumeRayCastMIPFunction()
        self._volume_mapper = vtk.vtkVolumeRayCastMapper()

        # can also used FixedPoint, but then we have to use:
        # SetBlendModeToMaximumIntensity() and not SetVolumeRayCastFunction
        #self._volume_mapper = vtk.vtkFixedPointVolumeRayCastMapper()
        
        self._volume_mapper.SetVolumeRayCastFunction(
            self._volume_raycast_function)

        
        module_utils.setup_vtk_object_progress(self, self._volume_mapper,
                                           'Preparing render.')

        self._volume = vtk.vtkVolume()
        self._volume.SetProperty(self._volume_property)
        self._volume.SetMapper(self._volume_mapper)
开发者ID:fvpolpeta,项目名称:devide,代码行数:32,代码来源:MIPRender.py


示例14: __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


示例15: __init__

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

        self._reader = vtkgdcm.vtkGDCMImageReader()
        # NB NB NB: for now we're SWITCHING off the VTK-compatible
        # Y-flip, until the X-mirror issues can be solved.
        self._reader.SetFileLowerLeft(1)
        self._ici = vtk.vtkImageChangeInformation()
        self._ici.SetInputConnection(0, self._reader.GetOutputPort(0))

        # create output MedicalMetaData and populate it with the
        # necessary bindings.
        mmd = MedicalMetaData()
        mmd.medical_image_properties = \
                self._reader.GetMedicalImageProperties()
        mmd.direction_cosines = \
                self._reader.GetDirectionCosines()
        self._output_mmd = mmd

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

        self._view_frame = None
        self._file_dialog = None
        self._config.dicom_filenames = []
        # if this is true, module will still try to load set even if
        # IPP sorting fails by sorting images alphabetically
        self._config.robust_spacing = False

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


示例16: __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


示例17: __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


示例18: __init__

    def __init__(self, module_manager):

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

        self._writer = vtk.vtkXMLImageDataWriter()
        
        # ctor for this specific mixin
        FilenameViewModuleMixin.__init__(
            self,
            'Select a filename',
            'VTK Image Data (*.vti)|*.vti|All files (*)|*',
            {'vtkXMLImageDataWriter': self._writer},
            fileOpen=False)



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

        self._writer.SetDataModeToBinary()

        # set up some defaults
        self._config.filename = ''
        self._module_manager.sync_module_logic_with_config(self)
开发者ID:fvpolpeta,项目名称:devide,代码行数:26,代码来源:vtiWRT.py


示例19: __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


示例20: __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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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