[vtkusers] VTK XML File Format, Only read Header

Henry Lehmann henry.lehmann at informatik.tu-freiberg.de
Thu Aug 15 05:43:19 EDT 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

i try to only read which point/cell arrays are available in, for
example, an .vti file. I dont want to read the entire file.
I use the following code:

vtkNew<vtkXMLImageDataReader> reader;
reader->SetFileName("abc.vti");
vtkDataArraySelection* point_sel = reader->GetPointDataArraySelection();
//reader->Update();
int n0 = point_sel->GetNumberOfArrays();
int n1 = reader->GetNumberOfPointArrays();
int n2 = reader->GetNumberOfCellArrays();
cout << n0 << endl;
cout << n1 << endl;
cout << n2 << endl;

The output is

0
0
0

but there are 2 point arrays in the file. When removing the comment
and invoking Update() the arrays are shown.

How can i get information of the arrays without reading the whole
file, like Update() does?

Best regards,
Henry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSDKK3AAoJEM0zIsxevdB27tQIAJUUwajnJpa0A6quOj3T9frF
cOkoSyVg8rP3AAFA/L3MHIWy0VdjZlOXYADzZ/dj1gBuZytXzPpCvn+bJz33gW7R
k3dQL7WjHdvcIwzd/Vvc07hCrsclBffT3aL30r1qh9EveDXbErUXJVn3wg5pm8Nr
ZwNDjn0y7MJhIif9vGQzuLK4Vwis3lWWDGwc3A/K1w3fyHRuoe1gaSBBon+7V2TU
FTwYyA42j7KC1sezIE7261Qw5gNeI0v32SsHhfQTWAT6oXyVtDGn7h6NCukk0owR
2hMK1dijy9S+l5vmuSVDIt1CZzN/f5nSJ0QgKO7a44BcGtTD045MVzcP+FOi7sQ=
=Rgl8
-----END PGP SIGNATURE-----



More information about the vtkusers mailing list