<div>Hi, Steffan,</div><div><br></div>You need add points to the voronoiDiagram explicitly so far. In the itk wiki example<div><a href="http://www.itk.org/Wiki/ITK/Examples/Segmentation/WishList/VoronoiDiagram2DGenerator">http://www.itk.org/Wiki/ITK/Examples/Segmentation/WishList/VoronoiDiagram2DGenerator</a></div>
<div><br><div><div>  for(allVerts = voronoiDiagram-&gt;VertexBegin(); allVerts != voronoiDiagram-&gt;VertexEnd(); ++allVerts)</div><div>    {</div><div>    std::cout &lt;&lt; &quot;Vertices No.&quot; &lt;&lt; j;</div><div>
     voronoiDiagram-&gt;SetPoint(j, *allVerts); ////////add this line</div><div>    j++;</div><div><div>   std::cout &lt;&lt; &quot;: At (&quot; &lt;&lt; (*allVerts)[0] &lt;&lt; &quot;,&quot; &lt;&lt; (*allVerts)[1] &lt;&lt; &quot;)&quot; &lt;&lt; std::endl;</div>
<div>    }</div></div><div><br></div>The output voronoi.vtk will be correct.</div><div><br></div><div><br></div><div><br></div><div>wanlin</div><div><br><div class="gmail_quote">On Tue, Jun 28, 2011 at 12:34 PM, Steffan <span dir="ltr">&lt;<a href="mailto:ulysse.rigaud@gmail.com">ulysse.rigaud@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>
            <div>
                <span>I&#39;ve replace my VTKPolyDataWriter&lt;VoronoiDiagram2DType&gt; by VTKPolyDataWriter&lt;VoronoiDiagram2DType::Superclass&gt; and it compiles.</span></div><div>And I end up at the same point as you David, Paraview crash.</div>
<div><br></div><div>I&#39;ve looked up to the voronoi.vtk:</div><div><br></div><div><div><span style="white-space:pre-wrap">        </span># vtk DataFile Version 2.0</div><div><span style="white-space:pre-wrap">        </span>File written by itkVTKPolyDataWriter</div>
<div><span style="white-space:pre-wrap">        </span>ASCII</div><div><span style="white-space:pre-wrap">        </span>DATASET POLYDATA</div><div><span style="white-space:pre-wrap">        </span>POINTS 0 float</div><div><span style="white-space:pre-wrap">        </span>POLYGONS 5 29</div>
<div><span style="white-space:pre-wrap">        </span>5 0 0 0 0 0</div><div><span style="white-space:pre-wrap">        </span>5 0 0 0 0 0</div><div><span style="white-space:pre-wrap">        </span>4 0 0 0 0</div><div><span style="white-space:pre-wrap">        </span>5 0 0 0 0 0</div>
<div><span style="white-space:pre-wrap">        </span>5 0 0 0 0 0</div></div><div><span><br></span></div><div>There are clearly some missing data in order to display the voronoi diagram, which explain why Paraview crash.</div><div>
I think there is a different data structure between Mesh and VoronoiDiagram2D.</div><div>By using VoronoiDiagram2D::Superclass (which is Mesh) as template value for VTKPolyDataWriter, we are writing only the data structure in common between Mesh and VoronoiDiagram2D.</div>
<div>And if you use VoronoiDiagram2D as template value for the writer, you will end up with the same compilation errors I had:</div><div><span style="font-family:Menlo;font-size:11px"><span style="white-space:pre-wrap">        </span></span></div>
<div><span style="font-family:Menlo;font-size:11px"><span style="white-space:pre-wrap"></span></span><span style="font-family:Menlo;font-size:11px"><span style="white-space:pre-wrap">        </span>itkVTKPolyDataWriter.txx:191: error: invalid conversion </span><span style="font-family:Menlo;font-size:11px">from … to …</span></div>
<div><span style="font-family:Menlo;font-size:11px"><span style="white-space:pre-wrap"></span><span style="white-space:pre-wrap">        </span>itkVTKPolyDataWriter.txx:225: error: invalid conversion from … to … </span></div><div>
<span><span style="white-space:pre-wrap">        </span>      <span style="font-family:Menlo;font-size:11px">itkVTKPolyDataWriter.txx:240: error: invalid conversion </span><span style="font-family:Menlo;font-size:11px">from … to …</span></span></div>
<div><font face="Menlo" size="3"><span style="font-size:11px"><br></span></font></div><div><span>-- <br><font color="#888888">Steffan<br><br></font></span><div class="im">
                
                <p style="color:#a0a0a0">On Monday, June 27, 2011 at 7:12 PM, David Doria wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px">
                    <span><div><div>On Sun, Jun 26, 2011 at 11:16 PM, Steffan &lt;<a href="mailto:ulysse.rigaud@gmail.com" target="_blank">ulysse.rigaud@gmail.com</a>&gt; wrote:<br><blockquote type="cite"><div>That&#39;s right, a C/C error, but that doesn&#39;t change anything to my problem.<br>
I only give an x,y coordinates, but I also tried by adding a z coordinates,<br>that didn&#39;t change anything.<br>thanks for notice it :)<br></div></blockquote><br>I have been trying to do the same thing. It seems to run fine, but<br>
when trying to open the .vtk file in Paraview, Paraview crashes:<br><br><a href="http://www.itk.org/Wiki/ITK/Examples/Segmentation/WishList/VoronoiDiagram2DGenerator" target="_blank">http://www.itk.org/Wiki/ITK/Examples/Segmentation/WishList/VoronoiDiagram2DGenerator</a><br>
<br>David<br></div></div></span>
                
                
                
                
                </blockquote>
                
                <div>
                    <br>
                </div>
            </div></div>
        </div><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<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div></div>