<div dir="ltr">The library containing OpenGraphFixedTracking has a file Types.h that defines:<div><br></div><div><span class="" style="margin:0px;padding:0px;border:0px;font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre">typedef</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">boost</span><span class="" style="margin:0px;padding:0px;border:0px;font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre">::</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">adjacency_list</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="" style="margin:0px;padding:0px;border:0px;font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre"><</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">boost</span><span class="" style="margin:0px;padding:0px;border:0px;font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre">::</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">vecS</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre">,</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">boost</span><span class="" style="margin:0px;padding:0px;border:0px;font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre">::</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">vecS</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre">,</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">boost</span><span class="" style="margin:0px;padding:0px;border:0px;font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre">::</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">undirectedS</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre">,</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">boost</span><span class="" style="margin:0px;padding:0px;border:0px;font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre">::</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">no_property</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre">,</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">EdgeVisibility</span><span class="" style="margin:0px;padding:0px;border:0px;font-weight:bold;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre">></span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre;background-color:rgb(255,255,255)">Graph</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;white-space:pre">;</span></div>
<div><br></div><div style>This means that the OpenGraphFixedTracking function requires this exact type, as opposed to standard boost graph library algorithms that are templated to accept arbitrary graph types. You may want to try making an instance of this specific graph type and use <a href="http://www.boost.org/doc/libs/1_53_0/libs/graph/doc/copy_graph.html">copy_graph</a> to convert the vtkGraph to the type the library expects. If copy_graph doesn't work you may need to manually iterate over vertices/edges to construct the graph.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 6, 2013 at 9:30 AM, Dr. Roman Grothausmann <span dir="ltr"><<a href="mailto:grothausmann.roman@mh-hannover.de" target="_blank">grothausmann.roman@mh-hannover.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear mailing list members,<br>
<br>
<br>
How can I use a vtkGraph as a boostGraph which is needed for OpenGraphFixedTracking from D. Doria (<a href="http://www.midasjournal.org/browse/publication/828" target="_blank">http://www.midasjournal.org/<u></u>browse/publication/828</a>)?<br>
I looked at vtkBoostBreadthFirstSearch.cxx and included vtkBoostGraphAdapter.h (see below) and copied it to the project dir (seems this header-file is not installed with VTK, why?) but I still get an error:<br>
<br>
error: invalid user-defined conversion from ‘vtkGraph*’ to ‘const Graph& {aka const boost::adjacency_list<boost::<u></u>vecS, boost::vecS, boost::undirectedS, boost::no_property, EdgeVisibility>&}’ [-fpermissive]<br>
<br>
What am I missing?<br>
<br>
Any help or hints are very much appreciated<br>
Roman<br>
<br>
______________________________<u></u>________<br>
<br>
<br>
#include "vtkBoostGraphAdapter.h"<br>
<br>
#include <vtkXMLPolyDataReader.h>//for vtp-files (cannot contain 3D cells?)<br>
#include <vtkPolyDataToGraph.h><br>
<br>
#include <vtkGraphToPolyData.h><br>
#include <vtkXMLPolyDataWriter.h>//for vtp-files<br>
<br>
...<br>
<br>
// Read the graph<br>
//Graph graph = ReadGraph(inputFileName);<br>
<br>
vtkSmartPointer<<u></u>vtkXMLPolyDataReader> reader = vtkSmartPointer<<u></u>vtkXMLPolyDataReader>::New();<br>
<br>
//reader->SetFileName(<u></u>inputFileName);<br>
reader->SetFileName(argv[1]);<br>
reader->Update();<br>
<br>
vtkSmartPointer<<u></u>vtkPolyDataToGraph> polyDataToGraphFilter= vtkSmartPointer<<u></u>vtkPolyDataToGraph>::New();<br>
polyDataToGraphFilter-><u></u>SetInputConnection(reader-><u></u>GetOutputPort());<br>
polyDataToGraphFilter->Update(<u></u>);<br>
<br>
vtkGraph* graph= polyDataToGraphFilter-><u></u>GetOutput();<br>
<br>
//vtkBoostUndirectedGraph g(graph);<br>
<br>
//vtkUndirectedGraph *g = vtkUndirectedGraph::<u></u>SafeDownCast(graph);<br>
//Graph openedGraph = OpenGraphFixedTracking(g, numberOfIterations);<br>
//Graph openedGraph = OpenGraphFixedTracking(boost::<u></u>graph_traits<graph>, numberOfIterations);<br>
Graph openedGraph = OpenGraphFixedTracking(graph, numberOfIterations);<br>
//WriteGraph(openedGraph, outputFileName);<br>
<br>
vtkSmartPointer<<u></u>vtkGraphToPolyData> graphToPolyData= vtkSmartPointer<<u></u>vtkGraphToPolyData>::New();<br>
graphToPolyData->SetInput(<u></u>openedGraph);<br>
graphToPolyData->Update();<br>
<br>
vtkSmartPointer<<u></u>vtkXMLPolyDataWriter> writer= vtkSmartPointer<<u></u>vtkXMLPolyDataWriter>::New();<br>
//writer->SetFileName(<u></u>outputFileName);<br>
writer->SetFileName(argv[2]);<br>
writer->SetInputConnection(<u></u>graphToPolyData-><u></u>GetOutputPort());<br>
writer->Write();<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
-- <br>
Dr. Roman Grothausmann<br>
<br>
Tomographie und Digitale Bildverarbeitung<br>
Tomography and Digital Image Analysis<br>
<br>
Institut für Funktionelle und Angewandte Anatomie, OE 4120<br>
Medizinische Hochschule Hannover<br>
Carl-Neuberg-Str. 1<br>
D-30625 Hannover<br>
<br>
Tel. <a href="tel:%2B49%20511%20532-9574" value="+495115329574" target="_blank">+49 511 532-9574</a><br>
</font></span><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">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>
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>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>