<div dir="ltr">On Mon, Sep 26, 2016 at 4:59 PM, Fraser Callaghan <span dir="ltr"><<a target="_blank" href="mailto:fraser.callaghan@sydney.edu.au">fraser.callaghan@sydney.edu.au</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
<div lang="EN-AU">
<div>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"calibri",sans-serif;color:rgb(31,73,125)">Thanks for the tips Cory.
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"calibri",sans-serif;color:rgb(31,73,125)">I also received this morning the latest Kitware blog on Scalable Point Processing in VTK:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"calibri",sans-serif;color:rgb(31,73,125)"><a target="_blank" href="https://blog.kitware.com/scalable-point-processing-in-vtk/">https://blog.kitware.com/<wbr>scalable-point-processing-in-<wbr>vtk/</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"calibri",sans-serif;color:rgb(31,73,125)">Will look into and follow this closely also.
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"calibri",sans-serif;color:rgb(31,73,125)">Thanks all<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"calibri",sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"calibri",sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:"calibri",sans-serif" lang="EN-US">From:</span></b><span style="font-size:11pt;font-family:"calibri",sans-serif" lang="EN-US"> Cory Quammen [mailto:<a target="_blank" href="mailto:cory.quammen@kitware.com">cory.quammen@kitware.<wbr>com</a>]
<br>
<b>Sent:</b> Tuesday, 27 September 2016 12:01 AM<br>
<b>To:</b> Fraser Callaghan <<a target="_blank" href="mailto:fraser.callaghan@sydney.edu.au">fraser.callaghan@sydney.edu.<wbr>au</a>><br>
<b>Cc:</b> <a target="_blank" href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
<b>Subject:</b> Re: [vtkusers] Count polydata in VTI voxels<u></u><u></u></span></p><div><div class="gmail-h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Fraser,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I don't know if any filter in VTK do exactly what you want. You can try using the filter vtkBinningFilter from<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><a target="_blank" href="https://github.com/MADAI/MADAIWorkbench/tree/master/Plugins/BinningFilter">https://github.com/MADAI/<wbr>MADAIWorkbench/tree/master/<wbr>Plugins/BinningFilter</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Otherwise, you can loop through and count the points in each voxel manually. You'll probably want to use a subclass of vtkAbstractPointLocator (<a target="_blank" href="http://www.vtk.org/doc/nightly/html/classvtkAbstractPointLocator.html">http://www.vtk.org/doc/<wbr>nightly/html/<wbr>classvtkAbstractPointLocator.<wbr>html</a>)
to accelerate point queries.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">HTH,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Cory<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Mon, Sep 26, 2016 at 7:52 AM, Fraser Callaghan <<a target="_blank" href="mailto:fraser.callaghan@sydney.edu.au">fraser.callaghan@sydney.edu.<wbr>au</a>> wrote:<u></u><u></u></p>
<blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:-moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">Hello,
<u></u><u></u></p>
<p class="MsoNormal">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). <u></u><u></u></p>
<p class="MsoNormal">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?)<u></u><u></u></p>
<p class="MsoNormal">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.
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thanks for your help.<u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(136,136,136)">Fraser<u></u><u></u></span></p>
</div>
</div>
<p style="margin-bottom:12pt" class="MsoNormal"><br>
______________________________<wbr>_________________<br>
Powered by <a target="_blank" href="http://www.kitware.com">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a target="_blank" href="http://www.kitware.com/opensource/opensource.html">
http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a target="_blank" href="http://www.vtk.org/Wiki/VTK_FAQ">
http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a target="_blank" href="http://markmail.org/search/?q=vtkusers">
http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a target="_blank" href="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<p class="MsoNormal">Cory Quammen<br>
Staff R&D Engineer<br>
Kitware, Inc.<u></u><u></u></p>
</div>
</div>
</div></div></div>
</div>
<br></blockquote></div><br><br><div>You could do it a little bit manually like this:<br><a href="http://www.vtk.org/Wiki/VTK/Examples/Broken/GridPointCloud" target="_blank">http://www.vtk.org/Wiki/VTK/<wbr>Examples/Broken/GridPointCloud</a><br><br></div>Or I believe that's what the new vtkVoxelGrid is for: <a href="https://gitlab.kitware.com/vtk/vtk/tree/master/Filters/Points">https://gitlab.kitware.com/vtk/vtk/tree/master/Filters/Points</a><br><br><div class="gmail_signature">David</div><br></div></div>