[vtkusers] Count polydata in VTI voxels

Cory Quammen cory.quammen at kitware.com
Mon Sep 26 10:00:33 EDT 2016


Fraser,

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

https://github.com/MADAI/MADAIWorkbench/tree/master/Plugins/BinningFilter

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 <
fraser.callaghan at sydney.edu.au> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160926/30369ee5/attachment.html>


More information about the vtkusers mailing list