<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Yes. What I exactly have is a structured point space with values that go from 37.0 to 70.0. I don't want them all, only the ones that would fall inside a sphere (for example). So the code would go like that:<br><br><i>&nbsp;&nbsp;&nbsp; pdr = vtk.vtkPolyDataReader()<br>&nbsp;&nbsp;&nbsp; pdr.SetFileName("pd_sphere.vtk")<br>&nbsp;&nbsp;&nbsp; pdr.Update()<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; spr = vtk.vtkStructuredPointsReader()<br>&nbsp;&nbsp;&nbsp; spr.SetFileName("spt.vtk")<br>&nbsp;&nbsp;&nbsp; spr.Update()<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; extractor = vtk.vtkSelectEnclosedPoints()<br>&nbsp;&nbsp;&nbsp; extractor.SetSurface(pdr.GetOutput())<br>&nbsp;&nbsp;&nbsp; extractor.SetInput(spt.GetOutput())<br>&nbsp;&nbsp;&nbsp; extractor.Update()<br><br>&nbsp;&nbsp;&nbsp; op = extractor.GetOutput()</i><br><br>After writing the output with the vtkStructuredPointWriter, I get a file where the points that have value different than 0 (which are exactly the ones within the sphere) have a value equal to 0.00392157, instead of 37.0-70.0. That is exactly the problem, hope I made my self enough clear. Thanks.<br><br>&gt; Date: Fri, 21 May 2010 08:18:46 -0400<br>&gt; Subject: Re: [vtkusers] Filter a structured points-space through a 3d-polydata         shape<br>&gt; From: bill.lorensen@gmail.com<br>&gt; To: sapito_verbenero@hotmail.com<br>&gt; CC: karthik.krishnan@kitware.com; vtkusers@vtk.org<br>&gt; <br>&gt; The input point scalars should be passed through. Can you provide a<br>&gt; short example that illustrates the problem?<br>&gt; <br>&gt; Bill<br>&gt; <br>&gt; 2010/5/21 Álvaro González Lorente &lt;sapito_verbenero@hotmail.com&gt;:<br>&gt; &gt; Hello,<br>&gt; &gt;<br>&gt; &gt; Thanks all for your help. It appears that vtkSelectEnclosedPoints has turned<br>&gt; &gt; out to be the best amongst all choices you have told me. However, a problem<br>&gt; &gt; has arised: if the initial values of the points in the Structured Points<br>&gt; &gt; space were from 37.0 to 70.0, the ones that have fallen within the polydata<br>&gt; &gt; 3d shape are now&nbsp; 0.00392157. Any idea why this is happening? I would like<br>&gt; &gt; to keep the original values of those points.<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;&gt; Date: Thu, 20 May 2010 11:05:01 -0400<br>&gt; &gt;&gt; Subject: Re: [vtkusers] Filter a structured points-space through a<br>&gt; &gt;&gt; 3d-polydata shape<br>&gt; &gt;&gt; From: bill.lorensen@gmail.com<br>&gt; &gt;&gt; To: karthik.krishnan@kitware.com<br>&gt; &gt;&gt; CC: sapito_verbenero@hotmail.com; vtkusers@vtk.org<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Here is an example that uses SelectEnclosedPoints:<br>&gt; &gt;&gt; http://www.vtk.org/Wiki/VTK/Examples/PolyData/PointInsideObject<br>&gt; &gt;&gt;<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; 2010/5/20 Karthik Krishnan &lt;karthik.krishnan@kitware.com&gt;:<br>&gt; &gt;&gt; &gt; 2010/5/20 Álvaro González Lorente &lt;sapito_verbenero@hotmail.com&gt;<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; Hello,<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; I have a big structured points space, but not all of its points are of<br>&gt; &gt;&gt; &gt;&gt; my<br>&gt; &gt;&gt; &gt;&gt; interest, only the ones that are within the shape of a polydata<br>&gt; &gt;&gt; &gt;&gt; structure<br>&gt; &gt;&gt; &gt;&gt; (or an unstructured grid too). I wonder if any of you knows if there is<br>&gt; &gt;&gt; &gt;&gt; any<br>&gt; &gt;&gt; &gt;&gt; easy way to filter some particular points which are inside this<br>&gt; &gt;&gt; &gt;&gt; polydata<br>&gt; &gt;&gt; &gt;&gt; contour.<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; What kind of shape ?<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; If you have a surface, a closed manifold surface, (only 2D cells), you<br>&gt; &gt;&gt; &gt; can<br>&gt; &gt;&gt; &gt; use vtkSelectEnclosedPoints. It will shoot rays and do intersection<br>&gt; &gt;&gt; &gt; tests to<br>&gt; &gt;&gt; &gt; mark the points inside.<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; If you have a generic UGrid, you can either extract the boundary faces,<br>&gt; &gt;&gt; &gt; ensure a closed topology and do the above.<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; If you have a volume mesh, for instance tetrahedra, you can use the<br>&gt; &gt;&gt; &gt; FindCell<br>&gt; &gt;&gt; &gt; API on each tet to do the inside tests...<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; --<br>&gt; &gt;&gt; &gt; karthik<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; _______________________________________________<br>&gt; &gt;&gt; &gt; Powered by www.kitware.com<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Visit other Kitware open-source projects at<br>&gt; &gt;&gt; &gt; http://www.kitware.com/opensource/opensource.html<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Please keep messages on-topic and check the VTK FAQ at:<br>&gt; &gt;&gt; &gt; http://www.vtk.org/Wiki/VTK_FAQ<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br>&gt; &gt;&gt; &gt; http://www.vtk.org/mailman/listinfo/vtkusers<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; ________________________________<br>&gt; &gt; ¿Sabes que La Gente de Hoy tiene GUARDAESPALDAS contra el Spam?<br>                                               <br /><hr />"Del lado oscuro de Internet protegido estar puedes." <a href='http://www.quelafuerzateacompañe.com' target='_new'>¡Descárgate gratis Internet Explorer 8!</a></body>
</html>