Count polydata in VTI voxels

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Count polydata in VTI voxels

Fraser Callaghan

Hello,

I have a dense set of polydata and would like to convert to a vtkImageData with each cell containing a count of the number of points, from the poly data, that are in that cell (returning a CellData array) (I suppose any input data would be relevant).

Does a method exist that will count the points within a voxel like this? Or am I better to loop through each cell counting as I go? (or something else – I guess some clever AMR approach would be most efficient?)

Note – vtkGaussianSplatter does not give the result I want – when trying to limit a point’s influence to only one cell either no influence of a “bubble” effect exists.

 

Thanks for your help.

Fraser


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Count polydata in VTI voxels

Cory Quammen-2
Fraser,

I don't know if any filter in VTK do exactly what you want. You can try using the filter vtkBinningFilter from


Otherwise, you can loop through and count the points in each voxel manually. You'll probably want to use a subclass of vtkAbstractPointLocator (http://www.vtk.org/doc/nightly/html/classvtkAbstractPointLocator.html) to accelerate point queries.

HTH,
Cory



On Mon, Sep 26, 2016 at 7:52 AM, Fraser Callaghan <[hidden email]> wrote:

Hello,

I have a dense set of polydata and would like to convert to a vtkImageData with each cell containing a count of the number of points, from the poly data, that are in that cell (returning a CellData array) (I suppose any input data would be relevant).

Does a method exist that will count the points within a voxel like this? Or am I better to loop through each cell counting as I go? (or something else – I guess some clever AMR approach would be most efficient?)

Note – vtkGaussianSplatter does not give the result I want – when trying to limit a point’s influence to only one cell either no influence of a “bubble” effect exists.

 

Thanks for your help.

Fraser


_______________________________________________
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




--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Count polydata in VTI voxels

Fraser Callaghan

Thanks for the tips Cory.

I also received this morning the latest Kitware blog on Scalable Point Processing in VTK:

https://blog.kitware.com/scalable-point-processing-in-vtk/

Will look into and follow this closely also.

Thanks all

 

 

From: Cory Quammen [mailto:[hidden email]]
Sent: Tuesday, 27 September 2016 12:01 AM
To: Fraser Callaghan <[hidden email]>
Cc: [hidden email]
Subject: Re: [vtkusers] Count polydata in VTI voxels

 

Fraser,

 

I don't know if any filter in VTK do exactly what you want. You can try using the filter vtkBinningFilter from

 

 

Otherwise, you can loop through and count the points in each voxel manually. You'll probably want to use a subclass of vtkAbstractPointLocator (http://www.vtk.org/doc/nightly/html/classvtkAbstractPointLocator.html) to accelerate point queries.

 

HTH,

Cory

 

 

 

On Mon, Sep 26, 2016 at 7:52 AM, Fraser Callaghan <[hidden email]> wrote:

Hello,

I have a dense set of polydata and would like to convert to a vtkImageData with each cell containing a count of the number of points, from the poly data, that are in that cell (returning a CellData array) (I suppose any input data would be relevant).

Does a method exist that will count the points within a voxel like this? Or am I better to loop through each cell counting as I go? (or something else – I guess some clever AMR approach would be most efficient?)

Note – vtkGaussianSplatter does not give the result I want – when trying to limit a point’s influence to only one cell either no influence of a “bubble” effect exists.

 

Thanks for your help.

Fraser


_______________________________________________
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



 

--

Cory Quammen
Staff R&D Engineer
Kitware, Inc.


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Count polydata in VTI voxels

David Doria-2-3
On Mon, Sep 26, 2016 at 4:59 PM, Fraser Callaghan <[hidden email]> wrote:

Thanks for the tips Cory.

I also received this morning the latest Kitware blog on Scalable Point Processing in VTK:

https://blog.kitware.com/scalable-point-processing-in-vtk/

Will look into and follow this closely also.

Thanks all

 

 

From: Cory Quammen [mailto:[hidden email]]
Sent: Tuesday, 27 September 2016 12:01 AM
To: Fraser Callaghan <[hidden email]>
Cc: [hidden email]
Subject: Re: [vtkusers] Count polydata in VTI voxels

 

Fraser,

 

I don't know if any filter in VTK do exactly what you want. You can try using the filter vtkBinningFilter from

 

 

Otherwise, you can loop through and count the points in each voxel manually. You'll probably want to use a subclass of vtkAbstractPointLocator (http://www.vtk.org/doc/nightly/html/classvtkAbstractPointLocator.html) to accelerate point queries.

 

HTH,

Cory

 

 

 

On Mon, Sep 26, 2016 at 7:52 AM, Fraser Callaghan <[hidden email]> wrote:

Hello,

I have a dense set of polydata and would like to convert to a vtkImageData with each cell containing a count of the number of points, from the poly data, that are in that cell (returning a CellData array) (I suppose any input data would be relevant).

Does a method exist that will count the points within a voxel like this? Or am I better to loop through each cell counting as I go? (or something else – I guess some clever AMR approach would be most efficient?)

Note – vtkGaussianSplatter does not give the result I want – when trying to limit a point’s influence to only one cell either no influence of a “bubble” effect exists.

 

Thanks for your help.

Fraser


_______________________________________________
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



 

--

Cory Quammen
Staff R&D Engineer
Kitware, Inc.




You could do it a little bit manually like this:
http://www.vtk.org/Wiki/VTK/Examples/Broken/GridPointCloud

Or I believe that's what the new vtkVoxelGrid is for: https://gitlab.kitware.com/vtk/vtk/tree/master/Filters/Points

David


_______________________________________________
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