[vtkusers] 3 speed questions

Karthik Krishnan karthik.krishnan at kitware.com
Sat Nov 6 11:54:17 EDT 2010


On Tue, Nov 2, 2010 at 6:31 AM, Jonathan Morra <jonmorra at gmail.com> wrote:
> on vtkDijkstraImageContourLineInterpolator and am able to successfully
> create the contour widget with live wire interpolation. However, when I
> first initialize the contour with the following code it is very slow
>     // For now, we're just initializing the data with
>     // the point that was clicked
>     vtkPoints points = new vtkPoints();
>
>     // The initial data MUST be at least a "line"
>     // by giving the same point twice we are effictively creating a zero
>     // length line
>     points.InsertNextPoint(lastContourControlPoint);
>     points.InsertNextPoint(lastContourControlPoint);
>     vtkPolyData initialData = new vtkPolyData();
>     initialData.SetPoints(points);
>     contourWidget.Initialize(initialData, 0);
> The line that is slow is the last line.  The weird part is that if I do not
> use live wire, and just use the default Bezier curve interpolation the
> initialization is instant.

Yes. There are 2 issues here.

1. The dijkstra interpolator is a bit slow to start with, since during
the time of initialization, it builds the adjacency information. But
that's not a big deal when you are drawing on an image. The very first
line segment placement is a bit slow (~3 seconds). After that its fast
and interactive.

2. The real issue, I think, here is the fact that you are initializing
the contour with the contour with lots of control points. How many of
them are there ? As I understand, you are generating these control
points from the output of vtkCutter ? Perhaps you want to sample the
input polyline and then feed those sample points as the control
points.

Thanks
--
karthik



More information about the vtkusers mailing list