I just figured out the issue with 1. and 2. from my original email.  First, I want to thank everyone that helped me out.  The solution was twofold.<div>1.  It would appear that the vktImageActorPointPlacer can be slow (at least it is for me).  I switched over to the vtkFocalPlanePointPlacer, which works fine for my situation because I know that contours are contained within one plane.</div>
<div>2.  I was updating the other two views while editing the contour.  This was a huge slowdown for me.  Now, when I edit a contour I don&#39;t update the other two views, and everything is very fast.</div><div><br></div>
<div>Thanks again for all the help.</div><div><br></div><div>I&#39;m still working on the Dijkstra interpolator initializaiton time, but hopefully I&#39;ll get that soon too.<br><br><div class="gmail_quote">On Tue, Nov 9, 2010 at 8:54 PM, Jonathan Morra <span dir="ltr">&lt;<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">So after some more debugging I&#39;ve found the following.<div>1.  When I render the mesh cut on all three planes everything renders fine.</div>
<div>2.  What I want to do is to render the cut plane on two of the views and render vtkContourWidgets on the third plane</div>
<div>3.  When I turn on the vtkContourWidgets the rendering is very slow in the other two planes when they render (I have no idea how this is happening).</div><div>4.  I&#39;m using a vtkImageActorPointPlacer as the placer to the contour widgets.  When I change this to a bounded plane point placer the rendering is fine, but I cannot figure out how to interact with the widgets</div>

<div>5.  I have also tried a vtkFocalPlanePointPlacer, and that didn&#39;t work</div><div>6.  I was wondering how this could be happening, that when I render on other planes the speed of that render is affected by the point placer in the contour plane.</div>

<div><br></div><div>Could vtkImageActorPointPlacer be the cause of my speed issues?  I really have no idea how this is happening.</div><div><div></div><div class="h5"><div><br><div class="gmail_quote">On Tue, Nov 9, 2010 at 8:22 AM, David Gobbi <span dir="ltr">&lt;<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>&gt;</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>
Since your mesh is generated from the image, my guess is that every<br>
time the Slice is changed, the vtkImageData object is modified.  This<br>
will result in undesired re-execution of the pipeline.<br>
<br>
Your pipeline has one vtkImageData being fed into three separate<br>
pipelines, correct?  One pipeline per view?  Because the VTK imaging<br>
pipeline is a &quot;streaming&quot; pipeline in VTK-speak, each pipeline<br>
consumer will request an UpdateExtent before calling for a pipeline<br>
update.  The problem is that, if each consumer (i.e. view) requests a<br>
different UpdateExtent, then the vtkImageData object will be modified<br>
during each pipeline execution.<br>
<br>
The typical workaround for this is to call UpdateWholeExtent() on any<br>
image data that is going to be fed into multiple pipelines.  That way,<br>
every UpdateExtent that is requested will fit within the currently<br>
allocated Extent for the image.<br>
<br>
I&#39;m not saying that this is definitely going to solve the problem, but<br>
the scenario that I describe above is a fairly common one.<br>
<br>
To debug unwanted pipeline executions, I usually take a very primitive<br>
approach to debugging... I add print statements to the Execute methods<br>
of the filters that I suspect are being called at the wrong times, and<br>
then run my program from a terminal.<br>
<font color="#888888"><br>
  David<br>
