[vtkusers] 3 speed questions

Jonathan Morra jonmorra at gmail.com
Mon Nov 8 13:26:59 EST 2010


Thanks for your response.  It turns out on my machine that that
initialization is too slow.  What's happening is the following
1.  The user click indicating that they want to try a contour
2.  A new vtkContourWidget is made with the dijkstra interpolator.
3.  The contour widget is initialized as I described above with just two
points.  Adding that second point is where the slowdown occurs.

As far as point 2, I am initializing a contour widget with the output of
vtkCutter, but I am subsampling when I do that (I take 7% of the points), so
I only have a handful of control points.  Is there a way to frontload the
load time so I only have to do it once as opposed to every time a user wants
to draw a contour?  That is simply too slow for my application.

Also do you have any idea why rendering the meshes is slow?  Could it be
related to the point order, or is is something else?

On Sat, Nov 6, 2010 at 8:54 AM, Karthik Krishnan <
karthik.krishnan at kitware.com> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101108/c9aa6053/attachment.htm>


More information about the vtkusers mailing list