Is there anything I can do to speed up the Render time?<br><br><div class="gmail_quote">On Mon, Nov 8, 2010 at 8:13 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;"><div class="im">On Tue, Nov 9, 2010 at 2:54 AM, Jonathan Morra <<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>> wrote:<br>
> More information that I've found about the first issue I reported. I've<br>
> been narrowing down the issue, and the issue appears to be with<br>
> vtkImageViewer2.SetSlice(int slice). This method is very slow when I'm<br>
> rendering a vtkPolyData that represents a mesh (whether it's cut or not is<br>
> actually irrelevant)<br>
<br>
</div>Contrary to what you assume, It is relevant. The SetSlice method<br>
internally invokes render, so as to update the display in response to<br>
changes. A "Render" implies that everything displayed on this<br>
renderwindow is re-rendered. This includes the rendering the polydata.<br>
If uncut, it can be slow depending on the number of cells. If cut, it<br>
can take time to update the cutter, since the cut-function (plane) has<br>
been translated.<br>
<div class="im"><br>
> and fast when I'm rendering either nothing or a<br>
> vtkPolyData that represents a stack of 2D contours. Does this help at all?<br>
<br>
</div>Indeed, as mentioned above, there is no cutting to perform here.<br>
Rendering a bunch of 2D contours is probably faster than rendering<br>
your entire mesh.<br>
<div><div></div><div class="h5"><br>
><br>
> On Mon, Nov 8, 2010 at 10:26 AM, Jonathan Morra <<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>> wrote:<br>
>><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 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 output of<br>
>> vtkCutter, but I am subsampling when I do that (I take 7% of the points), so<br>
>> I only have a handful of control points. Is there a way to frontload the<br>
>> load time so I only have to do it once as opposed to every time a user 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 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 successfully<br>
>>> > create the contour widget with live wire interpolation. However, when I<br>
>>> > first initialize the contour with the following code it is very 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 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 if I do<br>
>>> > not<br>
>>> > use live wire, and just use the default Bezier curve interpolation 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 during<br>
>>> the time of initialization, it builds the adjacency information. But<br>
>>> that's not a big deal when you are drawing on an image. The very first<br>
>>> line segment placement is a bit slow (~3 seconds). After that its fast<br>
>>> and interactive.<br>
>>><br>
>>> 2. The real issue, I think, here is the fact that you are initializing<br>
>>> the contour with the contour with lots of control points. How many 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 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>
</div></div></blockquote></div><br>