Not sure if this is related to the error, but looks like your 3rd point is not initialized correctly:<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: Menlo; font-size: 11px; ">Point3[<span style="color: rgb(44, 46, 207); ">0</span>] =  <span style="color: rgb(44, 46, 207); ">0</span>; Point2[<span style="color: rgb(44, 46, 207); ">1</span>] = -<span style="color: rgb(44, 46, 207); ">1</span>;</span><br>
<br><div class="gmail_quote">On Sun, Jun 26, 2011 at 11:04 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>Hello everyone,</span></div><div><span><br></span></div><div><span>I&#39;ve discover that itk has an implementation of Voronoi, which is quite great for me:</span></div><div><span>itkVoronoiDiagram2D</span></div>
<div><span>itkVoronoiDiagram2DGenerator</span></div><div>Where itkVoronoiDiagram2DGenerator generates an itkVoronoiDiagram2D which inherit from itkMesh.</div><div><br></div><div>I&#39;m trying to make it simple for now by giving 3 inputs points (Point1,Point2,Point3), and write the output Mesh in a vtkPolyData.</div>
<div><span><br></span></div><div><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span><span style="color:#bb2d9d">typedef</span> itk::<span style="color:#713ea3">VoronoiDiagram2DGenerator</span>&lt;<span style="color:#bb2d9d">float</span>&gt;     VoronoiDiagram2DGeneratorType;</p>

<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span><span style="color:#bb2d9d">typedef</span> VoronoiDiagram2DGeneratorType::<span style="color:#713ea3">PointType</span>  <span style="color:#713ea3">PointType</span>;</p>

<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span><span style="color:#bb2d9d">typedef</span> VoronoiDiagram2DGeneratorType::<span style="color:#713ea3">VDMesh</span>     VoronoiMeshType;</p>

<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span><span style="color:#bb2d9d">typedef</span> itk::<span style="color:#713ea3">VTKPolyDataWriter</span>&lt;VoronoiMeshType&gt;   PolyDataWriterType;</p>

<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo;min-height:13.0px"><span style="white-space:pre-wrap">        </span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span><span style="color:#713ea3">PointType</span> Point1;</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span>Point1[<span style="color:#2c2ecf">0</span>] = -<span style="color:#2c2ecf">1</span>; Point1[<span style="color:#2c2ecf">1</span>] = <span style="color:#2c2ecf">1</span>;</p>

<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span><span style="color:#713ea3">PointType</span> Point2;</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span>Point2[<span style="color:#2c2ecf">0</span>] =  <span style="color:#2c2ecf">1</span>; Point2[<span style="color:#2c2ecf">1</span>] = <span style="color:#2c2ecf">1</span>;</p>

<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span><span style="color:#713ea3">PointType</span> Point3;</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span>Point3[<span style="color:#2c2ecf">0</span>] =  <span style="color:#2c2ecf">0</span>; Point2[<span style="color:#2c2ecf">1</span>] = -<span style="color:#2c2ecf">1</span>;</p>

<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo;min-height:13.0px"><span style="white-space:pre-wrap">        </span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span>VoronoiDiagram2DGeneratorType::<span style="color:#713ea3">Pointer</span> voronoiGenerator = VoronoiDiagram2DGeneratorType::<span style="color:#3e1f7c">New</span>();</p>

<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span>voronoiGenerator-&gt;<span style="color:#3e1f7c">AddOneSeed</span>( Point1 );</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span>voronoiGenerator-&gt;<span style="color:#3e1f7c">AddOneSeed</span>( Point2 );</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span>voronoiGenerator-&gt;<span style="color:#3e1f7c">AddOneSeed</span>( Point3 );</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo;min-height:13.0px"><span style="white-space:pre-wrap">        </span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span>PolyDataWriterType::<span style="color:#713ea3">Pointer</span> writer = PolyDataWriterType::<span style="color:#3e1f7c">New</span>();</p>

<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo;color:#d12c26"><span style="color:#000000"><span style="white-space:pre-wrap">        </span>writer-&gt;</span><span style="color:#3e1f7c">SetFileName</span><span style="color:#000000">(</span>&quot;voronoiMesh.vtk&quot;<span style="color:#000000">);</span></p>

<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span>writer-&gt;<span style="color:#3e1f7c">SetInput</span>(voronoiGenerator-&gt;<span style="color:#3e1f7c">GetOutput</span>());</p>

<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo;min-height:13.0px"><span style="white-space:pre-wrap">        </span></p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">        </span>writer-&gt;<span style="color:#3e1f7c">Update</span>();</p><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo">
<br></p><p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="font-family:Helvetica;font-size:13px"></span></p><div>That&#39;s give me 3 errors inside the VTKPolyDataWriter.txx:</div><div><br></div><div>
<p style="margin:0.0px 0.0px 0.0px 12.0px;font:11.0px Menlo">/../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:65:0 /../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:65:   instantiated from &#39;void itk::VTKPolyDataWriter&lt;TInputMesh&gt;::Update() [with TInputMesh = itk::VoronoiDiagram2D&lt;float&gt;]&#39;</p>

