<div>
            <div>
                <span>Hello everyone,</span></div><div><span><br></span></div><div><span>I'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&nbsp;itkVoronoiDiagram2D which inherit from itkMesh.</div><div><br></div><div>I'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 class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #bb2d9d">typedef</span> itk::<span style="color: #713ea3">VoronoiDiagram2DGenerator</span>&lt;<span style="color: #bb2d9d">float</span>&gt; &nbsp; &nbsp; VoronoiDiagram2DGeneratorType;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #bb2d9d">typedef</span> VoronoiDiagram2DGeneratorType::<span style="color: #713ea3">PointType</span>&nbsp; <span style="color: #713ea3">PointType</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #bb2d9d">typedef</span> VoronoiDiagram2DGeneratorType::<span style="color: #713ea3">VDMesh</span> &nbsp; &nbsp; VoronoiMeshType;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #bb2d9d">typedef</span> itk::<span style="color: #713ea3">VTKPolyDataWriter</span>&lt;VoronoiMeshType&gt; &nbsp; PolyDataWriterType;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"><span class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </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 class="Apple-tab-span" style="white-space:pre">        </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 class="Apple-tab-span" style="white-space:pre">        </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 class="Apple-tab-span" style="white-space:pre">        </span>Point2[<span style="color: #2c2ecf">0</span>] =&nbsp; <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 class="Apple-tab-span" style="white-space:pre">        </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 class="Apple-tab-span" style="white-space:pre">        </span>Point3[<span style="color: #2c2ecf">0</span>] =&nbsp; <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 class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </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 class="Apple-tab-span" style="white-space:pre">        </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 class="Apple-tab-span" style="white-space:pre">        </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 class="Apple-tab-span" style="white-space:pre">        </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 class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </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 class="Apple-tab-span" style="white-space:pre">        </span>writer-&gt;</span><span style="color: #3e1f7c">SetFileName</span><span style="color: #000000">(</span>"voronoiMesh.vtk"<span style="color: #000000">);</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </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 class="Apple-tab-span" style="white-space:pre">        </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">        </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 class="Apple-style-span" style="font-family: Helvetica; font-size: 13px; "></span></p><div>That'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; text-indent: -12.0px; font: 11.0px Menlo">/../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:65:0 /../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:65: &nbsp; instantiated from 'void itk::VTKPolyDataWriter&lt;TInputMesh&gt;::Update() [with TInputMesh = itk::VoronoiDiagram2D&lt;float&gt;]'</p>
<p style="margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -12.0px; font: 11.0px Menlo">/../Voronoi/main.cxx:42:0 /../Voronoi/main.cxx:42: &nbsp; instantiated from here</p>
<p style="margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -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 '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' to '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;*'</p>
<p style="margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -12.0px; font: 11.0px Menlo; min-height: 13.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -12.0px; font: 11.0px Menlo; min-height: 13.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -12.0px; font: 11.0px Menlo">/../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:65:0 /../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:65: &nbsp; instantiated from 'void itk::VTKPolyDataWriter&lt;TInputMesh&gt;::Update() [with TInputMesh = itk::VoronoiDiagram2D&lt;float&gt;]'</p>
<p style="margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -12.0px; font: 11.0px Menlo">/../Voronoi/main.cxx:42:0 /../Voronoi/main.cxx:42: &nbsp; instantiated from here</p>
<p style="margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -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 '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' to '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;*'</p>
<p style="margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -12.0px; font: 11.0px Menlo; min-height: 13.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -12.0px; font: 11.0px Menlo; min-height: 13.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -12.0px; font: 11.0px Menlo">/../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:65:0 /../ITKsources/Modules/Core/Mesh/include/itkVTKPolyDataWriter.txx:65: &nbsp; instantiated from 'void itk::VTKPolyDataWriter&lt;TInputMesh&gt;::Update() [with TInputMesh = itk::VoronoiDiagram2D&lt;float&gt;]'</p>
<p style="margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -12.0px; font: 11.0px Menlo">/../Voronoi/main.cxx:42:0 /../Voronoi/main.cxx:42: &nbsp; instantiated from here</p>
<p style="margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -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 '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' to '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;*'</p>
<p style="margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -12.0px; font: 11.0px Menlo; min-height: 13.0px"><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 13px;"><font class="Apple-style-span" face="Menlo" size="3"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></span></font></p><p style="margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -12.0px; font: 11.0px Menlo; min-height: 13.0px"><span class="Apple-style-span" style="font-family: Helvetica; font-size: 13px; "></span></p><div>Well, I'm stuck there, I don't know how to display an itkVoronoiDiagram2D, except using the PolyDataWriter but that doesn't seem to work.&nbsp;</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>--&nbsp;<br>Steffan Ulysse Rigaud<br><br></span>
            </div>
        </div>