</font><div><div></div><div><br>
On Tue, Nov 9, 2010 at 8:55 AM, Jonathan Morra &lt;<a href="mailto:jonmorra@gmail.com" target="_blank">jonmorra@gmail.com</a>&gt; wrote:<br>
&gt; My data is about 512*512*100 and the meshes are contained within the data.<br>
&gt;  The thing that was weird to me is that the render speed is the same whether<br>
&gt; or not I decimate the mesh.  I tried decimating the mesh by .999 and the<br>
&gt; speed was just as slow.  How can I inspect my pipeline for<br>
&gt; any weirdness that I might be doing?<br>
&gt;<br>
&gt; On Mon, Nov 8, 2010 at 8:59 PM, David Gobbi &lt;<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi Jonathan,<br>
&gt;&gt;<br>
&gt;&gt; Turning on wireframe will usually slow down the rendering (but in this<br>
&gt;&gt; case, since you are rendering just 2D contours, it might not make a<br>
&gt;&gt; difference).<br>
&gt;&gt;<br>
&gt;&gt; But I suspect that it isn&#39;t the rendering itself that is slowing you<br>
&gt;&gt; down, I think that the slowdown is the result of undesired VTK<br>
&gt;&gt; pipeline execution within the Render call.  The reason I say this is<br>
&gt;&gt; that modern 3D graphics cards can draw over 100 million triangles per<br>
&gt;&gt; second, and assuming that your voxel data is around 256*x256*256, your<br>
&gt;&gt; meshes will have approximately 500000 triangles and your graphics card<br>
&gt;&gt; will be able to draw them at over 200 frames per second.<br>
&gt;&gt;<br>
&gt;&gt; So either your meshes are much larger than my estimate, or else<br>
&gt;&gt; something is happening in the VTK pipeline to cause the mesh to be<br>
&gt;&gt; re-generated at every render.<br>
&gt;&gt;<br>
&gt;&gt;  David<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Nov 8, 2010 at 9:15 PM, Jonathan Morra &lt;<a href="mailto:jonmorra@gmail.com" target="_blank">jonmorra@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt; Is there anything I can do to speed up the Render time?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Mon, Nov 8, 2010 at 8:13 PM, Karthik Krishnan<br>
&gt;&gt; &gt; &lt;<a href="mailto:karthik.krishnan@kitware.com" target="_blank">karthik.krishnan@kitware.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On Tue, Nov 9, 2010 at 2:54 AM, Jonathan Morra &lt;<a href="mailto:jonmorra@gmail.com" target="_blank">jonmorra@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt; More information that I&#39;ve found about the first issue I reported.<br>
&gt;&gt; &gt;&gt; &gt;  I&#39;ve<br>
&gt;&gt; &gt;&gt; &gt; been narrowing down the issue, and the issue appears to be with<br>
&gt;&gt; &gt;&gt; &gt; vtkImageViewer2.SetSlice(int slice).  This method is very slow when<br>
&gt;&gt; &gt;&gt; &gt; I&#39;m<br>
&gt;&gt; &gt;&gt; &gt; rendering a vtkPolyData that represents a mesh (whether it&#39;s cut or<br>
&gt;&gt; &gt;&gt; &gt; not<br>
&gt;&gt; &gt;&gt; &gt; is<br>
&gt;&gt; &gt;&gt; &gt; actually irrelevant)<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Contrary to what you assume, It is relevant. The SetSlice method<br>
&gt;&gt; &gt;&gt; internally invokes render, so as to update the display in response to<br>
&gt;&gt; &gt;&gt; changes. A &quot;Render&quot; implies that everything displayed on this<br>
&gt;&gt; &gt;&gt; renderwindow is re-rendered. This includes the rendering the polydata.<br>
&gt;&gt; &gt;&gt; If uncut, it can be slow depending on the number of cells. If cut, it<br>
&gt;&gt; &gt;&gt; can take time to update the cutter, since the cut-function (plane) has<br>
&gt;&gt; &gt;&gt; been translated.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt; and fast when I&#39;m rendering either nothing or a<br>
&gt;&gt; &gt;&gt; &gt; vtkPolyData that represents a stack of 2D contours.  Does this help<br>
&gt;&gt; &gt;&gt; &gt; at<br>
&gt;&gt; &gt;&gt; &gt; all?<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Indeed, as mentioned above, there is no cutting to perform here.<br>
&gt;&gt; &gt;&gt; Rendering a bunch of 2D contours is probably faster than rendering<br>
&gt;&gt; &gt;&gt; your entire mesh.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; On Mon, Nov 8, 2010 at 10:26 AM, Jonathan Morra &lt;<a href="mailto:jonmorra@gmail.com" target="_blank">jonmorra@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Thanks for your response.  It turns out on my machine that that<br>
&gt;&gt; &gt;&gt; &gt;&gt; initialization is too slow.  What&#39;s happening is the following<br>
&gt;&gt; &gt;&gt; &gt;&gt; 1.  The user click indicating that they want to try a contour<br>
&gt;&gt; &gt;&gt; &gt;&gt; 2.  A new vtkContourWidget is made with the dijkstra interpolator.<br>
&gt;&gt; &gt;&gt; &gt;&gt; 3.  The contour widget is initialized as I described above with just<br>
&gt;&gt; &gt;&gt; &gt;&gt; two<br>
&gt;&gt; &gt;&gt; &gt;&gt; points.  Adding that second point is where the slowdown occurs.<br>
&gt;&gt; &gt;&gt; &gt;&gt; As far as point 2, I am initializing a contour widget with the<br>
&gt;&gt; &gt;&gt; &gt;&gt; output<br>
&gt;&gt; &gt;&gt; &gt;&gt; of<br>
&gt;&gt; &gt;&gt; &gt;&gt; vtkCutter, but I am subsampling when I do that (I take 7% of the<br>
&gt;&gt; &gt;&gt; &gt;&gt; points), so<br>
&gt;&gt; &gt;&gt; &gt;&gt; I only have a handful of control points.  Is there a way to<br>
&gt;&gt; &gt;&gt; &gt;&gt; frontload<br>
&gt;&gt; &gt;&gt; &gt;&gt; the<br>
&gt;&gt; &gt;&gt; &gt;&gt; load time so I only have to do it once as opposed to every time a<br>
&gt;&gt; &gt;&gt; &gt;&gt; user<br>
&gt;&gt; &gt;&gt; &gt;&gt; wants<br>
&gt;&gt; &gt;&gt; &gt;&gt; to draw a contour?  That is simply too slow for my application.<br>
&gt;&gt; &gt;&gt; &gt;&gt; Also do you have any idea why rendering the meshes is slow?  Could<br>
&gt;&gt; &gt;&gt; &gt;&gt; it<br>
&gt;&gt; &gt;&gt; &gt;&gt; be<br>
&gt;&gt; &gt;&gt; &gt;&gt; related to the point order, or is is something else?<br>
&gt;&gt; &gt;&gt; &gt;&gt; On Sat, Nov 6, 2010 at 8:54 AM, Karthik Krishnan<br>
&gt;&gt; &gt;&gt; &gt;&gt; &lt;<a href="mailto:karthik.krishnan@kitware.com" target="_blank">karthik.krishnan@kitware.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; On Tue, Nov 2, 2010 at 6:31 AM, Jonathan Morra &lt;<a href="mailto:jonmorra@gmail.com" target="_blank">jonmorra@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; on vtkDijkstraImageContourLineInterpolator and am able to<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; successfully<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; create the contour widget with live wire interpolation. However,<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; when I<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; first initialize the contour with the following code it is very<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; slow<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;     // For now, we&#39;re just initializing the data with<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;     // the point that was clicked<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;     vtkPoints points = new vtkPoints();<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;     // The initial data MUST be at least a &quot;line&quot;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;     // by giving the same point twice we are effictively creating<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; a<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; zero<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;     // length line<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;     points.InsertNextPoint(lastContourControlPoint);<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;     points.InsertNextPoint(lastContourControlPoint);<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;     vtkPolyData initialData = new vtkPolyData();<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;     initialData.SetPoints(points);<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;     contourWidget.Initialize(initialData, 0);<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; The line that is slow is the last line.  The weird part is that<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; if I<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; do<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; not<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; use live wire, and just use the default Bezier curve<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; interpolation<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; the<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; initialization is instant.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Yes. There are 2 issues here.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; 1. The dijkstra interpolator is a bit slow to start with, since<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; during<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; the time of initialization, it builds the adjacency information.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; But<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; that&#39;s not a big deal when you are drawing on an image. The very<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; first<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; line segment placement is a bit slow (~3 seconds). After that its<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; fast<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; and interactive.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; 2. The real issue, I think, here is the fact that you are<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; initializing<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; the contour with the contour with lots of control points. How many<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; of<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; them are there ? As I understand, you are generating these control<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; points from the output of vtkCutter ? Perhaps you want to sample<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; the<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; input polyline and then feed those sample points as the control<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; points.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Thanks<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; --<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; karthik<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Visit other Kitware open-source projects at<br>
&gt;&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt;&gt; &gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; &gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>