Difference between revisions of "ParaView/Data formats"

From KitwarePublic
Jump to navigationJump to search
Line 69: Line 69:
There are numerous raw files located here: http://www.gris.uni-tuebingen.de/edu/areas/scivis/volren/datasets/datasets.html
There are numerous raw files located here: http://www.gris.uni-tuebingen.de/edu/areas/scivis/volren/datasets/datasets.html


==Read a CSV file into Paraview==
==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:
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 Scalar Type - is your data 8 bit, 16 bit, unsigned, etc?
Line 75: Line 75:
*File Dimensionality.  Probably 2 or 3.
*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.
*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.
==NRRD detached header files for raw data==
Yuo may also create an NRRD header file for your data.
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.


=VTK(Visualization ToolKit) files=
=VTK(Visualization ToolKit) files=

Revision as of 20:08, 3 August 2010

Introduction

This tutorial shows different data formats that ParaView can read. This is no where an exhaustive list, but should help a user get started.

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):

0 1 2 3 4 5 6 7

It would be represented as follows:

0 1

2 3


4 5

6 7

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.

NRRD detached header files for raw data

Yuo may also create an NRRD header file for your data. 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.


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.