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


Python vtk.vtkRenderLargeImage函数代码示例

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


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

示例1: __init__

 def __init__(self, module_manager):
     SimpleVTKClassModuleBase.__init__(
         self, module_manager,
         vtk.vtkRenderLargeImage(), 'Processing.',
         (), ('vtkImageData',),
         replaceDoc=True,
         inputFunctions=None, outputFunctions=None)
开发者ID:fvpolpeta,项目名称:devide,代码行数:7,代码来源:vtkRenderLargeImage.py

示例2: takeSimShot

    def takeSimShot(self, fileName):
        # print MODULENAME,' takeSimShot:  fileName=',fileName

        # DON'T REMOVE!
        # Better quality
        # Passes vtkRenderer. Takes actual screenshot of the region within the widget window
        # If other application are present within this region it will shoot them also
        
        
        renderLarge = vtk.vtkRenderLargeImage()
        renderLarge.SetInput(self.graphicsFrameWidget.ren)
        renderLarge.SetMagnification(1)

        
        # We write out the image which causes the rendering to occur. If you
        # watch your screen you might see the pieces being rendered right
        # after one another.
        # writer = vtk.vtkPNGWriter()
        writer = vtk.vtkPNGWriter()
        writer.SetInputConnection(renderLarge.GetOutputPort())
        print MODULENAME,"takeSimShot():  vtkPNGWriter, fileName=",fileName
        
        writer.SetFileName(fileName)
        print 'TRYING TO WRITE ',fileName
        writer.Write()
        print 'WROTE ',fileName
开发者ID:odellus,项目名称:CompuCell3D,代码行数:26,代码来源:MVCDrawView2D.py

示例3: write_image

    def write_image(self, filename="image.png", magnification=1,
                    image_format="png"):
        """
        Save render window to an image.

        Arguments:
            filename:
                filename to save to. Defaults to image.png.
            magnification:
                magnification. Use it to render high res images.
            image_format:
                choose between jpeg, png.  Png is the default.
        """
        render_large = vtk.vtkRenderLargeImage()
        render_large.SetInput(self.ren)
        if image_format == "jpeg":
            writer = vtk.vtkJPEGWriter()
            writer.SetQuality(80)
        else:
            writer = vtk.vtkPNGWriter()

        render_large.SetMagnification(magnification)
        writer.SetFileName(filename)

        writer.SetInputConnection(render_large.GetOutputPort())
        self.ren_win.Render()
        writer.Write()
        del render_large
开发者ID:akashneo,项目名称:pymatgen,代码行数:28,代码来源:structure_vtk.py

示例4: write_picture

    def write_picture(self, magnify, fname):
        ren = self.getRenderer()
        assert ren is not None
        renderLarge = vtk.vtkRenderLargeImage()
        renderLarge.SetInput(ren)
        renderLarge.SetMagnification(magnify)

        rotation = 'x'
        self.set_rotation(rotation)

        lfname = fname.lower()
        if lfname.endswith('.png'):
            writer = vtk.vtkPNGWriter()
        elif lfname.endswith('.jpeg'):
            writer = vtk.vtkJPEGWriter()
        elif lfname.endswith('.tiff'):
            writer = vtk.vtkTIFFWriter()
        elif lfname.endswith('.ps'):
            writer = vtk.vtkPostScriptWriter()
        else:
            writer = vtk.vtkPNGWriter()

        writer.SetInput(renderLarge.GetOutput())
        writer.SetFileName(fname)
        writer.Write()
开发者ID:sukhbinder,项目名称:cyNastran,代码行数:25,代码来源:actionsControl.py

示例5: writeLargeFrame

def writeLargeFrame( myscreen, w2if, lwr, n , zoom=1):
    renderlarge = vtk.vtkRenderLargeImage()
    renderlarge.SetInput( myscreen.ren )
    renderlarge.SetMagnification(zoom)
    writer = vtk.vtkPNGWriter()
    writer.SetFileName("large_frame.png")
    writer.SetInputConnection( renderlarge.GetOutputPort() )
    writer.Write()
    print "Wrote large frame!"
开发者ID:dxli,项目名称:openvoronoi,代码行数:9,代码来源:poisson_stat_1.py

