<div dir="ltr"><div>I want to read a VTR file and work with its data. In my case it has 3 Components, </div><div><br></div><div>source = XMLRectilinearGridReader(FileName=['test.vtr'])</div><div>arrayName = 'M'</div><div>arrayComponents = 3</div><div>data = source.GetCellDataInformation()</div><div>array = data.GetArray(arrayName)</div><div>dataRange = array.GetRange(component)</div><div>FieldData = source.GetFieldData()</div><div>print FieldData</div><div><br></div><div>gives me:</div><div><p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)">vtkPVDataSetAttributesInformation (000000000EAE6FC0)</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> Debug: Off</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> Modified Time: 1066787</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> Reference Count: 2</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> Registered Events: (none)</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> RootOnly: 0</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> ArrayInformation, number of arrays: 1</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> Debug: Off</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> Modified Time: 1068264</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> Reference Count: 1</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> Registered Events: (none)</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> RootOnly: 0</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> Name: M</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> DataType: 11</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> NumberOfComponents: 3</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> NumberOfTuples: 2500000</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> IsPartial: 0</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> Ranges :</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> 0, 1.53585e+006</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> -1.53585e+006, 1.53585e+006</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> -1.53585e+006, 1.53585e+006</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> -306523, 1.53393e+006</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> InformationKeys :</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> vtkAbstractArray::PER_COMPONENT</span></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> vtkDataArray::L2_NORM_RANGE</span></p>
<p style="margin:0px;font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"><br></p>
<p style="margin:0px"><span style="font-family:Courier;font-size:8.25pt;color:rgb(0,150,0)"> SortArrays: 1</span></p></div><div><br></div><div>Now I would like to access this data, best case for me would be if I can use it in numpy, with the </div><div><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(0,0,139);background-color:rgb(238,238,238)"><br></span></div><div><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(0,0,139);background-color:rgb(238,238,238)">from</span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(0,0,0);background-color:rgb(238,238,238)"> vtk</span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(0,0,0);background-color:rgb(238,238,238)">.</span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(0,0,0);background-color:rgb(238,238,238)">util</span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(0,0,0);background-color:rgb(238,238,238)">.</span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(0,0,0);background-color:rgb(238,238,238)">numpy_support </span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(0,0,139);background-color:rgb(238,238,238)">import</span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(0,0,0);background-color:rgb(238,238,238)"> vtk_to_numpy</span></div><div><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(0,0,0);background-color:rgb(238,238,238)"><br></span></div><div>methods... </div><div><br></div><div>Or should I work with a Programmable Filter Option instead?</div><div><br></div><div>Thanks</div><div>Richard</div></div>