<div class="gmail_quote">On Wed, Feb 15, 2012 at 11:38 AM, bberkowi <span dir="ltr">&lt;<a href="mailto:benjamin-berkowitz@uiowa.edu">benjamin-berkowitz@uiowa.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
OK, so if anyone can just help in general, it doesn&#39;t have to be with Python<br>
syntax (but it would be helpful).  This is what I have so far, and it&#39;s not<br>
working:<br>
<br>
    distanceMapper.Surface.GetPointData().SetActiveScalars(&#39;Scalars_&#39;)<br>
    distanceArray = distanceMapper.Surface.GetPointData().GetScalars()<br>
<br>
    #print &#39;DISTANCE SURFACE:&#39;,  distanceMapper.Surface<br>
<br>
    print &#39;DISTANCE ARRAY:&#39;,  distanceArray<br>
    tuple = []<br>
    tuple = distanceArray.GetTuple(0)<br>
    print tuple<br>
<br>
and GetTuple() doesn&#39;t work.  It returns an error, &quot;Traceback (most recent<br>
call last):<br>
  File &quot;VTK_testing.py&quot;, line 80, in &lt;module&gt;<br>
    tuple = distanceArray.GetTuple(0)<br>
AttributeError: GetTuple&quot;<br></blockquote><div><br></div>If you don&#39;t know what type to expect, then you have to assume double (that is how VTK works):</div><div class="gmail_quote"><br></div><div class="gmail_quote">
vtkDataArray* array = polydata-&gt;GetCellData()-&gt;GetScalars();</div><div class="gmail_quote">double value[array-&gt;GetNumberOfComponents()];</div><div class="gmail_quote">array-&gt;GetTupleValue(value);</div><div class="gmail_quote">
<br></div><div class="gmail_quote">If you do know what type to expect, you can use that type:</div><div class="gmail_quote"><br></div><div class="gmail_quote">vtkIntArray* array = vtkIntArray::SafeDownCast(polydata-&gt;GetCellData()-&gt;GetScalars());</div>
<div class="gmail_quote"><div class="gmail_quote">int value[array-&gt;GetNumberOfComponents()];</div><div class="gmail_quote">array-&gt;GetTupleValue(value);</div><div class="gmail_quote"><br></div><div class="gmail_quote">
Deleting the cells is a whole separate problem entirely - I think the accepted practice is just to flag which ones you want to delete and recreate the topology only using those cells (skipping adding the ones that you wanted to delete). You can also use something like <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractSelectionCells">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractSelectionCells</a> but the syntax gets very confusing.</div>
<div class="gmail_quote"><br></div><div>David </div></div>