[vtkusers] File building

Kyle Johnson krj at seas.upenn.edu
Thu Jul 28 15:15:22 EDT 2005



I am trying to use Python to write a script that reads in a data file and
produces a vtk file.  The data file has its data stored as follows:

Caption for ordering: (Lx =256, Ly=256, Lz=124)
-----------------------------
(0,0,0),(1,0,0) ... (Lx, 0,0)
(0,1,0),(1,1,0).....(Lx,1,0)
..
(0,Ly,0),(1,Ly,0)....(Lx,Ly,0)

(0,0,1),(1,0,1) ... (Lx, 0,1)
(0,1,1),(1,1,1).....(Lx,1,1)
...
(0,Ly,1),(1,Ly,1)....(Lx,Ly,1)
.......
.......
(0,0,Lz),(1,0,Lz)....(Lx,0,Lz)
(0,1,Lz),(1,1,Lz) ... (Lx, 1,Lz)
..
(0,Ly,Lz),(1,Ly,Lz).....(Lx,Ly,Lz)

Basically, I just write in the requirements for Binary StructuredPoints with
dimensions 256, 256, 124.  The scalars seem to be unsigned_char scalars.  So I
just read the input file and write it to the ouput file with no change in the
ordering.  Is that right?  I tried to read the file formats on the vtk website
but the example for structuredpoints did not make much sense to me.  It lists
out the 72 points but with no apparent order.

Any help would be greatly appreciated,
Kyle



More information about the vtkusers mailing list