<div>Hello Amy & NG,</div>
<div> </div>
<div> thank you very much for your answer, yes, effectively, calling Update() shows me the right number of cells... now I have just to figure out why in the world I am getting duplicate cells...</div>
<div> </div>
<div>Thank you very much Amy.</div>
<div> </div>
<div>Andrea.<br><br> </div>
<div><span class="gmail_quote">On 4/4/06, <b class="gmail_sendername">Amy Squillacote</b> <<a href="mailto:amy.squillacote@kitware.com">amy.squillacote@kitware.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div style="DIRECTION: ltr"><span class="e" id="q_10a6597a58f322ca_0">At 11:42 AM 4/4/2006, Andrea Gavana wrote:<br>
<blockquote cite="http://" type="cite">Hello NG,<br> <br> I am sorry to bother you again with dumb questions, but I have some doubt about the way I am using vtkThresold right now...<br>I have a vtkUnstructuredGrid called "grid", a mapper called "surfaceMapper" and an actor "surfaceActor". The grid is already displayed on a VTK window. Now, suppose that the user changes the property he wishes to view, and this property should be filtered by means of another property. This is what I do:
<br> <br># Create the threshold<br>threshold = vtk.vtkThreshold()<br> <br># Give as input my vtkUnstructuredGrid<br>threshold.SetInput(thresh)<br> <br># Give the array on which performing the threshold<br>threshold.SetInputArrayToProcess
(0, 0, 0, 1, "ACTNUM")<br> <br># Do the thresholding<br>threshold.ThresholdBetween(1, 100)<br> <br># Get the output<br>thresh = threshold.GetOutput()<br># Do the rendering things...<br># IS THIS CORRECT???<br>#<br>
<br>surfaceMapper.SetInput(thresh)<br>data_range = grid.GetScalarRange()<br>surfaceMapper.SetScalarRange(data_range)<br>surfaceMapper.SetResolveCoincidentTopologyToPolygonOffset()<br> <br># Refresh the wxPython frame (also Render() the surfaceActor)
<br>MyFrame.Refresh()<br> <br>If there is no filter to do, I simply change the line:<br> <br>surfaceMapper.SetInput(thresh)<br> <br>With:<br> <br>surfaceMapper.SetInput(grid)<br> <br>Now, apart of the problem of duplicated cells (which should be filtered out using the threshold, so they should be invisible), every time I do:
<br> <br>thresh.GetNumberOfCells()<br> <br></blockquote><br></span></div>
<div style="DIRECTION: ltr">Where are you making the above call? Most likely the pipeline is not up-to-date when you are calling GetNumberOfCells on the vtkThreshold filter. Try calling Update() on this filter before calling GetNumberOfCells().
<br><br>- Amy<br><br>
<blockquote cite="http://" type="cite"></blockquote></div>
<div style="DIRECTION: ltr"><span class="q">I get 0 (zero). Well, it seems to me (if I have read correctly the docs) that vtkThreshold should return a vtkUnstructuredGrid. Well, how comes that this output has no cells? The code seems to work and to display the right thing (thresholded OK) until I zoom and rotate...
<br> <br>Thank you for your suggestions.<br> <br>Andrea.<br> <br><br>-- <br>"Imagination Is The Only Weapon In The War Against Reality."<br><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://xoomer.virgilio.it/infinity77/" target="_blank">
http://xoomer.virgilio.it/infinity77/</a><br> <br></span></div>
<div style="DIRECTION: ltr">_______________________________________________<br>This is the private VTK discussion list. <br>Please keep messages on-topic. Check the FAQ at: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers
</a>
<blockquote></blockquote></div></blockquote></div><br><br clear="all"><br>-- <br>"Imagination Is The Only Weapon In The War Against Reality."<br><br><a href="http://xoomer.virgilio.it/infinity77/">http://xoomer.virgilio.it/infinity77/
</a><br>