ParaView/Data formats: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
(3.10/12 includes visit bridge)
Line 183: Line 183:
                 <DataItem Format="Binary"  
                 <DataItem Format="Binary"  
                 DataType="Float" Precision="4" Endian="Big"
                 DataType="Float" Precision="4" Endian="Big"
                 Dimensions="5 500 500">
                 Dimensions="100 500 500">
                     Pf02.bin
                     Pf02.bin
                 </DataItem>
                 </DataItem>

Revision as of 20:16, 19 October 2011

Introduction

This page describes different data formats that ParaView can read and gives guidance over how to use them.

The full list of file formats

The file formats that ParaView understands includes at least the ones described in the in tool help (Help->ParaView->Readers). See http://paraview.org/Wiki/ParaView/Users_Guide/List_of_readers for a listing.

Note that many plugins add new file formats at runtime. Once loaded, new file formats are displayed in the "Files of type" dropdown in the File->Open dialog.

File formats that are readable via plugins distributed with the ParaView source code as of version 3.8 include:

  • NIH Analyze/Nifti
  •  H5part HDF5 Particle files
  •  .tlp tulip graphs
  •  .xml tree structures
  •  netdmf
  •  sql table interface
  •  prism sesame files

CSV (Comma Separated Variable) files

CSV files can be read by ParaView, and are a good quick and dirty format. This data can be converted into points or structured grids. This data is just a number of rows, each row representing a point in space. The columns should include X, Y, Z and any other data. An example follows. Cut and paste this block of data into a file named test.csv.

x coord, y coord, z coord, scalar
0, 0, 0, 0
1, 0, 0, 1
0, 1, 0, 2
1, 1, 0, 3
-0.5, -0.5, 1, 4
0.5, -0.5, 1, 5
-0.5, 0.5, 1, 6
0.5, 0.5, 1, 7

Read a CSV file into Paraview

Start ParaView, and read in this data. Note that the default settings should be used:

    • Detect Numeric Columns ON
    • Use String Delmmiter ON
    • Have Headers ON
    • Field Delimiter Characters should be a comma - ','

The data should show up as a table.

Next, we need to tell ParaView what this data means. There are two ways to do this - as a structured grid or as points.

Displaying data as points

  • Run the filter Filters/ Alphabetical/ Table To Points.
  • Tell ParaView what columns are the X, Y and Z coordinate. Be sure to not skip this step. Apply.
  • ParaView probably didn't open up a 3d window (this is a bug).
    • Split screen Horizontal (Icon, top right).
    • 3D View
    • Turn visibility on for the Table to Points filter (click on the eyeball in the Pipeline Browser)
    • If desired, color by your variable.

Displaying data as structured grid

  • You may want to delete the Table to Points filter listed above.
  • Run the filter Filters/ Alphabetical/ Table To Structured Grid.
  • Tell ParaView what extent, or array sizes, your data is in. For instance, the data above has 8 points, forming a leaning cube. Points arrays are in X == size 2, Y == size 2, and Z == size 2. In this example we will use C indexing for the arrays, thus they go from 0 to 1 (2 entries).
    • Whole extent is as follows:
    • 0 1
    • 0 1
    • 0 1
  • Tell ParaView what columns are the X, Y and Z coordinate. Be sure to not skip this step. Apply.
  • ParaView probably didn't open up a 3d window (this is a bug).
    • Split screen Horizontal (Icon, top right).
    • 3D View
    • Turn visibility on for the Table to Points filter (click on the eyeball in the Pipeline Browser)
    • If desired, change representation to solid, and color by your variable.

Raw files

Raw data files are just just that - a file of one or more varables, in an X by Y by Z layout. The spacial locations of the data points are implicit. Raw data files are a good format for voxel data, or datasets that are huge. The ParaView raw data reader will automatically spread your file among all of the ParaView servers that are running.

An example 2X2X2 file would look like this (obviously, with the data written as binary data):

15 16 17 18 19 20 21 22

It would be represented as follows:

15 16

17 18


19 20

21 22

There are numerous raw files located here: http://www.gris.uni-tuebingen.de/edu/areas/scivis/volren/datasets/datasets.html

Read a Raw file into Paraview

Start ParaView, and read in your raw data. You will need to know the layout of your data. Items that you will need to input:

  • Data Scalar Type - is your data 8 bit, 16 bit, unsigned, etc?
  • Data Byte Order - probably dependent on the machine that wrote it. Probably BigEndian.
  • File Dimensionality. Probably 2 or 3.
  • Data Extent. This needs to be 0 based. Thus, for a cube of data 256X256X256, use a Data Extent of 0-255, 0-255, 0-255. For 2d data, set the last item to 0-0.

Note - for byte sized data, ParaView uses the data itself as a gray scale component. To use the user selected color table, select Display/ Map Scalars.

