[Insight-users] Display itkVoronoiDiagram2D

robert tamburo robert.tamburo at gmail.com
Sun Jun 26 23:09:56 EDT 2011


Not sure if this is related to the error, but looks like your 3rd point is
not initialized correctly:
Point3[0] =  0; Point2[1] = -1;

On Sun, Jun 26, 2011 at 11:04 PM, Steffan <ulysse.rigaud at gmail.com> wrote:

>  Hello everyone,
>
> I've discover that itk has an implementation of Voronoi, which is quite
> great for me:
> itkVoronoiDiagram2D
> itkVoronoiDiagram2DGenerator
> Where itkVoronoiDiagram2DGenerator generates an itkVoronoiDiagram2D which
> inherit from itkMesh.
>
> 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.
>
> typedef itk::VoronoiDiagram2DGenerator<float>
> VoronoiDiagram2DGeneratorType;
>
> typedef VoronoiDiagram2DGeneratorType::PointType  PointType;
>
> typedef VoronoiDiagram2DGeneratorType::VDMesh     VoronoiMeshType;
>
> typedef itk::VTKPolyDataWriter<VoronoiMeshType>   PolyDataWriterType;
>
>  PointType Point1;
>
> Point1[0] = -1; Point1[1] = 1;
>
> PointType Point2;
>
> Point2[0] =  1; Point2[1] = 1;
>
> PointType Point3;
>
> Point3[0] =  0; Point2[1] = -1;
>
>  VoronoiDiagram2DGeneratorType::Pointer voronoiGenerator =
> VoronoiDiagram2DGeneratorType::New();
>
> voronoiGenerator->AddOneSeed( Point1 );
>
> voronoiGenerator->AddOneSeed( Point2 );
>
> voronoiGenerator->AddOneSeed( Point3 );
>
>  PolyDataWriterType::Pointer writer = PolyDataWriterType::New();
>
> writer->SetFileName("voronoiMesh.vtk");
>
> writer->SetInput(voronoiGenerator->GetOutput());
>
>  writer->Update();
>
>
> That's give me 3 errors inside the VTKPolyDataWriter.txx:
>
> /../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>]'
>
> /../Voronoi/main.cxx:42:0 /../Voronoi/main.cxx:42:   instantiated from here
>
> /../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> > > > >*'
>
>
>
> /../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>]'
>
> /../Voronoi/main.cxx:42:0 /../Voronoi/main.cxx:42:   instantiated from here
>
> /../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> > > > >*'
>
>
>
> /../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>]'
>
> /../Voronoi/main.cxx:42:0 /../Voronoi/main.cxx:42:   instantiated from here
>
> /../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> > > > >*'
>
>
> 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.
> If you have any idea that could help be on how to generate the
> VoronoiDiagram and to display, I would be grateful.
>
>
> Thanks in advance.
>
> --
> Steffan Ulysse Rigaud
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110626/5b336c10/attachment.htm>


More information about the Insight-users mailing list