My data is about 512*512*100 and the meshes are contained within the data. The thing that was weird to me is that the render speed is the same whether or not I decimate the mesh. I tried decimating the mesh by .999 and the speed was just as slow. How can I inspect my pipeline for any weirdness that I might be doing?<br>
<br><div class="gmail_quote">On Mon, Nov 8, 2010 at 8:59 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Jonathan,<br>
<br>
Turning on wireframe will usually slow down the rendering (but in this<br>
case, since you are rendering just 2D contours, it might not make a<br>
difference).<br>
<br>
But I suspect that it isn't the rendering itself that is slowing you<br>
down, I think that the slowdown is the result of undesired VTK<br>
pipeline execution within the Render call. The reason I say this is<br>
that modern 3D graphics cards can draw over 100 million triangles per<br>
second, and assuming that your voxel data is around 256*x256*256, your<br>
meshes will have approximately 500000 triangles and your graphics card<br>
will be able to draw them at over 200 frames per second.<br>
<br>
So either your meshes are much larger than my estimate, or else<br>
something is happening in the VTK pipeline to cause the mesh to be<br>
re-generated at every render.<br>
<font color="#888888"><br>
David<br>
</font><div><div></div><div class="h5"><br>
On Mon, Nov 8, 2010 at 9:15 PM, Jonathan Morra <<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>> wrote:<br>
> Is there anything I can do to speed up the Render time?<br>
><br>
> On Mon, Nov 8, 2010 at 8:13 PM, Karthik Krishnan<br>
> <<a href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com</a>> wrote:<br>
>><br>
>> 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<br>
>> > is<br>
>> > actually irrelevant)<br>
>><br>
>> 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>
>><br>
>> > and fast when I'm rendering either nothing or a<br>
>> > vtkPolyData that represents a stack of 2D contours. Does this help at<br>
>> > all?<br>
>><br>
>> 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>
>><br>
>> ><br>
>> > On Mon, Nov 8, 2010 at 10:26 AM, Jonathan Morra <<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>><br>
>> > 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<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 output<br>
>> >> 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 frontload<br>
>> >> the<br>
>> >> load time so I only have to do it once as opposed to every time a 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 it<br>
>> >> 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 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<br>
>> >>> > do<br>
>> >>> > not<br>
>> >>> > use live wire, and just use the default Bezier curve 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 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>
><br>
><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<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>