示例6: OnExportPicture

    def OnExportPicture(self, pubsub_evt):
        Publisher.sendMessage('Begin busy cursor')
        view_prop_list = []
        for slice_data in self.slice_data_list:
            view_prop_list.append(slice_data.box_actor) 
            self.ren.RemoveViewProp(slice_data.box_actor)

        id, filename, filetype = pubsub_evt.data
        dict = {"AXIAL": const.AXIAL,
                "CORONAL": const.CORONAL,
                "SAGITAL": const.SAGITAL}

        if id == dict[self.orientation]:
            if filetype == const.FILETYPE_POV:
                renwin = self.interactor.GetRenderWindow()
                image = vtk.vtkWindowToImageFilter()
                image.SetInput(renwin)
                writer = vtk.vtkPOVExporter()
                writer.SetFilePrefix(filename.split(".")[0])
                writer.SetRenderWindow(renwin)
                writer.Write()
            else:
                ren = self.slice_data.renderer
                #Use tiling to generate a large rendering.
                image = vtk.vtkRenderLargeImage()
                image.SetInput(ren)
                image.SetMagnification(1)
                image.Update()

                image = image.GetOutput()


                # write image file
                if (filetype == const.FILETYPE_BMP):
                    writer = vtk.vtkBMPWriter()
                elif (filetype == const.FILETYPE_JPG):
                    writer =  vtk.vtkJPEGWriter()
                elif (filetype == const.FILETYPE_PNG):
                    writer = vtk.vtkPNGWriter()
                elif (filetype == const.FILETYPE_PS):
                    writer = vtk.vtkPostScriptWriter()
                elif (filetype == const.FILETYPE_TIF):
                    writer = vtk.vtkTIFFWriter()
                    filename = "%s.tif"%filename.strip(".tif")

                writer.SetInputData(image)
                writer.SetFileName(filename)
                writer.Write()

            for actor in view_prop_list:
                self.ren.AddViewProp(actor)

        Publisher.sendMessage('End busy cursor')
开发者ID:Houssk,项目名称:invesalius3,代码行数:53,代码来源:viewer_slice.py

示例7: key_press

    def key_press(obj,event):

        key = obj.GetKeySym()
        if key=='s' or key=='S':
            print('Saving image...')            
            renderLarge = vtk.vtkRenderLargeImage()
            renderLarge.SetInput(ren)
            renderLarge.SetMagnification(png_magnify)
            renderLarge.Update()
            writer = vtk.vtkPNGWriter()
            writer.SetInputConnection(renderLarge.GetOutputPort())
            writer.SetFileName('fvtk.png')
            writer.Write()            
            print('Look for fvtk.png in your current dir.')
开发者ID:yarikoptic,项目名称:dipy,代码行数:14,代码来源:fvtk.py

示例8: WritePNG

def WritePNG(ren, fn, magnification = 1):
    '''
    Save the image as a PNG
    :param: ren - the renderer.
    :param: fn - the file name.
    :param: magnification - the magnification, usually 1.
    '''
    renLgeIm = vtk.vtkRenderLargeImage()
    imgWriter = vtk.vtkPNGWriter()
    renLgeIm.SetInput(ren)
    renLgeIm.SetMagnification(magnification)
    imgWriter.SetInputConnection(renLgeIm.GetOutputPort())
    imgWriter.SetFileName(fn)
    imgWriter.Write()
开发者ID:dlrdave,项目名称:VTKWikiExamples,代码行数:14,代码来源:CurvatureBandsWithGlyphs.py

示例9: takeSimShot

    def takeSimShot(self, fileName):
        renderLarge = vtk.vtkRenderLargeImage()
        renderLarge.SetInput(self.graphicsFrameWidget.ren)
        renderLarge.SetMagnification(1)

        # We write out the image which causes the rendering to occur. If you
        # watch your screen you might see the pieces being rendered right
        # after one another.
        writer = vtk.vtkPNGWriter()
        writer.SetInputConnection(renderLarge.GetOutputPort())
        # # # print "GOT HERE fileName=",fileName
        writer.SetFileName(fileName)
        
        writer.Write()
开发者ID:AngeloTorelli,项目名称:CompuCell3D,代码行数:14,代码来源:MVCDrawView3D.py

示例10: WritePMG

