[vtkusers] Points inside a Cylinder

Saeed Bakhshmand saeedbakhshmand at gmail.com
Wed Dec 7 15:28:39 EST 2016


Thanks Mike, I can't easily access ITK due to the platform that I develop
my software (3D Slicer).
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.

On Tue, Dec 6, 2016 at 1:39 PM, Mike Chinander <chinander at gmail.com> wrote:

> It's not VTK, but the ITKSpatialObjectToImageFilter (itk.org/Doxygen/html/
> classitk_1_1SpatialObjectToImageFilter.html) may be useful to you. I
> think the actual algorithm is similar to what Chiranjib described. Check
> out the example: itk.org/Doxygen/html/Examples_2Filtering_
> 2SpatialObjectToImage1_8cxx-example.html
>
> 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.
>
> itk.org/Doxygen/html/classitk_1_1CylinderSpatialObject.html
>
> On Tue, Dec 6, 2016 at 12:14 PM, Saeed Bakhshmand <
> saeedbakhshmand at gmail.com> wrote:
>
>> Thanks Chiranjib,
>>
>> 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.
>>
>> Cheers,
>> Saeed
>>
>> On Tue, Dec 6, 2016 at 12:49 PM, Chiranjib Sur <sur.chiranjib at gmail.com>
>> wrote:
>>
>>> Saeed,
>>> there is no ready made solution available ( atleast I am not aware of).
>>> You can implement the solution in the following way
>>>
>>> 1. Consider the cylinder is within a cubic volume for which you know the
>>> bounds
>>> 2. Generate points of your desired resolution on a 3d grid for the
>>> entire cube (this will be on a regular grid)
>>> 3. Consider the boundary condition for cylinder and create an array of
>>> "vtkpoints" after step 2
>>> 4. This boundary condition can give you option to create point inside or
>>> outside of your cylinder
>>>
>>> Here is an example which you can look   to understand how to determine
>>> inside outside of the closed surface
>>> http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointInsideObject
>>>
>>> Hope that helps,
>>> Chiranjib
>>>
>>> On Tue, Dec 6, 2016 at 10:15 PM, Saeed Bakhshmand <
>>> saeedbakhshmand at gmail.com> wrote:
>>>
>>>> Hello,
>>>>
>>>> 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.
>>>>
>>>> Best,
>>>> Saeed
>>>>
>>>> _______________________________________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at
>>>> http://www.kitware.com/opensource/opensource.html
>>>>
>>>> Please keep messages on-topic and check the VTK FAQ at:
>>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>>
>>>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://public.kitware.com/mailman/listinfo/vtkusers
>>>>
>>>>
>>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161207/19c79927/attachment.html>


More information about the vtkusers mailing list