[vtkusers] save_image

Juerg Tschirren juerg-tschirren at uiowa.edu
Wed Jul 25 07:33:15 EDT 2001


This works for me:

    renWin = vtkRenderWindow()

    #...

    w2i = vtkWindowToImageFilter()
    renWin.Render()
    w2i.SetInput(renWin)
    tiffWriter = vtkTIFFWriter()
    tiffWriter.SetInput(w2i.GetOutput())
    tiffWriter.SetFileName("foo.tif")
    tiffWriter.Write()

The same can be done for writing Postscript. Just use
vtkPostScriptWriter in this case. And there are possibly more formats.
Check out the documentation that comes with VTK.

Juerg



On Tue, 24 Jul 2001, Karshi Hasanov wrote:

> Hi,
>
> I am  getting   some 2D MRI images using the SliceViewer.py , but don't
> know how to save it.
> Can you help  me how to do it using python?
> Thanks.
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>





More information about the vtkusers mailing list