[vtkusers] Region with highest number of points

Ioana Barcan ioana.barcan at ymail.com
Mon Aug 29 05:22:00 EDT 2016


Still didn't find a way to extract an area with the highest point density.
The closest solution so far was to extract the regions with size greater than a given threshold by applying two connectivity filters:
  // Get all regions  vtkSmartPointer<vtkPolyDataConnectivityFilter> connectivityFilter = vtkSmartPointer<vtkPolyDataConnectivityFilter>::New();  connectivityFilter->SetInputConnection(cleanFilter->GetOutputPort());  connectivityFilter->SetExtractionModeToAllRegions();  connectivityFilter->Update();    // Get region sizes  vtkSmartPointer<vtkIdTypeArray> regionSizes = connectivityFilter->GetRegionSizes();    vtkIdType sizeThresh = 10;    // Select only regions with size > sizeThresh   vtkSmartPointer<vtkPolyDataConnectivityFilter> newConnectivityFilter = vtkSmartPointer<vtkPolyDataConnectivityFilter>::New();  newConnectivityFilter->SetInputConnection(connectivityFilter->GetOutputPort());  newConnectivityFilter->SetExtractionModeToSpecifiedRegions();    for (vtkIdType regionIndex = 0; regionIndex < connectivityFilter->GetNumberOfExtractedRegions(); ++regionIndex)  {    if (regionSizes->GetValue(regionIndex) > regThresh)    {      newConnectivityFilter->AddSpecifiedRegion(regionIndex);    }  }    newConnectivityFilter->Update();      Now I need to find a way to select the bigger area that contains the most number of such regions...


      From: Ioana Barcan via vtkusers <vtkusers at vtk.org>
 To: "vtkusers at vtk.org" <vtkusers at vtk.org> 
 Sent: Thursday, August 25, 2016 4:14 PM
 Subject: [vtkusers] Region with highest number of points
   
Hi,  Given a poly data that represents a 3D model and a radius, isthere any way to retrieve a region (sphere?) where the point density is thehighest (i.e. the sphere with the given radius that contains the highest numberof points within itself)?  Thank you,Ioana 
_______________________________________________
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


   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160829/1f6e37cd/attachment.html>


More information about the vtkusers mailing list