<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 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><<span style="color: #bb2d9d">float</span>> 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> <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> 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><VoronoiMeshType> 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>] = <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>] = <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-><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-><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-><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-></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-><span style="color: #3e1f7c">SetInput</span>(voronoiGenerator-><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-><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: instantiated from 'void itk::VTKPolyDataWriter<TInputMesh>::Update() [with TInputMesh = itk::VoronoiDiagram2D<float>]'</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: 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<float, itk::CellTraitsInfo<2, float, float, long unsigned int, long unsigned int, long unsigned int, itk::Point<float, 2u>, itk::MapContainer<long unsigned int, itk::Point<float, 2u> >, std::set<long unsigned int, std::less<long unsigned int>, std::allocator<long unsigned int> > > >* const' to 'itk::PolygonCell<itk::CellInterface<float, itk::CellTraitsInfo<2, float, float, long unsigned int, long unsigned int, long unsigned int, itk::Point<float, 2u>, itk::MapContainer<long unsigned int, itk::Point<float, 2u> >, std::set<long unsigned int, std::less<long unsigned int>, std::allocator<long unsigned int> > > > >*'</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: instantiated from 'void itk::VTKPolyDataWriter<TInputMesh>::Update() [with TInputMesh = itk::VoronoiDiagram2D<float>]'</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: 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<float, itk::CellTraitsInfo<2, float, float, long unsigned int, long unsigned int, long unsigned int, itk::Point<float, 2u>, itk::MapContainer<long unsigned int, itk::Point<float, 2u> >, std::set<long unsigned int, std::less<long unsigned int>, std::allocator<long unsigned int> > > >* const' to 'itk::PolygonCell<itk::CellInterface<float, itk::CellTraitsInfo<2, float, float, long unsigned int, long unsigned int, long unsigned int, itk::Point<float, 2u>, itk::MapContainer<long unsigned int, itk::Point<float, 2u> >, std::set<long unsigned int, std::less<long unsigned int>, std::allocator<long unsigned int> > > > >*'</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: instantiated from 'void itk::VTKPolyDataWriter<TInputMesh>::Update() [with TInputMesh = itk::VoronoiDiagram2D<float>]'</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: 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<float, itk::CellTraitsInfo<2, float, float, long unsigned int, long unsigned int, long unsigned int, itk::Point<float, 2u>, itk::MapContainer<long unsigned int, itk::Point<float, 2u> >, std::set<long unsigned int, std::less<long unsigned int>, std::allocator<long unsigned int> > > >* const' to 'itk::PolygonCell<itk::CellInterface<float, itk::CellTraitsInfo<2, float, float, long unsigned int, long unsigned int, long unsigned int, itk::Point<float, 2u>, itk::MapContainer<long unsigned int, itk::Point<float, 2u> >, std::set<long unsigned int, std::less<long unsigned int>, std::allocator<long unsigned int> > > > >*'</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. </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>