I'm sorry, I thought that Rob was working on this speed issue, if that's not the case then I'll see if I can bury the speed hit somewhere in the program.<br><br><div class="gmail_quote">On Mon, Nov 8, 2010 at 11:11 PM, Karthik Krishnan <span dir="ltr"><<a href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Robert :<br>
<br>
I'm not sure how the locator can improve the speed of initialization.<br>
<br>
It improves the speed of closest point queries. These occur after the<br>
widget is being manipulated (after it has been defined by the user,<br>
interactively or programmatically).<br>
<br>
Please correct me if I am wrong.<br>
<br>
<br>
Jonathan:<br>
<br>
3 seconds is IMHO expected for intialization. As I've mentioned<br>
before, the initialization of the widget, when using a Dijkstra<br>
interpolator involves building the adjacency graph to enable single<br>
source shortest path calculations. This takes a little bit of time.<br>
<br>
<br>
Thanks<br>
--<br>
<font color="#888888">karthik<br>
</font><div><div></div><div class="h5"><br>
On Tue, Nov 9, 2010 at 12:06 PM, Jonathan Morra <<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>> wrote:<br>
> I just tested it and it didn't seem to increase the speed of initialization<br>
> in my case at all. Here's what I'm doing<br>
> 1. Reslice a 3D image into a 2D plane<br>
> 2. Find the gradient magnitude in 2D.<br>
> 3. Find the inverse gradient magnitude.<br>
> 4. Set up the Dijkstra interpolator with the grad inverse as the cost image<br>
> 5. Set the following options for the interpolator<br>
><br>
> interpolator.GetDijkstraImageGeodesicPath().StopWhenEndReachedOn();<br>
><br>
> interpolator.GetDijkstraImageGeodesicPath().RepelPathFromVerticesOn();<br>
><br>
> interpolator.GetDijkstraImageGeodesicPath().SetCurvatureWeight(0.15);<br>
><br>
> interpolator.GetDijkstraImageGeodesicPath().SetEdgeLengthWeight(0.8);<br>
> interpolator.GetDijkstraImageGeodesicPath().SetImageWeight(1.0);<br>
> 6. Create a vtkContourWidget and initialize it with the same point twice.<br>
> Everything is fine except the initialization of the contour widget, that<br>
> still takes 3 seconds.<br>
> I changed my version so now I'm getting the latest source code from the git<br>
> head, this is the correct place to get it from right?<br>
> On Mon, Nov 8, 2010 at 1:04 PM, Robert Maynard <<a href="mailto:robert.maynard@kitware.com">robert.maynard@kitware.com</a>><br>
> wrote:<br>
>><br>
>> I have just merged the updated contour widget a couple minutes ago. The<br>
>> changes increase the speed of initializing the widget with large datasets<br>
>> (100K+ points ), and also increases the active point location speed.<br>
>><br>
>> On Mon, Nov 8, 2010 at 3:53 PM, Sebastien Jourdain<br>
>> <<a href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>> wrote:<br>
>>><br>
>>> No, we don't know yet...<br>
>>> Rob still need to validate its fix with our internal users...<br>
>>><br>
>>> Seb<br>
>>><br>
>>> On Mon, Nov 8, 2010 at 1:48 PM, Jonathan Morra <<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>><br>
>>> wrote:<br>
>>> > Thanks for this update, do you guys have any idea when this might be<br>
>>> > merged?<br>
>>> ><br>
>>> ><br>
>>> > On Mon, Nov 8, 2010 at 10:46 AM, Sebastien Jourdain<br>
>>> > <<a href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>> wrote:<br>
>>> >><br>
>>> >> Hi Jonathan,<br>
>>> >><br>
>>> >> Rob is currently working on vtkContourWidget to make it much faster.<br>
>>> >> Right now, its work is not merged to master yet but it's available on<br>
>>> >> the git stage of VTK...<br>
>>> >><br>
>>> >> Seb<br>
>>> >><br>
>>> >><br>
>>> >> On Mon, Nov 8, 2010 at 1:26 PM, Jonathan Morra <<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>><br>
>>> >> wrote:<br>
>>> >> > Thanks for your response. It turns out on my machine that that<br>
>>> >> > initialization is too slow. What's happening is the following<br>
>>> >> > 1. The user click indicating that they want to try a contour<br>
>>> >> > 2. A new vtkContourWidget is made with the dijkstra interpolator.<br>
>>> >> > 3. The contour widget is initialized as I described above with just<br>
>>> >> > two<br>
>>> >> > points. Adding that second point is where the slowdown occurs.<br>
>>> >> > As far as point 2, I am initializing a contour widget with the<br>
>>> >> > output of<br>
>>> >> > vtkCutter, but I am subsampling when I do that (I take 7% of the<br>
>>> >> > points), so<br>
>>> >> > I only have a handful of control points. Is there a way to<br>
>>> >> > frontload<br>
>>> >> > the<br>
>>> >> > load time so I only have to do it once as opposed to every time a<br>
>>> >> > user<br>
>>> >> > wants<br>
>>> >> > to draw a contour? That is simply too slow for my application.<br>
>>> >> > Also do you have any idea why rendering the meshes is slow? Could<br>
>>> >> > it be<br>
>>> >> > related to the point order, or is is something else?<br>
>>> >> > On Sat, Nov 6, 2010 at 8:54 AM, Karthik Krishnan<br>
>>> >> > <<a href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com</a>> wrote:<br>
>>> >> >><br>
>>> >> >> On Tue, Nov 2, 2010 at 6:31 AM, Jonathan Morra <<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>><br>
>>> >> >> wrote:<br>
>>> >> >> > on vtkDijkstraImageContourLineInterpolator and am able to<br>
>>> >> >> > successfully<br>
>>> >> >> > create the contour widget with live wire interpolation. However,<br>
>>> >> >> > when<br>
>>> >> >> > I<br>
>>> >> >> > first initialize the contour with the following code it is very<br>
>>> >> >> > slow<br>
>>> >> >> > // For now, we're just initializing the data with<br>
>>> >> >> > // the point that was clicked<br>
>>> >> >> > vtkPoints points = new vtkPoints();<br>
>>> >> >> ><br>
>>> >> >> > // The initial data MUST be at least a "line"<br>
>>> >> >> > // by giving the same point twice we are effictively creating<br>
>>> >> >> > a<br>
>>> >> >> > zero<br>
>>> >> >> > // length line<br>
>>> >> >> > points.InsertNextPoint(lastContourControlPoint);<br>
>>> >> >> > points.InsertNextPoint(lastContourControlPoint);<br>
>>> >> >> > vtkPolyData initialData = new vtkPolyData();<br>
>>> >> >> > initialData.SetPoints(points);<br>
>>> >> >> > contourWidget.Initialize(initialData, 0);<br>
>>> >> >> > The line that is slow is the last line. The weird part is that<br>
>>> >> >> > if I<br>
>>> >> >> > do<br>
>>> >> >> > not<br>
>>> >> >> > use live wire, and just use the default Bezier curve<br>
>>> >> >> > interpolation<br>
>>> >> >> > the<br>
>>> >> >> > initialization is instant.<br>
>>> >> >><br>
>>> >> >> Yes. There are 2 issues here.<br>
>>> >> >><br>
>>> >> >> 1. The dijkstra interpolator is a bit slow to start with, since<br>
>>> >> >> during<br>
>>> >> >> the time of initialization, it builds the adjacency information.<br>
>>> >> >> But<br>
>>> >> >> that's not a big deal when you are drawing on an image. The very<br>
>>> >> >> first<br>
>>> >> >> line segment placement is a bit slow (~3 seconds). After that its<br>
>>> >> >> fast<br>
>>> >> >> and interactive.<br>
>>> >> >><br>
>>> >> >> 2. The real issue, I think, here is the fact that you are<br>
>>> >> >> initializing<br>
>>> >> >> the contour with the contour with lots of control points. How many<br>
>>> >> >> of<br>
>>> >> >> them are there ? As I understand, you are generating these control<br>
>>> >> >> points from the output of vtkCutter ? Perhaps you want to sample<br>
>>> >> >> the<br>
>>> >> >> input polyline and then feed those sample points as the control<br>
>>> >> >> points.<br>
>>> >> >><br>
>>> >> >> Thanks<br>
>>> >> >> --<br>
>>> >> >> karthik<br>
>>> >> ><br>
>>> >> ><br>
>>> >> > _______________________________________________<br>
>>> >> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>> >> ><br>
>>> >> > Visit other Kitware open-source projects at<br>
>>> >> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>> >> ><br>
>>> >> > Please keep messages on-topic and check the VTK FAQ at:<br>
>>> >> > <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
>>> >> ><br>
>>> >> > Follow this link to subscribe/unsubscribe:<br>
>>> >> > <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
>>> >> ><br>
>>> >> ><br>
>>> ><br>
>>> ><br>
>><br>
>><br>
>><br>
>> --<br>
>> Robert Maynard<br>
><br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
</div></div></blockquote></div><br>