<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=FR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>As said by Sebastien, you can just add a test on isShowing() before calling Render() on your panel, to be sure the parent component is connected.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Fred<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>De&nbsp;:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> vtkusers-bounces@vtk.org [mailto:vtkusers-bounces@vtk.org] <b>De la part de</b> Sebastien Jourdain<br><b>Envoyé&nbsp;:</b> vendredi 10 mai 2013 15:01<br><b>À&nbsp;:</b> Marco Sambin<br><b>Cc&nbsp;:</b> vtkusers@vtk.org<br><b>Objet&nbsp;:</b> Re: [vtkusers] vtkCanvas and &quot;Visualization Toolkit&quot; window<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>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.<o:p></o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Seb<o:p></o:p></p></div></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>On Fri, May 10, 2013 at 5:08 AM, Marco Sambin &lt;<a href="mailto:m.sambin@gmail.com" target="_blank">m.sambin@gmail.com</a>&gt; wrote:<o:p></o:p></p><div><p class=MsoNormal>Hi Seb,<o:p></o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>thanks for your reply.<o:p></o:p></p></div><div><p class=MsoNormal>The short answer is: yes, I am building and adding my vtkCanvas to my application GUI in the EDT.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>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.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>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.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Debugging my application, I have noticed that the separate &quot;Visualization Toolkit&quot; 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.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Shall I absolutely avoid calling Render() on a vtkCanvas which is not visible yet?<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Thanks and best regards,<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Marco<o:p></o:p></p></div><div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>On Thu, May 9, 2013 at 6:58 PM, Sebastien Jourdain &lt;<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>&gt; wrote:<o:p></o:p></p><div><p class=MsoNormal>How do you do the vtkCanvas binding within your frame ?<o:p></o:p></p><div><p class=MsoNormal>Does that piece of code get executed inside the EDT ?<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>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.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Seb<o:p></o:p></p></div></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>On Thu, May 9, 2013 at 12:44 PM, Marco Sambin &lt;<a href="mailto:m.sambin@gmail.com" target="_blank">m.sambin@gmail.com</a>&gt; wrote:<o:p></o:p></p><div><p class=MsoNormal>Hi all.<o:p></o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>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).<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>At application startup, when the GUI of my Java application is built, I see for a few moments a pop-up window titled &quot;Visualization Toolkit&quot;, containing my three vtkImagePlaneWidgets. After a second or so, &nbsp;this window disappears, and its content is then displayed inside my vtkCanvas, embedded in the GUI of my application, as expected.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Is the appearance of this window normal? Is there a way to prevent that separate &quot;Visualization Toolkit&quot; window from appearing, and have the content displayed directly inside my vtkCanvas?<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>I am running VTK 6.0 (from GIT) and Java 7 64-bit on a Windows 7 64-bit PC.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Thanks in advance for all your comments.<o:p></o:p></p></div><div><p class=MsoNormal>Best regards,<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Marco<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><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><o:p></o:p></p></div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></div></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><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><o:p></o:p></p></div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></div><p class="ecxMsoNormal" style="line-height: 19px; margin: 0px 0px 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; color: #2a2a2a; ">*******************************</p><p class="ecxMsoNormal" style="line-height: 19px; margin: 0px 0px 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; color: #2a2a2a; "><span lang="EN-GB" style="line-height: 17px; font-size: 10pt; color: black; font-family: Arial; ">This e-mail contains information for the intended recipient only. It may contain proprietary material or&nbsp;confidential information. If you are not the intended recipient you are not authorised to&nbsp;distribute, copy or use this e-mail or any attachment to it.&nbsp;</span><span style="font-family: Arial" color="black" size="2"><span style="line-height: 17px; font-size: 10pt; ">Murex&nbsp;cannot guarantee that it is virus free and accepts no responsibility for any loss or damage arising from its use.&nbsp;If you have received this e-mail in error please&nbsp;notify immediately&nbsp;the sender&nbsp;and&nbsp;delete the original email received, any attachments and all copies from your system.</span></span></p></body></html>