[Paraview] Get XMLRectilinearGridReader Data into a numpy array
no name
keinepostnurmuell at gmail.com
Tue Sep 22 05:46:06 EDT 2015
I want to read a VTR file and work with its data. In my case it has 3
Components,
source = XMLRectilinearGridReader(FileName=['test.vtr'])
arrayName = 'M'
arrayComponents = 3
data = source.GetCellDataInformation()
array = data.GetArray(arrayName)
dataRange = array.GetRange(component)
FieldData = source.GetFieldData()
print FieldData
gives me:
vtkPVDataSetAttributesInformation (000000000EAE6FC0)
Debug: Off
Modified Time: 1066787
Reference Count: 2
Registered Events: (none)
RootOnly: 0
ArrayInformation, number of arrays: 1
Debug: Off
Modified Time: 1068264
Reference Count: 1
Registered Events: (none)
RootOnly: 0
Name: M
DataType: 11
NumberOfComponents: 3
NumberOfTuples: 2500000
IsPartial: 0
Ranges :
0, 1.53585e+006
-1.53585e+006, 1.53585e+006
-1.53585e+006, 1.53585e+006
-306523, 1.53393e+006
InformationKeys :
vtkAbstractArray::PER_COMPONENT
vtkDataArray::L2_NORM_RANGE
SortArrays: 1
Now I would like to access this data, best case for me would be if I can
use it in numpy, with the
from vtk.util.numpy_support import vtk_to_numpy
methods...
Or should I work with a Programmable Filter Option instead?
Thanks
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150922/51c802fe/attachment.html>
More information about the ParaView
mailing list