[vtkusers] vtkStructuredPoints

Vijayendra Munikoti munikoti.vijayendra at bam.de
Tue Mar 16 09:07:14 EST 2004


Hallo
I have a question:
I have read NetCDF file containing two dimensional data (128 x 128). The
Python code
is as follows:

>>>from vtkpython import *
>>>from Tkinter import *
>>>from pycdf import *
>>>from Numeric import *
>>>import scipy
>>>import pyvtk
>>>z1 = reshape(transpose(dat), (-1,)) ; dat is the 2D array read from *.nc
file
>>>point_data = pyvtk.PointData (pyvtk.Scalars(z1))
>>>grid = pyvtk.StructuredPoints ((128,128,1),(0.0,0.0,0.0),(1,1,1))
>>>data = pyvtk.VtkData (grid, point_data)

I am able to visualize the data by writing first into a *.vtk file
(data.tofile 'test.vtk') and
reading it by StructuredPointsReader

>>>reader = vtkStructuredPointsReader()
>>>reader.SetFileName(filename)
..............................
..............................

But, I want to visualize the data without writing into a *.vtk file. Could
anyone tell me how I should go about it ?

Thanking you
V. Munikoti 16.04.04 @ 15:05










More information about the vtkusers mailing list