<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yui_3_16_0_ym19_1_1472457041531_5071"><span></span></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1472457041531_5070">Still didn't find a way to extract an area with the highest point density.</div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1472457041531_5070"><br></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1472457041531_5070">The closest solution so far was to extract the regions with size greater than a given threshold by applying two connectivity filters:</div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1472457041531_5070"><br></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1472457041531_5070"><div id="yui_3_16_0_ym19_1_1472457041531_5284">  // Get all regions</div><div id="yui_3_16_0_ym19_1_1472457041531_5285">  vtkSmartPointer<vtkPolyDataConnectivityFilter> connectivityFilter = vtkSmartPointer<vtkPolyDataConnectivityFilter>::New();</div><div id="yui_3_16_0_ym19_1_1472457041531_5286">  connectivityFilter->SetInputConnection(cleanFilter->GetOutputPort());</div><div id="yui_3_16_0_ym19_1_1472457041531_5287">  connectivityFilter->SetExtractionModeToAllRegions();</div><div id="yui_3_16_0_ym19_1_1472457041531_5288">  connectivityFilter->Update();</div><div id="yui_3_16_0_ym19_1_1472457041531_5289">  </div><div id="yui_3_16_0_ym19_1_1472457041531_5290">  // Get region sizes</div><div id="yui_3_16_0_ym19_1_1472457041531_5291">  vtkSmartPointer<vtkIdTypeArray> regionSizes = connectivityFilter->GetRegionSizes();</div><div id="yui_3_16_0_ym19_1_1472457041531_5292">  </div><div id="yui_3_16_0_ym19_1_1472457041531_5293">  vtkIdType sizeThresh = 10;</div><div id="yui_3_16_0_ym19_1_1472457041531_5294">  </div><div id="yui_3_16_0_ym19_1_1472457041531_5295">  // Select only regions with size > sizeThresh</div><div id="yui_3_16_0_ym19_1_1472457041531_5296">   vtkSmartPointer<vtkPolyDataConnectivityFilter> newConnectivityFilter = vtkSmartPointer<vtkPolyDataConnectivityFilter>::New();</div><div id="yui_3_16_0_ym19_1_1472457041531_5297">  newConnectivityFilter->SetInputConnection(connectivityFilter->GetOutputPort());</div><div id="yui_3_16_0_ym19_1_1472457041531_5298">  newConnectivityFilter->SetExtractionModeToSpecifiedRegions();</div><div id="yui_3_16_0_ym19_1_1472457041531_5299">  </div><div id="yui_3_16_0_ym19_1_1472457041531_5300">  for (vtkIdType regionIndex = 0; regionIndex < connectivityFilter->GetNumberOfExtractedRegions(); ++regionIndex)</div><div id="yui_3_16_0_ym19_1_1472457041531_5301">  {</div><div id="yui_3_16_0_ym19_1_1472457041531_5302">    if (regionSizes->GetValue(regionIndex) > regThresh)</div><div id="yui_3_16_0_ym19_1_1472457041531_5303">    {</div><div id="yui_3_16_0_ym19_1_1472457041531_5304">      newConnectivityFilter->AddSpecifiedRegion(regionIndex);</div><div id="yui_3_16_0_ym19_1_1472457041531_5305">    }</div><div id="yui_3_16_0_ym19_1_1472457041531_5306">  }</div><div id="yui_3_16_0_ym19_1_1472457041531_5307">  </div><div id="yui_3_16_0_ym19_1_1472457041531_5308">  newConnectivityFilter->Update();</div><div id="yui_3_16_0_ym19_1_1472457041531_5309">  </div><div id="yui_3_16_0_ym19_1_1472457041531_5310">  </div><div dir="ltr" id="yui_3_16_0_ym19_1_1472457041531_5311">  Now I need to find a way to select the bigger area that contains the most number of such regions...</div></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1472457041531_5070"><br></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1472457041531_5070"><br><br></div><div class="yahoo_quoted" id="yui_3_16_0_ym19_1_1472457041531_5144" style="display: block;">  <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 13px;" id="yui_3_16_0_ym19_1_1472457041531_5143"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1472457041531_5142"> <div dir="ltr" id="yui_3_16_0_ym19_1_1472457041531_5141"> <font size="2" face="Arial" id="yui_3_16_0_ym19_1_1472457041531_5149"> <hr size="1" id="yui_3_16_0_ym19_1_1472457041531_5148"> <b><span style="font-weight:bold;">From:</span></b> Ioana Barcan via vtkusers <vtkusers@vtk.org><br> <b><span style="font-weight: bold;">To:</span></b> "vtkusers@vtk.org" <vtkusers@vtk.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, August 25, 2016 4:14 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> [vtkusers] Region with highest number of points<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_ym19_1_1472457041531_5147"><br><div id="yiv0647813814"><div id="yui_3_16_0_ym19_1_1472457041531_5146"><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;" id="yui_3_16_0_ym19_1_1472457041531_5145"><div id="yiv0647813814yui_3_16_0_1_1472130616569_2996">Hi,</div><div id="yiv0647813814yui_3_16_0_1_1472130616569_2998">  </div><div id="yiv0647813814yui_3_16_0_1_1472130616569_3000">Given a poly data that represents a 3D model and a radius, is
there any way to retrieve a region (sphere?) where the point density is the
highest (i.e. the sphere with the given radius that contains the highest number
of points within itself)?</div><div id="yiv0647813814yui_3_16_0_1_1472130616569_3002">  </div><div id="yiv0647813814yui_3_16_0_1_1472130616569_3004">Thank you,</div><div id="yiv0647813814yui_3_16_0_1_1472130616569_2620">









</div><div dir="ltr" id="yiv0647813814yui_3_16_0_1_1472130616569_3006">Ioana </div></div></div></div><br>_______________________________________________<br>Powered by www.kitware.com<br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank">http://markmail.org/search/?q=vtkusers</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br><br><br></div> </div> </div>  </div></div></body></html>