Reading a time varying Raw file into Paraview

One way to read time varying raw files is to leverage the XDMF meta file format. To do so, put a set of grids that use the binary data storage backend inside a temporal collection. An example file that loads part of the 2004 IEEE Visualization data set is:

<syntaxhighlight lang="xml"> <?xml version="1.0" ?> <!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []> <Xdmf xmlns:xi="http://www.w3.org/2001/XInclude" Version="2.0"> <Domain>

   <Topology name="topo" TopologyType="3DCoRectMesh"
       Dimensions="100 500 500">
   </Topology>
   <Geometry name="geo" Type="ORIGIN_DXDYDZ">
       <DataItem Format="XML" Dimensions="3">
       0.0 0.0 0.0
       </DataItem>
       <DataItem Format="XML" Dimensions="3">
       1.0 1.0 1.0
       </DataItem>
   </Geometry>
   <Grid Name="TimeSeries" GridType="Collection" CollectionType="Temporal">
       
       <Grid Name="T1" GridType="Uniform">
           <Topology Reference="/Xdmf/Domain/Topology[1]"/>
           <Geometry Reference="/Xdmf/Domain/Geometry[1]"/>
           <Attribute Name="CLOUDf" Center="Node">
               <DataItem Format="Binary" 
                DataType="Float" Precision="4" Endian="Big"
                Dimensions="100 500 500">
                   CLOUDf01.bin
               </DataItem>
           </Attribute>
           <Attribute Name="Pf" Center="Node">
               <DataItem Format="Binary" 
                DataType="Float" Precision="4" Endian="Big"
                Dimensions="100 500 500">
                   Pf01.bin
               </DataItem>
           </Attribute>
           <Attribute Name="TCf" Center="Node">
               <DataItem Format="Binary" 
                DataType="Float" Precision="4" Endian="Big"
                Dimensions="100 500 500">
                   TCf01.bin
               </DataItem>
           </Attribute>
           <Attribute Name="Uf" Center="Node">
               <DataItem Format="Binary" 
                DataType="Float" Precision="4" Endian="Big"
                Dimensions="100 500 500">
                   Uf01.bin
               </DataItem>
           </Attribute>
           <Attribute Name="Vf" Center="Node">
               <DataItem Format="Binary" 
                DataType="Float" Precision="4" Endian="Big"
                Dimensions="100 500 500">
                   Vf01.bin
               </DataItem>
           </Attribute>
           <Attribute Name="Wf" Center="Node">
               <DataItem Format="Binary" 
                DataType="Float" Precision="4" Endian="Big"
                Dimensions="100 500 500">
                   Wf01.bin
               </DataItem>
           </Attribute>
       </Grid>
       <Grid Name="T2" GridType="Uniform">
           <Topology Reference="/Xdmf/Domain/Topology[1]"/>
           <Geometry Reference="/Xdmf/Domain/Geometry[1]"/>
           <Attribute Name="CLOUDf" Center="Node">
               <DataItem Format="Binary" 
                DataType="Float" Precision="4" Endian="Big"
                Dimensions="100 500 500">
                   CLOUDf02.bin
               </DataItem>
           </Attribute>
           <Attribute Name="Pf" Center="Node">
               <DataItem Format="Binary" 
                DataType="Float" Precision="4" Endian="Big"
                Dimensions="100 500 500">
                   Pf02.bin
               </DataItem>
           </Attribute>
           <Attribute Name="TCf" Center="Node">
               <DataItem Format="Binary" 
                DataType="Float" Precision="4" Endian="Big"
                Dimensions="100 500 500">
                   TCf02.bin
               </DataItem>
           </Attribute>
           <Attribute Name="Uf" Center="Node">
               <DataItem Format="Binary" 
                DataType="Float" Precision="4" Endian="Big"
                Dimensions="100 500 500">
                   Uf02.bin
               </DataItem>
           </Attribute>
           <Attribute Name="Vf" Center="Node">
               <DataItem Format="Binary" 
                DataType="Float" Precision="4" Endian="Big"
                Dimensions="100 500 500">
                   Vf02.bin
               </DataItem>
           </Attribute>
           <Attribute Name="Wf" Center="Node">
               <DataItem Format="Binary" 
                DataType="Float" Precision="4" Endian="Big"
                Dimensions="100 500 500">
                   Wf02.bin
               </DataItem>
           </Attribute>
       </Grid>
   </Grid>

</Domain> </Xdmf>

</syntaxhighlight>

VTK(Visualization ToolKit) files

VTK file format, along with all of it's relatives, are a preferred format for ParaView. These file formats are fairly complex, but are also very powerful. This file format can be found here: standard VTK file formats. Example files are available upon request.


Acknowledgements

Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy’s National Nuclear Security Administration under contract DE-AC04-94AL85000.