<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE-AT" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks, i will check it out as a paraview filter if it gets released sometime….<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Do you have any idea how to detect such “isthmus”es with graph cuts? I don’t have any clue, but I am not a graph expert…. But in the meantime I
 got another idea solving that problem over computation of the 3d mesh in a higher resolution at edge areas, but that’s not really a vtk solving task.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks for your suggestions, it was a great pleasure for me to discuss with you ;-)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Best regards<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="DE" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Von:</span></b><span lang="DE" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Will Schroeder [mailto:will.schroeder@kitware.com]
<br>
<b>Gesendet:</b> Dienstag, 26. Juli 2016 13:44<br>
<b>An:</b> Lodron, Gerald<br>
<b>Cc:</b> vtk-developers<br>
<b>Betreff:</b> Re: [vtk-developers] Number of neighbours for each cell<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Gerald-<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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 :-)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">I think the solution should be something like: remove small surface areas which are only minimal connected to the main Cloud/Mesh.<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Best,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">W<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Fri, Jul 22, 2016 at 4:08 PM, Lodron, Gerald <<a href="mailto:Gerald.Lodron@joanneum.at" target="_blank">Gerald.Lodron@joanneum.at</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">I an not sure what you mean with manifold but the noise/the structure to remove is definitely only on the boundary.<br>
<br>
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.<br>
<br>
I think the solution should be something like: remove small surface areas which are only minimal connected to the main Cloud/Mesh.<br>
<br>
However I am currently not sure what mathematically "minimal connected" means by Definition....<br>
<br>
Am 22.07.2016 3:42 nachm. schrieb Will Schroeder <<a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a>>:<br>
Gerald-<br>
<br>
Away from the boundaries, is the surface manifold? (i.e., is each edge is used twice?).<br>
<br>
Also, can we add triangles as well as delete triangles? Sort of like hole filling but to fill in boundary "gaps".<br>
<br>
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...<br>
<br>
Best,<br>
W<br>
<br>
On Fri, Jul 22, 2016 at 9:02 AM, Lodron, Gerald <<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a><mailto:<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a>>> wrote:<br>
<br>
Thats the surface:<br>
<br>
[<a href="cid:image001.png@01D1E42A.02D5F230">cid:image001.png@01D1E42A.02D5F230</a>]<br>
<br>
Zoom on structures to remove:<br>
<br>
[<a href="cid:image002.png@01D1E42A.02D5F230">cid:image002.png@01D1E42A.02D5F230</a>]<br>
<br>
<br>
<br>
<br>
<br>
Von: Will Schroeder [mailto:<a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a><mailto:<a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a>>]<br>
Gesendet: Freitag, 22. Juli 2016 14:52<br>
<br>
An: Lodron, Gerald<br>
Cc: VTK Developer (<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><mailto:<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>>)<br>
Betreff: Re: [vtk-developers] Number of neighbours for each cell<br>
<br>
<br>
<br>
Sure send the image we always love a challenge :-) Obviously if it becomes more involved we can talk about a support product<<a href="http://www.kitware.com/products/support.html" target="_blank">http://www.kitware.com/products/support.html</a>>, etc.<br>
<br>
Best,<br>
<br>
W<br>
<br>
<br>
<br>
On Fri, Jul 22, 2016 at 8:44 AM, Lodron, Gerald <<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a><mailto:<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a>>> wrote:<br>
<br>
Cool<br>
<br>
<br>
<br>
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<br>
<br>
<br>
<br>
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):<br>
<br>
<br>
<br>
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).<br>
<br>
<br>
<br>
Von: Will Schroeder [mailto:<a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a><mailto:<a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a>>]<br>
Gesendet: Freitag, 22. Juli 2016 14:37<br>
<br>
An: Lodron, Gerald<br>
Cc: VTK Developer (<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><mailto:<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>>)<br>
Betreff: Re: [vtk-developers] Number of neighbours for each cell<br>
<br>
<br>
<br>
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 :-)<br>
<br>
<br>
<br>
Best,<br>
W<br>
<br>
<br>
<br>
On Fri, Jul 22, 2016 at 8:25 AM, Lodron, Gerald <<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a><mailto:<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a>>> wrote:<br>
<br>
In my case the definition would be an edge, but yes it would be useful to define that as parameter….<br>
<br>
I already found a maybe not beautiful algorithm for vertices, not edges, may you want to reuse it as initial code:<br>
<br>
       vtkSmartPointer<vtkUnsignedIntArray> neighbours = vtkSmartPointer<vtkUnsignedIntArray>::New();<br>
        neighbours ->SetName("NumberOfNeighbours");<br>
        neighbours ->SetNumberOfValues(numberOfCells);<br>
