<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Works like a charm Berk!
<div><br>
</div>
<div>Since yesterday, I've changed my original output to be xmlunstructured. Can you tell me why I don't need the reader.ReadAllScalarsOn() to catch all the arrays when the input file is xml, but I do need it in ascii?</div>
<div><br>
</div>
<div>Thanks for your help!</div>
<div><br>
</div>
<div>Justin<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF896143" style="direction: ltr; "><font face="Tahoma" size="2" color="#000000"><b>From:</b> Berk Geveci [berk.geveci@kitware.com]<br>
<b>Sent:</b> Friday, May 10, 2013 11:42 AM<br>
<b>To:</b> Justin Pogacnik<br>
<b>Cc:</b> vtkusers@vtk.org<br>
<b>Subject:</b> Re: [vtkusers] Point data with vtkUnstructuredGridReader<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">You need something like:
<div><br>
</div>
<div>
<div> reader->ReadAllScalarsOn();</div>
<div> reader->ReadAllVectorsOn();</div>
<div> reader->ReadAllNormalsOn();</div>
<div> reader->ReadAllTensorsOn();</div>
<div> reader->ReadAllColorScalarsOn();</div>
<div> reader->ReadAllTCoordsOn();</div>
<div> reader->ReadAllFieldsOn();</div>
<div><br>
</div>
<div style="">Translate to Python and adjust to taste.</div>
<div> </div>
</div>
<div style="">-berk</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Wed, May 8, 2013 at 9:37 PM, Justin Pogacnik <span dir="ltr">
<<a href="mailto:j.pogacnik@auckland.ac.nz" target="_blank">j.pogacnik@auckland.ac.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-size:10pt; font-family:Tahoma">Hi all,
<div><br>
</div>
<div>I'm trying to use Python to read an unstructured grid file (vtk format) that I wrote for output from a research code. The vtk file loads fine in Paraview, so it should be in order.</div>
<div><br>
</div>
<div>The vtk file has 7 scalar arrays of point data and one vector array of point data. However, when I print the point data, only 2 arrays are found -- the first scalar array (elementID) and the last (only) vector array (permeability). </div>
<div><br>
</div>
<div>Here is the essential part of my python script:</div>
<div>
<div>from vtk import *</div>
<div><br>
</div>
<div>filename = 'VTKoutput/FEHM_mesh4_2.vtk'</div>
<div><br>
</div>
<div>vtkgrid = vtkUnstructuredGridReader()</div>
<div>name = vtkgrid.SetFileName(filename)</div>
<div>vtkgrid.Update()</div>
<div><br>
</div>
<div>print vtkgrid.GetOutput().GetPointData()</div>
</div>
<div><br>
</div>
<div>I'm happy to pass along the small test vtk file too if it'd be helpful. Also, I'm running vtk-5.10 on Mac OSX 10.7.5.</div>
<div><br>
</div>
<div>Thanks in advance,</div>
<div><br>
</div>
<div>Justin</div>
</div>
</div>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" 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" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>