[Insight-users] Display itkVoronoiDiagram2D
wanlin
wanlinzhu at gmail.com
Mon Jun 27 23:37:27 EDT 2011
Hi, Steffan,
You need add points to the voronoiDiagram explicitly so far. In the itk wiki
example
http://www.itk.org/Wiki/ITK/Examples/Segmentation/WishList/VoronoiDiagram2DGenerator
for(allVerts = voronoiDiagram->VertexBegin(); allVerts !=
voronoiDiagram->VertexEnd(); ++allVerts)
{
std::cout << "Vertices No." << j;
voronoiDiagram->SetPoint(j, *allVerts); ////////add this line
j++;
std::cout << ": At (" << (*allVerts)[0] << "," << (*allVerts)[1] << ")"
<< std::endl;
}
The output voronoi.vtk will be correct.
wanlin
On Tue, Jun 28, 2011 at 12:34 PM, Steffan <ulysse.rigaud at gmail.com> wrote:
> I've replace my VTKPolyDataWriter<VoronoiDiagram2DType>
> by VTKPolyDataWriter<VoronoiDiagram2DType::Superclass> and it compiles.
> And I end up at the same point as you David, Paraview crash.
>
> I've looked up to the voronoi.vtk:
>
> # vtk DataFile Version 2.0
> File written by itkVTKPolyDataWriter
> ASCII
> DATASET POLYDATA
> POINTS 0 float
> POLYGONS 5 29
> 5 0 0 0 0 0
> 5 0 0 0 0 0
> 4 0 0 0 0
> 5 0 0 0 0 0
> 5 0 0 0 0 0
>
> There are clearly some missing data in order to display the voronoi
> diagram, which explain why Paraview crash.
> I think there is a different data structure between Mesh and
> VoronoiDiagram2D.
> 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.
> And if you use VoronoiDiagram2D as template value for the writer, you will
> end up with the same compilation errors I had:
> itkVTKPolyDataWriter.txx:191: error: invalid conversion from … to …
> itkVTKPolyDataWriter.txx:225: error: invalid conversion from … to …
> itkVTKPolyDataWriter.txx:240: error: invalid conversion from … to …
>
> --
> Steffan
>
> On Monday, June 27, 2011 at 7:12 PM, David Doria wrote:
>
> On Sun, Jun 26, 2011 at 11:16 PM, Steffan <ulysse.rigaud at gmail.com> wrote:
>
> That's right, a C/C error, but that doesn't change anything to my problem.
> I only give an x,y coordinates, but I also tried by adding a z coordinates,
> that didn't change anything.
> thanks for notice it :)
>
>
> I have been trying to do the same thing. It seems to run fine, but
> when trying to open the .vtk file in Paraview, Paraview crashes:
>
>
> http://www.itk.org/Wiki/ITK/Examples/Segmentation/WishList/VoronoiDiagram2DGenerator
>
> David
>
>
>
> _____________________________________
> 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/20110628/4f3486d8/attachment-0001.htm>
More information about the Insight-users
mailing list