[vtkusers] python: GetNumberOfScalarsInFile identify only one scalar instead of four in binary Legacy vtk

Jean-Christophe loiseau at mech.kth.se
Thu Dec 17 08:45:51 EST 2015


Hej,

I have tried to look through the archives of the mailing-list but 
couldn't find an answer to my problem.

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

    import numpy as np
    import vtk

    reader = vtk.vtkStructuredPointReader()
    reader.SetFileName(filename)
    reader.ReadAllScalarsOn()
    reader.Update()
    reader.GetNumberOfScalarsInFile()


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?

Regards,
JC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151217/699fb7a5/attachment.html>


More information about the vtkusers mailing list