[vtkusers] problem with vtkDijkstraGraphGeodesicPath() and vtkXMLPolyDataReader output

Karthik Krishnan karthik.krishnan at kitware.com
Tue Oct 20 06:22:24 EDT 2009


You need to post the polydata that you have. You've mentioned yourself
that it does work with the sphere source. So there must be an issue
with your data that results in no path being found between the source
and end vertex. Perhaps  you can try to run a connectivity filter on
the dataset to see if one can indeed traverse on the edges between the
two vertices.

This class is tested on terrain polydata and used to draw
interactively on polygonal datsets. See
TestDijkstraGraphGeodesicPath.cxx . There are no known issues with it.


--
karthik

On Tue, Oct 20, 2009 at 5:45 AM, RimAY <rim.ayari at gmail.com> wrote:
>
> Dear All ,
>
> I try to get the shortest path  between two cell in a vtk image, then trace
> it with vtkTubeFilter(). I read the vtk file and get the output of the
> vtkXMLPolyDataReader(). then I choose two cell: start_point and end_point to
> find the shortest path  between them. My problem is that I got always the
> error:
>
> vtkTubeFilter (0F432C08): Less than two points in line! or
>
> I use the same code with the vtkSphereSource output and it work.
> this is a part of my code:
>
> readerVTK = vtkXMLPolyDataReader()
> readerVTK.SetFileName("file")
> readerVTK.Update()
>
> data = vtkPolyData()
> data = readerVTK.GetOutput()
> data.Update()
>
> geodesic = vtk.vtkDijkstraGraphGeodesicPath()
> geodesic.SetInput(data)
> geodesic.SetStartVertex( start_point )
> geodesic.SetEndVertex( end_point )
> geodesic.Update()
>
> points = vtkPolyData()
> points = geodesic.GetOutput()
>
> tube = vtk.vtkTubeFilter()
> tube.SetInput(points)
> tube.SetRadius(1.5)
> tube.Update()
>
> tubeMapper = vtkPolyDataMapper()
> tubeMapper.SetInputConnection(tube.GetOutputPort())
>
>
> Any help will be very appreciated
> Best Regards
>
>
>
>
>
> --
> View this message in context: http://www.nabble.com/problem-with-vtkDijkstraGraphGeodesicPath%28%29-and-vtkXMLPolyDataReader-output-tp25972428p25972428.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list