<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> pdr = vtk.vtkPolyDataReader()<br> pdr.SetFileName("pd_sphere.vtk")<br> pdr.Update()<br> <br> spr = vtk.vtkStructuredPointsReader()<br> spr.SetFileName("spt.vtk")<br> spr.Update()<br> <br> extractor = vtk.vtkSelectEnclosedPoints()<br> extractor.SetSurface(pdr.GetOutput())<br> extractor.SetInput(spt.GetOutput())<br> extractor.Update()<br><br> 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>> Date: Fri, 21 May 2010 08:18:46 -0400<br>> Subject: Re: [vtkusers] Filter a structured points-space through a 3d-polydata         shape<br>> From: bill.lorensen@gmail.com<br>> To: sapito_verbenero@hotmail.com<br>> CC: karthik.krishnan@kitware.com; vtkusers@vtk.org<br>> <br>> The input point scalars should be passed through. Can you provide a<br>> short example that illustrates the problem?<br>> <br>> Bill<br>> <br>> 2010/5/21 Álvaro González Lorente <sapito_verbenero@hotmail.com>:<br>> > Hello,<br>> ><br>> > Thanks all for your help. It appears that vtkSelectEnclosedPoints has turned<br>> > out to be the best amongst all choices you have told me. However, a problem<br>> > has arised: if the initial values of the points in the Structured Points<br>> > space were from 37.0 to 70.0, the ones that have fallen within the polydata<br>> > 3d shape are now 0.00392157. Any idea why this is happening? I would like<br>> > to keep the original values of those points.<br>> ><br>> ><br>> >> Date: Thu, 20 May 2010 11:05:01 -0400<br>> >> Subject: Re: [vtkusers] Filter a structured points-space through a<br>> >> 3d-polydata shape<br>> >> From: bill.lorensen@gmail.com<br>> >> To: karthik.krishnan@kitware.com<br>> >> CC: sapito_verbenero@hotmail.com; vtkusers@vtk.org<br>> >><br>> >> Here is an example that uses SelectEnclosedPoints:<br>> >> http://www.vtk.org/Wiki/VTK/Examples/PolyData/PointInsideObject<br>> >><br>> >><br>> >> 2010/5/20 Karthik Krishnan <karthik.krishnan@kitware.com>:<br>> >> > 2010/5/20 Álvaro González Lorente <sapito_verbenero@hotmail.com><br>> >> >><br>> >> >> Hello,<br>> >> >><br>> >> >> I have a big structured points space, but not all of its points are of<br>> >> >> my<br>> >> >> interest, only the ones that are within the shape of a polydata<br>> >> >> structure<br>> >> >> (or an unstructured grid too). I wonder if any of you knows if there is<br>> >> >> any<br>> >> >> easy way to filter some particular points which are inside this<br>> >> >> polydata<br>> >> >> contour.<br>> >> >><br>> >> ><br>> >> > What kind of shape ?<br>> >> ><br>> >> > If you have a surface, a closed manifold surface, (only 2D cells), you<br>> >> > can<br>> >> > use vtkSelectEnclosedPoints. It will shoot rays and do intersection<br>> >> > tests to<br>> >> > mark the points inside.<br>> >> ><br>> >> > If you have a generic UGrid, you can either extract the boundary faces,<br>> >> > ensure a closed topology and do the above.<br>> >> ><br>> >> > If you have a volume mesh, for instance tetrahedra, you can use the<br>> >> > FindCell<br>> >> > API on each tet to do the inside tests...<br>> >> ><br>> >> ><br>> >> > --<br>> >> > karthik<br>> >> ><br>> >> ><br>> >> ><br>> >> > _______________________________________________<br>> >> > Powered by www.kitware.com<br>> >> ><br>> >> > Visit other Kitware open-source projects at<br>> >> > http://www.kitware.com/opensource/opensource.html<br>> >> ><br>> >> > Please keep messages on-topic and check the VTK FAQ at:<br>> >> > http://www.vtk.org/Wiki/VTK_FAQ<br>> >> ><br>> >> > Follow this link to subscribe/unsubscribe:<br>> >> > http://www.vtk.org/mailman/listinfo/vtkusers<br>> >> ><br>> >> ><br>> ><br>> > ________________________________<br>> > ¿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>