[vtkusers] Count polydata in VTI voxels
David Doria
daviddoria at gmail.com
Tue Sep 27 07:59:50 EDT 2016
On Mon, Sep 26, 2016 at 4:59 PM, Fraser Callaghan <
fraser.callaghan at sydney.edu.au> 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:cory.quammen at kitware.com]
> *Sent:* Tuesday, 27 September 2016 12:01 AM
> *To:* Fraser Callaghan <fraser.callaghan at sydney.edu.au>
> *Cc:* vtkusers at vtk.org
> *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
>
>
>
> 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.
>
>
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160927/4a32d41a/attachment.html>
More information about the vtkusers
mailing list