[vtkusers] Differences in DataFile Versions?
Michael Schmitt
schmitt at icom-consulting.de
Fri Mar 15 10:11:22 EST 2002
Hi,
I've got an application reading in VTK Datafiles Version 2.
As the file size is quite big I'd like to use files in binary format.
After converting a file I got an error at this line when reading in the
data:
set range [[[[reader GetOutput] GetPointData] GetScalars] GetRange]
Now 'GetRange' causes the error 'invalid command name "" '.
This error appears after writing out the file in VTK Datafile Version
3.0, and it's the same for binary or ASCII format.
Here is the code I used:
------
vtkRectilinearGridReader rectreader
rectreader SetFileName "mytestfile.vtk"
vtkRectilinearGridWriter rectwriter
rectwriter SetFileName "myoutputfile.vtk"
rectwriter SetInput [rectreader GetOutput]
# rectwriter SetFileTypeToBinary
rectwriter Write
---------
mytestfile:
-----------
# vtk DataFile Version 2.0
Sample rectilinear grid
ASCII
DATASET RECTILINEAR_GRID
DIMENSIONS 140 50 43
X_COORDINATES 140 double
1.000004E-01 2.000008E-01 4.000006E-01 6.000003E-01 8.000002E-01
1.000000E+00
1.150000E+00 1.300000E+00 1.450000E+00 1.600000E+00 1.733333E+00
1.866667E+00
2.000000E+00 2.150000E+00 2.300000E+00 2.449999E+00 2.600000E+00
2.749999E+00
....
myoutputfile:
-------------
# vtk DataFile Version 3.0
vtk output
ASCII
DATASET RECTILINEAR_GRID
DIMENSIONS 140 50 43
X_COORDINATES 140 double
0.1 0.200001 0.400001 0.6 0.8 1 1.15 1.3 1.45
1.6 1.73333 1.86667 2 2.15 2.3 2.45 2.6 2.75
2.9 3.08571 3.27143 3.45714 3.64286 3.82857 4.01429 4.2 4.33333
....
Could anybody give me a hint, please?
Thanks!
Michael
More information about the vtkusers
mailing list