[vtk-developers] Number of neighbours for each cell

Will Schroeder will.schroeder at kitware.com
Tue Jul 26 07:43:44 EDT 2016


Gerald-

I knocked out a vtkPointConnectivityFilter and it's going through the VTK
merge process. Not that this will help in your case but it's an interesting
filter to have around :-)

I think the solution should be something like: remove small surface areas
> which are only minimal connected to the main Cloud/Mesh.


In principal I agree although there are nasty exceptions. E.g. there are
going to be triangles at the corners of a perfectly tessellated plane that
are small, and are connected to only one other triangle (minimally
connected). So I think what you are really looking for are "isthmus" which
are features narrowly connected to larger regions, where the feature size
is bigger than the connection "cross section" if that makes any sense. To
analyze the connection you'd have to do some sort of graph analysis,
effectively performing a graph cut. Size would simply use triangle area.

Best,
W



On Fri, Jul 22, 2016 at 4:08 PM, Lodron, Gerald <Gerald.Lodron at joanneum.at>
wrote:

> I an not sure what you mean with manifold but the noise/the structure to
> remove is definitely only on the boundary.
>
> I only want to remove those structures, i don't want to add any triangles.
> Those structures are caused from wrong Stereo Matches from our Stereo
> Matches above edges into Infinity distances.
>
> I think the solution should be something like: remove small surface areas
> which are only minimal connected to the main Cloud/Mesh.
>
> However I am currently not sure what mathematically "minimal connected"
> means by Definition....
>
> Am 22.07.2016 3:42 nachm. schrieb Will Schroeder <
> will.schroeder at kitware.com>:
> Gerald-
>
> Away from the boundaries, is the surface manifold? (i.e., is each edge is
> used twice?).
>
> Also, can we add triangles as well as delete triangles? Sort of like hole
> filling but to fill in boundary "gaps".
>
> It seems to me that taking a cue from the imaging computing people we can
> use some sort of erosion / dilation to clean up noise on the boundary. I'm
> going to mull a little more...
>
> Best,
> W
>
> On Fri, Jul 22, 2016 at 9:02 AM, Lodron, Gerald <Gerald.Lodron at joanneum.at
> <mailto:Gerald.Lodron at joanneum.at>> wrote:
>
> Thats the surface:
>
> [cid:image001.png at 01D1E42A.02D5F230]
>
> Zoom on structures to remove:
>
> [cid:image002.png at 01D1E42A.02D5F230]
>
>
>
>
>
> Von: Will Schroeder [mailto:will.schroeder at kitware.com<mailto:
> will.schroeder at kitware.com>]
> Gesendet: Freitag, 22. Juli 2016 14:52
>
> An: Lodron, Gerald
> Cc: VTK Developer (vtk-developers at vtk.org<mailto:vtk-developers at vtk.org>)
> Betreff: Re: [vtk-developers] Number of neighbours for each cell
>
>
>
> Sure send the image we always love a challenge :-) Obviously if it becomes
> more involved we can talk about a support product<
> http://www.kitware.com/products/support.html>, etc.
>
> Best,
>
> W
>
>
>
> On Fri, Jul 22, 2016 at 8:44 AM, Lodron, Gerald <Gerald.Lodron at joanneum.at
> <mailto:Gerald.Lodron at joanneum.at>> wrote:
>
> Cool
>
>
>
> For my first test that implementation below worked and i found out that
> this kind of algorithm does not help me on my problem, arg
>
>
>
> Can I send you an image/screenshot of the “geometric” stuff I want to
> filter? May you as an expert has a better idea for solving my problem.
> Short text description (but is really hard to explain):
>
>
>
> I have a mesh of a surface, scanned with a 3d scanner (triangles,
> vtkPolydata as explained). On the border of that mesh I have single “noisy”
> (or fringy) structures which I want to filter. These noise structures are
> minimal connected to the main mesh, so I can not use connected component
> filter (which I also used apriory to remove noise in the air).
>
>
>
> Von: Will Schroeder [mailto:will.schroeder at kitware.com<mailto:
> will.schroeder at kitware.com>]
> Gesendet: Freitag, 22. Juli 2016 14:37
>
> An: Lodron, Gerald
> Cc: VTK Developer (vtk-developers at vtk.org<mailto:vtk-developers at vtk.org>)
> Betreff: Re: [vtk-developers] Number of neighbours for each cell
>
>
>
> Yes this is a great start. Since I am on a performance kick, I would
> probably use (under the hood) vtkStaticCellLocator which builds the links
> between points and cells much faster (threaded using vtkSMPTools and a
> parallel sort).  The actual "counting" of the neighbors could then be sped
> up using vtkSMPTools as well. It's probably overkill, but I'd like VTK to
> knock off the socks of anyone using it, and also to support our HPC friends
> who have this humbling habit of dumping really big data on top of VTK :-)
>
>
>
> Best,
> W
>
>
>
> On Fri, Jul 22, 2016 at 8:25 AM, Lodron, Gerald <Gerald.Lodron at joanneum.at
> <mailto:Gerald.Lodron at joanneum.at>> wrote:
>
> In my case the definition would be an edge, but yes it would be useful to
> define that as parameter….
>
> I already found a maybe not beautiful algorithm for vertices, not edges,
> may you want to reuse it as initial code:
>
>        vtkSmartPointer<vtkUnsignedIntArray> neighbours =
> vtkSmartPointer<vtkUnsignedIntArray>::New();
>         neighbours ->SetName("NumberOfNeighbours");
>         neighbours ->SetNumberOfValues(numberOfCells);
>
>         vtkSmartPointer<vtkIdList> cellPointIds =
> vtkSmartPointer<vtkIdList>::New();
>
>         vtkSmartPointer<vtkIdList> ptids =
> vtkSmartPointer<vtkIdList>::New();
>         vtkSmartPointer<vtkIdList> cellids =
> vtkSmartPointer<vtkIdList>::New();
>
>         for (vtkIdType cellId = 0; cellId < numberOfCells; ++cellId)
>         {
>             input->GetCellPoints(cellId, ptids);
>             /*
>             does not work
>             input ->GetCellNeighbors(cellId, oPtIds, oCellIds);
>             neighbours ->SetValue(cellId, static_cast<unsigned
> int>(oCellIds->GetNumberOfIds()));*/
>             std::set<vtkIdType> id_set;
>
>             for (vtkIdType ptid = 0; ptid < ptids
> ->GetNumberOfIds();ptid++)
>             {
>                 poInput1->GetPointCells(ptids ->GetId(ptid), cellids);
>                 for (vtkIdType cid = 0; cid < cellids
> ->GetNumberOfIds();cid++)
>                 {
>                     vtkIdType id = cellids ->GetId(cid);
>                     if (id != cellId)
>                     {
>                         id_set.insert(cellids->GetId(cid));
>                     }
>                 }
>             }
>             neighbours ->SetValue(cellId, static_cast<unsigned int>(
> id_set.size()));
>         }
>         output->GetCellData()->AddArray(neighbours);
>
> Von: Will Schroeder [mailto:will.schroeder at kitware.com<mailto:
> will.schroeder at kitware.com>]
> Gesendet: Freitag, 22. Juli 2016 14:09
> An: Lodron, Gerald
> Cc: VTK Developer (vtk-developers at vtk.org<mailto:vtk-developers at vtk.org>)
> Betreff: Re: [vtk-developers] Number of neighbours for each cell
>
> I don't know of such a filter but it would be easy to put together.
> Certainly it would be another useful tool in the topological analysis
> toolbox.
>
> Question: what is your definition of a neighbor? Connected at a vertex or
> along an edge? I suppose if we were to write such a filter the definition
> of a neighbor would be an optional parameter. I also suggest that this be a
> general filter so the same analysis could be applied to unstructured grids,
> etc. or to polygonal meshes with other than triangle cells.
>
> Best,
> W
>
> On Fri, Jul 22, 2016 at 6:51 AM, Lodron, Gerald <Gerald.Lodron at joanneum.at
> <mailto:Gerald.Lodron at joanneum.at>> wrote:
>
>
> Hi
>
> I have a mesh (vtkPolyData with all triangles) where i want to visualize
> the number of neighbouring cells/triangles for each cell/triangle. (I later
> may want to threshold/filter it with that number to remove “noisy”
> triangles on border with low number of neighbours)
>
> Is there a filter for that available?
>
> Best regards
>
>
> ------------------------------------------------------------------------------------
> Gerald Lodron
>
> Researcher of Machine Vision Applications Group
> DIGITAL - Institute for Information and Communication Technologies
>
> JOANNEUM RESEARCH Forschungsgesellschaft mbH
> Steyrergasse 17, 8010 Graz, AUSTRIA
>
> phone:   +43-316-876-1751<tel:%2B43-316-876-1751>
> general fax: +43-316-876-1751<tel:%2B43-316-876-1751>
> web: http://www.joanneum.at/digital
> e-mail: gerald.lodron at joanneum.at<mailto:gerald.lodron at joanneum.at>
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com<http://www.kitware.com>
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers
>
>
>
>
>
>

-- 
William J. Schroeder, PhD
Kitware, Inc. - Building the World's Technical Computing Software
28 Corporate Drive
Clifton Park, NY 12065
will.schroeder at kitware.com
http://www.kitware.com
(518) 881-4902
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160726/17a123bd/attachment.html>


More information about the vtk-developers mailing list