newbie ?: How do I store & read scalar value in a vtk format file ?

Pieper, Chris cpieper at kcc.com
Thu Aug 26 11:30:21 EDT 1999


I have a vtk format file containing PolyData (points & lines) which is
working fine.  I'd like to add a single scalar attribute.  My guess at the
format to use is;

SCALARS my_scalars_name float
2.1e-2

This may or may not be correct (1st question)...

The 2nd question is how do I read it? I read the PolyData using
PolyDataReader, but how can I get the scalar value?

I've tried;

vtkScalars *scalars = vtkScalars::New();

vtkDataReader *datareader = vtkDataReader::New();
	datareader->SetFileName("my_vtk_file");
	datareader->SetScalersName("my_scalars_name");
	datareader->Read(scalars);

obviously, this is wrong...   I'm a newbie to vtk and OOP, so don't laugh
too hard please...

Thanks for any help you may be able to offer.


Chris Pieper
cpieper at kcc.com
v: 920-721-4037
f: 920-721-8471




-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list