<br>
        vtkSmartPointer<vtkIdList> cellPointIds = vtkSmartPointer<vtkIdList>::New();<br>
<br>
        vtkSmartPointer<vtkIdList> ptids = vtkSmartPointer<vtkIdList>::New();<br>
        vtkSmartPointer<vtkIdList> cellids = vtkSmartPointer<vtkIdList>::New();<br>
<br>
        for (vtkIdType cellId = 0; cellId < numberOfCells; ++cellId)<br>
        {<br>
            input->GetCellPoints(cellId, ptids);<br>
            /*<br>
            does not work<br>
            input ->GetCellNeighbors(cellId, oPtIds, oCellIds);<br>
            neighbours ->SetValue(cellId, static_cast<unsigned int>(oCellIds->GetNumberOfIds()));*/<br>
            std::set<vtkIdType> id_set;<br>
<br>
            for (vtkIdType ptid = 0; ptid < ptids ->GetNumberOfIds();ptid++)<br>
            {<br>
                poInput1->GetPointCells(ptids ->GetId(ptid), cellids);<br>
                for (vtkIdType cid = 0; cid < cellids ->GetNumberOfIds();cid++)<br>
                {<br>
                    vtkIdType id = cellids ->GetId(cid);<br>
                    if (id != cellId)<br>
                    {<br>
                        id_set.insert(cellids->GetId(cid));<br>
                    }<br>
                }<br>
            }<br>
            neighbours ->SetValue(cellId, static_cast<unsigned int>( id_set.size()));<br>
        }<br>
        output->GetCellData()->AddArray(neighbours);<br>
<br>
Von: Will Schroeder [mailto:<a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a><mailto:<a href="mailto:will.schroeder@kitware.com">will.schroeder@kitware.com</a>>]<br>
Gesendet: Freitag, 22. Juli 2016 14:09<br>
An: Lodron, Gerald<br>
Cc: VTK Developer (<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a><mailto:<a href="mailto:vtk-developers@vtk.org">vtk-developers@vtk.org</a>>)<br>
Betreff: Re: [vtk-developers] Number of neighbours for each cell<br>
<br>
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.<br>
<br>
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.<br>
<br>
Best,<br>
W<br>
<br>
On Fri, Jul 22, 2016 at 6:51 AM, Lodron, Gerald <<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a><mailto:<a href="mailto:Gerald.Lodron@joanneum.at">Gerald.Lodron@joanneum.at</a>>> wrote:<br>
<br>
<br>
Hi<br>
<br>
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)<br>
<br>
Is there a filter for that available?<br>
<br>
Best regards<br>
<br>
------------------------------------------------------------------------------------<br>
Gerald Lodron<br>
<br>
Researcher of Machine Vision Applications Group<br>
DIGITAL - Institute for Information and Communication Technologies<br>
<br>
JOANNEUM RESEARCH Forschungsgesellschaft mbH<br>
Steyrergasse 17, 8010 Graz, AUSTRIA<br>
<br>
phone:   <a href="tel:%2B43-316-876-1751">+43-316-876-1751</a><<a href="tel:%2B43-316-876-1751">tel:%2B43-316-876-1751</a>><br>
general fax: <a href="tel:%2B43-316-876-1751">+43-316-876-1751</a><<a href="tel:%2B43-316-876-1751">tel:%2B43-316-876-1751</a>><br>
web: <a href="http://www.joanneum.at/digital" target="_blank">http://www.joanneum.at/digital</a><br>
e-mail: <a href="mailto:gerald.lodron@joanneum.at">gerald.lodron@joanneum.at</a><mailto:<a href="mailto:gerald.lodron@joanneum.at">gerald.lodron@joanneum.at</a>><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a>><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>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" target="_blank">
http://markmail.org/search/?q=vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" target="_blank">http://public.kitware.com/mailman/listinfo/vtk-developers</a><br>
<br>
<br>
<br>
<br>
<o:p></o:p></p>
</div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">William J. Schroeder, PhD<br>
Kitware, Inc. - Building the World's Technical Computing Software<br>
28 Corporate Drive<br>
Clifton Park, NY 12065<br>
<a href="mailto:will.schroeder@kitware.com" target="_blank">will.schroeder@kitware.com</a><br>
<a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>
(518) 881-4902<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>