[vtkusers] HDF5 with VTK

Dominik Szczerba domi at vision.ee.ethz.ch
Tue Jan 22 17:01:14 EST 2008


Exporting data to legacy formats is an option if you 1) just want to see it, 
never read back 2) have plenty space to waste to keep your data in an extra 
format. Using VTK to store CFD data you are going to read back later will 
require you use VTK in your CFD code. I would not recommend it.

As pointed out before, hdf5 does not specify too much and this freedom can be 
as much of an adventage as of a handicap. E.g. it is not instantly possible 
to import hdf5 files into anywhere unless you make agreements how to name 
things, e.g. points, data etc. But that way you can virtually import 
everything.

I need to both see the data and use it later, and I don't want to store the 
same data in two formats. I have written my own hdf5 reader and writer for 
unstructured grids. I can specify name of relevant datasets 
(e.g. "connectivity" or "cells" or "points" etc.) and field data names, so it 
is quite flexible.

-- Dominik

On Tuesday 22 January 2008 17.49:27 Mike Jackson wrote:
> So basically, you need to read the data from the HDF5 file and render  
> that using VTK. This can be done for your dataset but you will need  
> to write the conversion code. The basic outline would be something like.
> 
> Read a timestep of HDF5 data into memory (assuming it will fit)
> Instantiate the appropriate vtk object (would vtkImage be appropriate  
> or vtkStructuredGrid?)
> copy all the data to the vtk object creating scalar and vector  
> attributes as needed.
> save the resulting file to a vtk file (vtkXML....Writer)
> 
> View data in ParaView  (or vtk for that matter).
> 
> Does this help?
> 
> On Jan 22, 2008, at 11:18 AM, Ogedengbe, Emmanuel wrote:
> 
> > After installation of VTK for use with purely C++ on windows, I  
> > have been struggling with how to get started with reading my CFD  
> > datasets for visualization. I have done some research with HDF5 but  
> > having problem with having to go into increasing number of third  
> > party software and libraries. Recently, I learnt that H5utils can  
> > convert HDF5 datasets into the formats required by other free  
> > visualization software like VTK. But it’s only for UNIX systems,  
> > though it appears help can come from CygWin .
> >
> > Can anyone help? I just want to visualize simple 2D/3D grid-based  
> > scalar and vector flow fields simulated with my native codes.
> >
> >
> > Thanks in anticipation
> >
> > Emmanuel
> >
> 
> 
> 



-- 
Dominik Szczerba, Ph.D.
Computer Vision Lab CH-8092 Zurich
http://www.vision.ee.ethz.ch/~domi



More information about the vtkusers mailing list