<div dir="ltr">That Render() call should not be made before the canvas is connected into a Swing parent component. That component can be non visible, but if it is just by itself, this is normal to see the behavior that you noticed.<div>
<br></div><div style>Seb</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 10, 2013 at 5:08 AM, Marco Sambin <span dir="ltr"><<a href="mailto:m.sambin@gmail.com" target="_blank">m.sambin@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Seb,<div><br></div><div>thanks for your reply.</div><div>The short answer is: yes, I am building and adding my vtkCanvas to my application GUI in the EDT.</div>
<div><br></div><div>Let me explain a bit more how my application is working: this is a Swing-based Java application, managing medical images. When I press a button on the GUI of this application, the VTK-based reslicing feature (based on vtkImagePlaneWidget's functionality) is invoked.</div>
<div><br></div><div>In particular, the three vtkImagePlaneWidgets are initialized, are connected with a Reader loading the volume (which was initialized in a separate thread), and they are placed in the vtkCanvas. This vtkCanvas is then added to a JPanel inside my application's GUI.</div>
<div><br></div><div>Debugging my application, I have noticed that the separate "Visualization Toolkit" window appears upon calling the Render() method on my vtkCanvas in a moment when the vtkCanvas hasn't been added to the parent JPanel yet.</div>
<div><br></div><div>Shall I absolutely avoid calling Render() on a vtkCanvas which is not visible yet?</div><div><br></div><div>Thanks and best regards,</div><div><br></div><div>Marco</div><div><div class="h5">
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 9, 2013 at 6:58 PM, Sebastien Jourdain <span dir="ltr"><<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@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 dir="ltr">How do you do the vtkCanvas binding within your frame ?<div>Does that piece of code get executed inside the EDT ?</div>
<div><br></div><div>Since you are using vtk 6, you should probably use the new rendering class for Java which should give you more freedom. To learn more about them, you can look at our sample applications inside the Wrapping/Java directory within the source tree.</div>
<div><br></div><div>Seb</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 9, 2013 at 12:44 PM, Marco Sambin <span dir="ltr"><<a href="mailto:m.sambin@gmail.com" target="_blank">m.sambin@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all.<div><br></div><div>In my Java application, I am using a vtkCanvas where three vtkImagePlaneWidgets are displayed, each one cutting a specific section of my volume (deriving from a medical data set).</div>
<div><br></div><div>At application startup, when the GUI of my Java application is built, I see for a few moments a pop-up window titled "Visualization Toolkit", containing my three vtkImagePlaneWidgets. After a second or so, this window disappears, and its content is then displayed inside my vtkCanvas, embedded in the GUI of my application, as expected.</div>
<div><br></div><div>Is the appearance of this window normal? Is there a way to prevent that separate "Visualization Toolkit" window from appearing, and have the content displayed directly inside my vtkCanvas?</div>
<div><br></div><div>I am running VTK 6.0 (from GIT) and Java 7 64-bit on a Windows 7 64-bit PC.</div><div><br></div><div>Thanks in advance for all your comments.</div><div>Best regards,</div>
<div><br></div><div>Marco</div><div><br></div></div>
<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 <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: <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></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div>
<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 <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: <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></blockquote></div><br></div>