<meta http-equiv="content-type" content="text/html; charset=utf-8"><div class="gmail_quote">On Tue, Feb 1, 2011 at 3:16 AM, Ambar C <span dir="ltr"><<a href="mailto:ambarc@gmail.com">ambarc@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<br>
<br>
I'm trying to use the vtkThreshold class to perform thresholding<br>
operations on a data set. I want to extract each point that's a<br>
certain distance away from a given mesh. However, I'm finding it tough<br>
to figure out how to set the constraints that determine which points<br>
get included and which don't.<br>
<br>
The class docs make references to each point in the mesh having a<br>
'scalar' value associated with it over which the thresholding happens.<br>
Despite searching for a while, I couldn't find what these scalars<br>
truly are, or how I could customize them to match the constraint<br>
definitions I'd need.<br>
<br>
Could someone explain the class usage? How are those scalars to be<br>
used? Follow up questions welcome.<br>
<br>
Best,<br>
Ambar<br><br></blockquote><div><br></div><div>You would have to do the computation of the point-to-mesh distance for every point and store it in an array. Then you associate that array with either the PointData or CellData. Then you have to (quite awkwardly) tell the vtkThreshold filter which array to perform the thresholding on. This line sets it to operate on the 'index' array of the CellData:</div>
<div> </div><div> threshold->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, "index");</div><div><br></div><div>See a full example here:</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ThresholdingCells">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ThresholdingCells</a><br clear="all">
<br><div>David </div></div>