[Paraview] vtk ascii to binary

Berk Geveci berk.geveci at kitware.com
Tue Aug 4 12:21:41 EDT 2009


With ParaView 3.6, you can do:

from paraview.simple import *
r = LegacyVTKReader()
r.FileNames = ["foo.vtk"]
w = servermanager.writers.DataSetWriter()
w.Input = r
w.FileName = "bar.vtk"
w.UpdatePipeline()

You will have to create a loop where you do the following 3:

for index in range...:
  r.FileNames = ["foo%d.vtk"  % index]
  w.FileName = "bar%d.vtk % index
  w.UpdatePipeline

To convert binary to ascii, do
w.FileType = 'Ascii'

-berk

On Mon, Aug 3, 2009 at 8:51 PM, Rafael Pacheco<rpacheco at asu.edu> wrote:
> Berk
>
> regarding your email below, could you please be kind to provide me an
> example on how to load the ascii file in ParaView and saving it as binary
> format using a python script?  I have a series of output files a00*.vtk (vtk
> legacy) written in fortran and I would like to create  movie, but loading
> the files take long time and space.
>
> Thank you!
> Rafael
>
>
>>> Date: Sun, 2 Nov 2008 07:30:16 -0400
>>> From: [EMAIL PROTECTED]
>>> To: [EMAIL PROTECTED]
>>> Subject: Re: [Paraview] Writing binary VTK
>>> CC: [EMAIL PROTECTED]; paraview at paraview.org
>>>
>>> If you already have the ascii VTK file, you can convert it to binary
>>> by loading it in ParaView and saving it out as binary format. It is
>>> pretty easy to automate this using Python. Let me know if you need an
>>> example.
>>>
>>> -berk
>>>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>


More information about the ParaView mailing list