def WritePMG(ren, fn, magnification=1):
    """
    Save the image as a PNG

    :param ren: The renderer.
    :param fn: The file name.
    :param magnification: The magnification, usually 1.
    """
    renLgeIm = vtk.vtkRenderLargeImage()
    imgWriter = vtk.vtkPNGWriter()
    renLgeIm.SetInput(ren)
    renLgeIm.SetMagnification(magnification)
    imgWriter.SetInputConnection(renLgeIm.GetOutputPort())
    imgWriter.SetFileName(fn)
    imgWriter.Write()
开发者ID:apayne9,项目名称:PyChemia,代码行数:15,代码来源:teste.py

示例11: exportScreenshot

    def exportScreenshot(self, filename):
        """
        Save screenshot of the render window into a PNG file.

        @param filename: the name of the file
        @type filename: str
        """
        self.updateRenderWindow()
        w2i = vtk.vtkRenderLargeImage()
        writer = vtk.vtkPNGWriter()
        w2i.SetMagnification(2)
        w2i.SetInput(self.renderer)
        w2i.Update()
        writer.SetInputConnection(w2i.GetOutputPort())
        writer.SetFileName(filename)
        writer.Write()
开发者ID:baishi,项目名称:3dbar,代码行数:16,代码来源:barreconstructor.py

示例12: key_press

 def key_press(obj, event):
     key = obj.GetKeySym()
     if key == 's' or key == 'S':
         print('Saving image...')
         renderLarge = vtk.vtkRenderLargeImage()
         if vtk.VTK_MAJOR_VERSION <= 5:
             renderLarge.SetInput(renderer)
         else:
             renderLarge.SetInputData(renderer)
         renderLarge.SetMagnification(png_magnify)
         renderLarge.Update()
         writer = vtk.vtkPNGWriter()
         writer.SetInputConnection(renderLarge.GetOutputPort())
         writer.SetFileName('trimesh_save.png')
         writer.Write()
         print('Look for trimesh_save.png in your current working directory.')
开发者ID:StongeEtienne,项目名称:trimeshpy,代码行数:16,代码来源:trimesh_vtk.py

示例13: write_png

 def write_png(self, filename=None):
     large = vtk.vtkRenderLargeImage()
     large.SetInput(self.ren)
     large.SetMagnification(3)
     png = vtk.vtkPNGWriter()
     count = 0
     if filename is None:
         files = glob.glob('image*.png')
         if len(files) > 0:
             numbers = [int
                        (re.sub(r'image(\d+)\.png', r'\1', f))
                        for f in files]
             count = max(numbers) + 1
         filename = 'image{:0>4}.png'.format(count)
     png.SetFileName(filename)
     png.SetInputConnection(large.GetOutputPort())
     png.Write()
开发者ID:siudej,项目名称:Steklov-eigenvalues,代码行数:17,代码来源:viper3d.py

示例14: SaveAsBMP

    def SaveAsBMP(self,filename,resolution=1):
        """Saves the window as bmp-file.

        Resolution is an integer representing the number of squares
        that the window is divided into when writing to the bmp-file. 
        Thus choosing a higher number improves the quality of the 
        saved image.
        """
        from vtk import vtkRenderLargeImage,vtkBMPWriter
        #self.UpdateLight()

        renderLarge = vtkRenderLargeImage()
        renderLarge.SetInput(self.GetRenderer())
        renderLarge.SetMagnification(resolution)

        writer = vtkBMPWriter()
        writer.SetFileName(filename)
        writer.SetInput(renderLarge.GetOutput())
        writer.Write()
开发者ID:danse-inelastic,项目名称:inelastic-svn,代码行数:19,代码来源:RenderWidget.py

示例15: take_screenshot

    def take_screenshot(self,filename):
        ren = self.GetRenderWindow().GetRenderers().GetFirstRenderer()
        renderLarge = vtk.vtkRenderLargeImage()
        if vtk_major_version <= 5:
            renderLarge.SetInputData(ren)
        else:
            renderLarge.SetInput(ren)


        renderLarge.SetMagnification(1)

        # We write out the image which causes the rendering to occur. If you
        # watch your screen you might see the pieces being rendered right
        # after one another.
        writer = vtk.vtkPNGWriter()
        writer.SetInputConnection(renderLarge.GetOutputPort())
        # # # print "GOT HERE fileName=",fileName
        writer.SetFileName(filename)

        writer.Write()
开发者ID:maciekswat,项目名称:ram_plots,代码行数:20,代码来源:brain_plots_mac_colors_clip.py


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