<div dir="ltr"><div>Instead of GetNumberOfScalarsInFile() try reader.GetOutput().GetPointData().GetNumberOfArrays() and GetCellData().GetNumberOfArrays(). You can also get the number of single component arrays.<br></div><div><br></div><div>In VTK the scalar designation (see vtkDataSetAttributes) is sort of an anachronism. The "Active" Scalar array designation marks one array as the default that filters will operate on if they aren't told specifically what array to work with.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div></div>
<br><div class="gmail_quote">On Thu, Dec 17, 2015 at 8:45 AM, Jean-Christophe <span dir="ltr"><<a href="mailto:loiseau@mech.kth.se" target="_blank">loiseau@mech.kth.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div lang="x-unicode"> Hej,<br>
<br>
I have tried to look through the archives of the mailing-list but
couldn't find an answer to my problem.<br>
<br>
A colleague of mine gave me a bunch of binary Legacy vtk files.
They are structured points with 4 scalars. Here is how I try to
read them in python<br>
<br>
<blockquote>import numpy as np<br>
import vtk<br>
<br>
reader = vtk.vtkStructuredPointReader()<br>
reader.SetFileName(filename)<br>
reader.ReadAllScalarsOn()<br>
reader.Update()<br>
reader.GetNumberOfScalarsInFile()<br>
</blockquote>
<br>
When I execute the last command, it returns that there is only one
single scalar in my file though I actually have four of them.
Would anyone have an idea of what is going on and how I could fix
this?<br>
<br>
Regards,<br>
JC<br>
</div>
</div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>