[vtkusers] Reading 2 or more attributes per grid point onto uniform rectilinear grid.

David E DeMarle dave.demarle at kitware.com
Fri Oct 21 08:34:37 EDT 2011


Put it in the FIELD DATA. Besides googling for vtk file formats I find it
helpful to generate small datasets in paraview to decipher the syntax.

Here is a sample, which I created in ParaView by making a 2x2x2 wavelet,
applying the calculator with the expression "coordsX" to make the second
point associated array, and then saving as a legacy ascii vtk file.

# vtk DataFile Version 3.0
vtk output
ASCII
DATASET STRUCTURED_POINTS
DIMENSIONS 3 3 3
SPACING 1 1 1
ORIGIN 0 0 0
POINT_DATA 27
SCALARS Result double
LOOKUP_TABLE default
0 1 2 0 1 2 0 1 2
0 1 2 0 1 2 0 1 2
0 1 2 0 1 2 0 1 2

FIELD FieldData 1
RTData 1 27 float
260 169.546 42.5586 147.96 96.9844 17.2746 57.2951 53.5966 30.5032
156.706 105.73 26.0202 84.1445 57.1137 6.07904 40.7567 42.401 25.7059
31.1758 27.4773 4.3839 5.8918 7.53615 -9.15897 19.1204 27.163 18.1301

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Thu, Oct 20, 2011 at 5:19 PM, Gaurish Telang <gaurish108 at gmail.com>wrote:

> Hello,
>
> I have a uniform rectangular grid on a cubical bounding box with N points
>  placed along each dimension.  For each of the N^3 grid points I have 2 or
> more attributes like pressure, density.
>  MY vtk file for the simple case of the box [0,2]x[0,2]x[0,2] with spacing
> 1 (=> 8 grid points) is as follows.
>
> # vtk DataFile Version 2.0
> Test file.
> ASCII
>
> DATASET STRUCTURED_POINTS
> DIMENSIONS    2    2   2
> ORIGIN    0.000   0.000   0.000
> SPACING    1.000   1.000   4.000
>
> POINT_DATA   8
>  SCALARS density float
> LOOKUP_TABLE default
>
>
> 1.2   2.3  3.3  4.5
> 5.4   6.6  7.7  8.8
>
>
> POINT_DATA   8
> SCALARS pressure float
> LOOKUP_TABLE default
>
>
> 1.2  3.4  5.6  7.8
> 5.6  7.8  8.9  1.2
>
> The part related to the pressure is not  being accepted by the Paraview
> software. I get the following error
>
> ERROR: In
> /home/kitware/Dashboards/MyTests/ParaView-master/source/VTK/IO/vtkDataReader.cxx,
> line 915
>
> vtkStructuredPointsReader (0xa698438): Unsupported point attribute type:
> point_data for file:
> /home/gaurish108/Desktop/TongfeiFileReadPRactice/test.vtk
>
>
> However the density information is being accepted and read by Paraview.
> Being new to VTK file format I think I am not writing the pressure
> information correctly.
>
> Please let me know how to rectify this.
>
>
>
> Thank you!
>
>
> Gaurish Telang
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111021/6ca575ed/attachment.htm>


More information about the vtkusers mailing list