<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=iso-8859-1"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 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;
color:black;}
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;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.E-MailFormatvorlage18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@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 bgcolor=white lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Dear all,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><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;mso-fareast-language:EN-US'>I have the same problem as described by Adrian below. Coming from VTK 5.10 to 6.3, I encounter the exact same issue with vtkGraph.<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;mso-fareast-language:EN-US'><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;mso-fareast-language:EN-US'>Your help would be much appreciated!<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;mso-fareast-language:EN-US'><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;mso-fareast-language:EN-US'>Best,<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;mso-fareast-language:EN-US'>Stefan</span><span lang=EN-US><br><br>-------- </span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p></o:p></span></p><div><table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0><tr><td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal align=right style='text-align:right'><b><span lang=EN-US>Betreff: <o:p></o:p></span></b></p></td><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span lang=EN-US>[vtkusers] Removal of graph vertices causes error: Could not find edge in source edge list.<o:p></o:p></span></p></td></tr><tr><td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal align=right style='text-align:right'><b><span lang=EN-US>Datum: <o:p></o:p></span></b></p></td><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal><span lang=EN-US>Fri, 18 Sep 2015 </span>17:23:27 +0200<o:p></o:p></p></td></tr><tr><td nowrap valign=top style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal align=right style='text-align:right'><b>Von: <o:p></o:p></b></p></td><td style='padding:0cm 0cm 0cm 0cm'><p class=MsoNormal>Adrian Friebel <a href="mailto:friebel@izbi.uni-leipzig.de"><friebel@izbi.uni-leipzig.de></a><o:p></o:p></p></td></tr><tr style='height:4.0pt'><td nowrap valign=top style='padding:0cm 0cm 0cm 0cm;height:4.0pt'><p class=MsoNormal align=right style='text-align:right'><b>An: <o:p></o:p></b></p></td><td style='padding:0cm 0cm 0cm 0cm;height:4.0pt'><p class=MsoNormal>VTK Users <a href="mailto:vtkusers@vtk.org"><vtkusers@vtk.org></a><o:p></o:p></p></td></tr></table><p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US><br><br>Hi everyone,<br><br>I recently moved on from VTK 5.8 / 5.10 to the 6.3 build and apparently the vtkGraph behaves now a bit unexpected.<br><br></span>In the minimal example below I load an undirected graph (points & pedigreeIDs attached to vertices, spatially neighbouring vertices are connected), collect all pedIDs and then try to remove one vertex after the other, using their pedIDs. That worked perfectly fine in 5.8.<br><br>And it works fine for the first couple hundred vertices, but occasionally some throw the following message:<br><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#232A2A;background:#ECF0F0'>ERROR: In /path/to/</span><a href="http://vtk-6.3.0/Common/DataModel/vtkGraphInternals.cxx" target="_blank"><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#232A2A'>VTK-6.3.0/Common/DataModel/vtkGraphInternals.cxx</span></a><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#232A2A;background:#ECF0F0'>, line 53 vtkGraphInternals (0x7ffc54080080): Could not find edge in source edge list.</span><br><br>In another test I tried to manually remove all edges of a vertex before removing the vertex itself, which didn't help either in the above cases: The number of edges of the graph was correctly decremented by the number of egdes the vertex had. But despite the vertices that threw above error message apparently had still some of the edges they previously had.<br><br>Is there a new update-call that is mandatory after removal of vertices/edges, or is it a bug? Any idea where it is coming from? I tried 6.2 with the same result.<br><br><br>I am a bit lost here, help is much appreciated,<br><br>Adrian.<br><br><br><br><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#232A2A;background:#ECF0F0'>vtkSmartPointer<vtkMutableUndirectedGraph> g = vtkMutableUndirectedGraph::New(); vtkSmartPointer<vtkGraphReader> graphReader = vtkSmartPointer<vtkGraphReader>::New(); graphReader->SetFileName("/path/to/</span><a href="http://graph.txt/" target="_blank"><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#232A2A;background:#ECF0F0'>graph.txt</span></a><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#232A2A;background:#ECF0F0'>"); graphReader->Update(); graphReader->GetOutput()->ToUndirectedGraph(g); std::cout << "graph has " << g->GetVertexData()->GetNumberOfArrays() << " vertex arrays and " << g->GetEdgeData()->GetNumberOfArrays() << " edge arrays" << std::endl; vtkSmartPointer<vtkUnsignedLongArray> pedigreeIdArray = vtkUnsignedLongArray::SafeDownCast(g->GetVertexData()->GetPedigreeIds()); vtkSmartPointer<vtkVertexListIterator> it = vtkSmartPointer<vtkVertexListIterator>::New(); g->GetVertices(it); std::set<vtkIdType> vertsToDelete; while (it->HasNext()) { vtkIdType v = it->Next(); </span><a href="http://vertstodelete.insert%28pedigreeidarray-/" target="_blank"><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#232A2A;background:#ECF0F0'>vertsToDelete.insert(pedigreeIdArray-</span></a><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#232A2A;background:#ECF0F0'>>GetValue(v)); } for(std::set<vtkIdType>::iterator it=</span><a href="http://vertstodelete.begin%28%29%3B/" target="_blank"><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#232A2A;background:#ECF0F0'>vertsToDelete.begin();</span></a><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#232A2A;background:#ECF0F0'> it!=</span><a href="http://vertstodelete.end%28%29%3B/" target="_blank"><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#232A2A;background:#ECF0F0'>vertsToDelete.end();</span></a><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#232A2A;background:#ECF0F0'> ++it) { g->RemoveVertex(g->FindVertex(*it)); g->Modified(); std::cout << "num verts = " << g->GetNumberOfVertices() << " and num pedIDEntries = " << g->GetVertexData()->GetPedigreeIds()->GetNumberOfTuples() << std::endl; for(int i=0; i<g->GetVertexData()->GetNumberOfArrays(); i++) g->GetVertexData()->GetArray(i)->DataChanged(); g->Squeeze(); } vtkSmartPointer<vtkGraphWriter> graphWriter = vtkSmartPointer<vtkGraphWriter>::New(); graphWriter->SetFileName("/scratch/friebel/TestData/graphVTKError/</span><a href="http://graph_collapsed.txt/" target="_blank"><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#232A2A;background:#ECF0F0'>graph_collapsed.txt</span></a><span style='font-size:10.5pt;font-family:"Helvetica",sans-serif;color:#232A2A;background:#ECF0F0'>"); graphWriter->SetInputData(g); graphWriter->Update();</span><o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></body></html>