<div dir="ltr"><div>Thanks Mike, I can't easily access ITK due to the platform that I develop my software (3D Slicer).</div>I eventually ended up using a vtkPointSource with a radius equal to the Cylinder length and center set to the center of Cylinder and used vtkPointLocator  to scan through cylinder axis and find part of point cloud that is closer to the considered (iterative) point than cylinder radius. By aggregating results of this loop, I could generate a point cloud that is situated inside cylinder. <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 6, 2016 at 1:39 PM, Mike Chinander <span dir="ltr"><<a href="mailto:chinander@gmail.com" target="_blank">chinander@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It's not VTK, but the ITKSpatialObjectToImageFilter (<a href="http://itk.org/Doxygen/html/classitk_1_1SpatialObjectToImageFilter.html" target="_blank">itk.org/Doxygen/html/<wbr>classitk_1_<wbr>1SpatialObjectToImageFilter.<wbr>html</a>) may be useful to you. I think the actual algorithm is similar to what <span style="font-size:12.8px">Chiranjib described. </span>Check out the example: <a href="http://itk.org/Doxygen/html/Examples_2Filtering_2SpatialObjectToImage1_8cxx-example.html" target="_blank">itk.org/Doxygen/html/Examples_<wbr>2Filtering_<wbr>2SpatialObjectToImage1_8cxx-<wbr>example.html</a><div><br></div><div>If you're are checking if  particular point(s) is inside a cylinder, ITK's cylinderSpatialObject (and other spatial object's) has an isInside() method.</div><div><br></div><div><a href="http://itk.org/Doxygen/html/classitk_1_1CylinderSpatialObject.html" target="_blank">itk.org/Doxygen/html/classitk_<wbr>1_1CylinderSpatialObject.html</a><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 6, 2016 at 12:14 PM, Saeed Bakhshmand <span dir="ltr"><<a href="mailto:saeedbakhshmand@gmail.com" target="_blank">saeedbakhshmand@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Chiranjib,<div><br></div><div>I was trying to avoid an implementation as you described, also boundary condition for a constrained cylinder mathematically is not straightforward. I will keep you posted once I solve this.</div><div><br></div><div>Cheers,</div><div>Saeed </div></div><div class="m_-6576722612648542857HOEnZb"><div class="m_-6576722612648542857h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 6, 2016 at 12:49 PM, Chiranjib Sur <span dir="ltr"><<a href="mailto:sur.chiranjib@gmail.com" target="_blank">sur.chiranjib@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Saeed,<div>there is no ready made solution available ( atleast I am not aware of). You can implement the solution in the following way</div><div><br></div><div>1. Consider the cylinder is within a cubic volume for which you know the bounds</div><div>2. Generate points of your desired resolution on a 3d grid for the entire cube (this will be on a regular grid)</div><div>3. Consider the boundary condition for cylinder and create an array of "vtkpoints" after step 2</div><div>4. This boundary condition can give you option to create point inside or outside of your cylinder</div><div><br></div><div>Here is an example which you can look   to understand how to determine inside outside of the closed surface</div><div><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointInsideObject" target="_blank">http://www.vtk.org/Wiki/VTK/Ex<wbr>amples/Cxx/PolyData/PointInsid<wbr>eObject</a><br></div><div><br></div><div>Hope that helps,</div><div>Chiranjib</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-6576722612648542857m_-4369040001545611574h5">On Tue, Dec 6, 2016 at 10:15 PM, Saeed Bakhshmand <span dir="ltr"><<a href="mailto:saeedbakhshmand@gmail.com" target="_blank">saeedbakhshmand@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-6576722612648542857m_-4369040001545611574h5"><div dir="ltr">Hello,<div><br></div><div>I am trying to generate a list of points that lay inside an object (such as cylinder) and have no success finding the right method and would appreciate any hints.</div><div><br></div><div>Best,</div><div>Saeed</div></div>
<br></div></div>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>