[Paraview] XYZ to VTK

Mike Jackson imikejackson at gmail.com
Fri Feb 22 08:24:12 EST 2008


Actually,
    All was fixed with her data set. I do agree that a small convertor
would be nice. If I had time I could hack something together with a Qt
Gui. Maybe read CSV files with xyz and optional point data? Shouldn't
be too hard to do just need the time.

Also some one posted some code earlier to do just this type of
conversion. I think you will need to look in the list archives for the
code though. I don't remember exactly when it was posted.

Mike

On Fri, Feb 22, 2008 at 4:16 AM, Lester Anderson
<lester_anderson1963 at hotmail.com> wrote:
>
>  Hello
>
>  Following on from Mike Jackson's info:
>
>  > Hi everyone,
> >
> > I am finding some problems when trying to convert my three column
> > ASCII data (XYZ) into vtk format. I know I have to define poligones
> > and normals but I don't really know how. Is there any program that
> > converts general raw data files to vtk files? If not, any advice on
> > how to get the poligones and normals would be very appreciated.
> > Thank you very much in advance for your help.
> >
> > Patty
> >
> > --
> > Dr Patricia Lozano-Casal
> > Institute for Materials and Processes
> > School of Engineering and Electronics
> > University of Edinburgh
> > Kenneth Denbigh Building
> > The King's Buildings
> > Mayfield Road
> > Edinburgh, EH9 3JL, United Kingdom
> > Phone: ++44 (0)131 650 4859
> > Fax:   ++44 (0)131 650 6551
> > E-mail: P.Lozano-Casal at ed.ac.uk
> >
> > --
> > The University of Edinburgh is a charitable body, registered in
> > Scotland, with registration number SC005336.
> > --
>
> Is your data just points in space? And you want to show those points
> in ParaView?
>
> I might be inclined to try an unstructured grid with only VTK_VERTEX
> as cell types.
>
> <http://www.vtk.org/pdf/file-formats.pdf>  may help you figure out
> what to write. Page 4 explains about the UnstructuredGrid format,
> while there is an example starting at the bottom of page 8.
>
> # Example VTK file for general XYZ data
> # vtk DataFile Version 2.0
> Unstructured Grid Example
> ASCII
> DATASET UNSTRUCTURED_GRID
> POINTS 5 float
> 0.0 0.0 0.0
> 1.0 0.0 0.0
> 2.0 0.0 0.0
> 0.0 1.0 0.0
> 1.0 1.0 0.0
> CELLS 5 10
> 1 0
> 1 1
> 1 2
> 1 3
> 1 4
> CELL_TYPES 5
> 1
> 1
> 1
> 1
> 1
>
> # End VTK File
>
>  I tried the test file as given and it certainly did not like the first line
> which I deleted, and then the file would run and generate 5 points. An error
> message was generated but did not stop the plotting:
>
>  ERROR: In
> C:\berk\ReleaseBuilds\ParaView3\VTK\IO\vtkUnstructuredGridReader.cxx, line
> 350
>
>
> vtkUnstructuredGridReader (05BAC7B0): Unrecognized keyword: #
>  I think this is definitely something that would be a big help to many of us
> that work on XYZ data, if Paraview could automatically load XYZ data without
> the need to compile a separate reformatted structure. Clearly if it is only
> a few data points etc then the file could be done manually, but for more
> complex and large datasets this gets to be a problem.
>
>  Perhaps a stand-alone application could be written to convert from XYZ (or
> even netCDF) formats to ones that Paraview can  load without issue. There
> also appears to be a issue of legacy formats and the newer structures to
> contend with.
>
>  Lester


More information about the ParaView mailing list