<p style="margin:0.0px 0.0px 0.0px 12.0px;font:11.0px Menlo">/../Voronoi/main.cxx:42:0 /../Voronoi/main.cxx:42:   instantiated from here</p>
<p style="margin:0.0px 0.0px 0.0px 12.0px;font:11.0px Menlo">/../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:191:0 /../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:191: error: invalid conversion from &#39;itk::CellInterface&lt;float, itk::CellTraitsInfo&lt;2, float, float, long unsigned int, long unsigned int, long unsigned int, itk::Point&lt;float, 2u&gt;, itk::MapContainer&lt;long unsigned int, itk::Point&lt;float, 2u&gt; &gt;, std::set&lt;long unsigned int, std::less&lt;long unsigned int&gt;, std::allocator&lt;long unsigned int&gt; &gt; &gt; &gt;* const&#39; to &#39;itk::PolygonCell&lt;itk::CellInterface&lt;float, itk::CellTraitsInfo&lt;2, float, float, long unsigned int, long unsigned int, long unsigned int, itk::Point&lt;float, 2u&gt;, itk::MapContainer&lt;long unsigned int, itk::Point&lt;float, 2u&gt; &gt;, std::set&lt;long unsigned int, std::less&lt;long unsigned int&gt;, std::allocator&lt;long unsigned int&gt; &gt; &gt; &gt; &gt;*&#39;</p>

<p style="margin:0.0px 0.0px 0.0px 12.0px;font:11.0px Menlo;min-height:13.0px"><br></p>
<p style="margin:0.0px 0.0px 0.0px 12.0px;font:11.0px Menlo;min-height:13.0px"><br></p>
<p style="margin:0.0px 0.0px 0.0px 12.0px;font:11.0px Menlo">/../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:65:0 /../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:65:   instantiated from &#39;void itk::VTKPolyDataWriter&lt;TInputMesh&gt;::Update() [with TInputMesh = itk::VoronoiDiagram2D&lt;float&gt;]&#39;</p>

<p style="margin:0.0px 0.0px 0.0px 12.0px;font:11.0px Menlo">/../Voronoi/main.cxx:42:0 /../Voronoi/main.cxx:42:   instantiated from here</p>
<p style="margin:0.0px 0.0px 0.0px 12.0px;font:11.0px Menlo">/../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:225:0 /../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:225: error: invalid conversion from &#39;itk::CellInterface&lt;float, itk::CellTraitsInfo&lt;2, float, float, long unsigned int, long unsigned int, long unsigned int, itk::Point&lt;float, 2u&gt;, itk::MapContainer&lt;long unsigned int, itk::Point&lt;float, 2u&gt; &gt;, std::set&lt;long unsigned int, std::less&lt;long unsigned int&gt;, std::allocator&lt;long unsigned int&gt; &gt; &gt; &gt;* const&#39; to &#39;itk::PolygonCell&lt;itk::CellInterface&lt;float, itk::CellTraitsInfo&lt;2, float, float, long unsigned int, long unsigned int, long unsigned int, itk::Point&lt;float, 2u&gt;, itk::MapContainer&lt;long unsigned int, itk::Point&lt;float, 2u&gt; &gt;, std::set&lt;long unsigned int, std::less&lt;long unsigned int&gt;, std::allocator&lt;long unsigned int&gt; &gt; &gt; &gt; &gt;*&#39;</p>

<p style="margin:0.0px 0.0px 0.0px 12.0px;font:11.0px Menlo;min-height:13.0px"><br></p>
<p style="margin:0.0px 0.0px 0.0px 12.0px;font:11.0px Menlo;min-height:13.0px"><br></p>
<p style="margin:0.0px 0.0px 0.0px 12.0px;font:11.0px Menlo">/../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:65:0 /../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:65:   instantiated from &#39;void itk::VTKPolyDataWriter&lt;TInputMesh&gt;::Update() [with TInputMesh = itk::VoronoiDiagram2D&lt;float&gt;]&#39;</p>

<p style="margin:0.0px 0.0px 0.0px 12.0px;font:11.0px Menlo">/../Voronoi/main.cxx:42:0 /../Voronoi/main.cxx:42:   instantiated from here</p>
<p style="margin:0.0px 0.0px 0.0px 12.0px;font:11.0px Menlo">/../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:240:0 /../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:240: error: invalid conversion from &#39;itk::CellInterface&lt;float, itk::CellTraitsInfo&lt;2, float, float, long unsigned int, long unsigned int, long unsigned int, itk::Point&lt;float, 2u&gt;, itk::MapContainer&lt;long unsigned int, itk::Point&lt;float, 2u&gt; &gt;, std::set&lt;long unsigned int, std::less&lt;long unsigned int&gt;, std::allocator&lt;long unsigned int&gt; &gt; &gt; &gt;* const&#39; to &#39;itk::PolygonCell&lt;itk::CellInterface&lt;float, itk::CellTraitsInfo&lt;2, float, float, long unsigned int, long unsigned int, long unsigned int, itk::Point&lt;float, 2u&gt;, itk::MapContainer&lt;long unsigned int, itk::Point&lt;float, 2u&gt; &gt;, std::set&lt;long unsigned int, std::less&lt;long unsigned int&gt;, std::allocator&lt;long unsigned int&gt; &gt; &gt; &gt; &gt;*&#39;</p>

<p style="margin:0.0px 0.0px 0.0px 12.0px;font:11.0px Menlo;min-height:13.0px"><font face="Helvetica" size="3"><span style="font-size:13px"><font face="Menlo" size="3"><span style="font-size:11px"><br></span></font></span></font></p>
<p style="margin:0.0px 0.0px 0.0px 12.0px;font:11.0px Menlo;min-height:13.0px"><span style="font-family:Helvetica;font-size:13px"></span></p><div>Well, I&#39;m stuck there, I don&#39;t know how to display an itkVoronoiDiagram2D, except using the PolyDataWriter but that doesn&#39;t seem to work. </div>
<div>If you have any idea that could help be on how to generate the VoronoiDiagram and to display, I would be grateful.</div><p></p></div><div><br></div><p></p></div><div><span><div>Thanks in advance.</div><div><br></div>
-- <br>Steffan Ulysse Rigaud<br><br></span>
            </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>