<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 http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><base href="x-msg://5/"><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Batang;
        panose-1:2 3 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:Batang;
        panose-1:2 3 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Malgun Gothic";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:DotumChe;
        panose-1:2 11 6 9 0 1 1 1 1 1;}
@font-face
        {font-family:"\@DotumChe";
        panose-1:2 11 6 9 0 1 1 1 1 1;}
@font-face
        {font-family:"\@Batang";
        panose-1:2 3 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:"\@Malgun Gothic";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        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.apple-style-span
        {mso-style-name:apple-style-span;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
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=EN-US link=blue vlink=purple style='word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space'><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I did what you told. But still I cannot select seed point unless I call Start().<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 style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>This is the code in main():<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 style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; </span><span style='font-size:10.0pt;font-family:DotumChe'>vtkSmartPointer&lt;vtkPointHandleRepresentation2D&gt; handle = <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;</span><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;</span><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;vtkSmartPointer&lt;vtkPointHandleRepresentation2D&gt;::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;handle-&gt;GetProperty()-&gt;SetColor(1,0,0);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; vtkSmartPointer&lt;vtkSeedRepresentation&gt; rep = <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;vtkSmartPointer&lt;vtkSeedRepresentation&gt;::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; rep-&gt;SetHandleRepresentation(handle);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;<span style='color:green'>// Seed widget<o:p></o:p></span></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; vtkSmartPointer&lt;vtkSeedWidget&gt; seedWidget = <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;vtkSmartPointer&lt;vtkSeedWidget&gt;::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; seedWidget-&gt;SetInteractor(<span style='color:blue'>this</span>-&gt;ui-&gt;qvtkWidget_4-&gt;GetRenderWindow()-&gt;GetInteractor());<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; seedWidget-&gt;SetRepresentation(rep);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;vtkSmartPointer&lt;vtkSeedCallback&gt; seedCallback = <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;vtkSmartPointer&lt;vtkSeedCallback&gt;::New();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; seedCallback-&gt;SetRepresentation(rep);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; seedWidget-&gt;AddObserver(vtkCommand::PlacePointEvent,seedCallback);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; seedWidget-&gt;AddObserver(vtkCommand::InteractionEvent,seedCallback);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;seedWidget-&gt;On();<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>this</span>-&gt;ui-&gt;qvtkWidget_4-&gt;GetRenderWindow()-&gt;GetInteractor()-&gt;Start();</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><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 style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>And this is the code for interaction:<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 style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe;color:blue'>class</span><span style='font-size:10.0pt;font-family:DotumChe'> vtkSeedCallback : <span style='color:blue'>public</span> vtkCommand<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <span style='color:blue'>public</span>:<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; <span style='color:blue'>static</span> vtkSeedCallback *New()<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; { <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style='color:blue'>return</span> <span style='color:blue'>new</span> vtkSeedCallback; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;vtkSeedCallback() {}<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;<span style='color:blue'>virtual</span> <span style='color:blue'>void</span> Execute(vtkObject*, <span style='color:blue'>unsigned</span> <span style='color:blue'>long</span> <span style='color:blue'>event</span>, <span style='color:blue'>void</span> *calldata)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;Seed_Selection_Portal = <span style='color:blue'>true</span>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Seed_Selection_Tumor = <span style='color:blue'>true</span>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>if</span>(<span style='color:blue'>event</span> == vtkCommand::PlacePointEvent)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; <span style='color:#A31515'>&quot;Point placed, total of: &quot;</span> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&lt; <span style='color:blue'>this</span>-&gt;SeedRepresentation-&gt;GetNumberOfSeeds() &lt;&lt; std::endl;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>if</span>(<span style='color:blue'>event</span> == vtkCommand::InteractionEvent)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>if</span>(calldata)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; <span style='color:#A31515'>&quot;Interacting with seed : &quot;</span> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&lt; *(<span style='color:blue'>static_cast</span>&lt; <span style='color:blue'>int</span> * &gt;(calldata)) &lt;&lt; std::endl;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp; <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;std::cout &lt;&lt; <span style='color:#A31515'>&quot;List of seeds (Display coordinates):&quot;</span> &lt;&lt; std::endl;</span><span style='font-size:10.0pt;font-family:DotumChe'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:DotumChe'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style='font-size:10.0pt'>&#8230;</span><span style='font-size:10.0pt;font-family:DotumChe'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:DotumChe'>}<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:DotumChe'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thank you,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Xiaopeng<o:p></o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Clinton Stimpson [mailto:clinton@elemtech.com] <br><b>Sent:</b> Saturday, June 25, 2011 10:41 AM<br><b>To:</b> Xiaopeng Yang<br><b>Cc:</b> 'vtk'; insight-users@itk.org<br><b>Subject:</b> Re: [vtkusers] QT, VTK, and ITK combined program exit problem<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><div><p class=MsoNormal>On Jun 24, 2011, at 7:36 PM, Xiaopeng Yang wrote:<o:p></o:p></p></div><p class=MsoNormal><br><br><o:p></o:p></p><div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Clint,</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Actually I tried to use QVTKInteractor as follows:</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:DotumChe'>imageViewer1_open-&gt;SetupInteractor(<span style='color:blue'>this</span>-&gt;ui-&gt;qvtkWidget-&gt;GetRenderWindow()-&gt;GetInteractor());</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&#8230;</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:DotumChe;color:blue'>this</span><span style='font-size:10.0pt;font-family:DotumChe'>-&gt;ui-&gt;qvtkWidget-&gt;GetRenderWindow()-&gt;GetInteractor()-&gt;Start();</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Don't call Start() for a Qt application. &nbsp;Use QApplication::exec() in your main() instead.<o:p></o:p></p></div><p class=MsoNormal><br><br><o:p></o:p></p><div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>However, still the same problem occurred. Could you please let me know what mistakes I made?</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>I'm not sure why your seed point selection isn't working.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Clint<o:p></o:p></p></div><p class=MsoNormal><br><br><o:p></o:p></p><div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thank you,</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best regards,</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Xiaopeng</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in;border-width:initial;border-color:initial'><div><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span class=apple-converted-space><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;</span></span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><a href="mailto:clinton@elemtech.com">clinton@elemtech.com</a><span class=apple-converted-space>&nbsp;</span>[mailto:clinton@elemtech.com]<span class=apple-converted-space>&nbsp;</span><br><b>Sent:</b><span class=apple-converted-space>&nbsp;</span>Saturday, June 25, 2011 10:04 AM<br><b>To:</b><span class=apple-converted-space>&nbsp;</span>Xiaopeng Yang; 'vtk';<span class=apple-converted-space>&nbsp;</span><a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br><b>Subject:</b><span class=apple-converted-space>&nbsp;</span>Re: [vtkusers] QT, VTK, and ITK combined program exit problem</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>If you are using Qt, the event loop should be handled by Qt, not VTK with the iren-&gt;start.<br>Also be sure to use the QVTKInteractor instead of the type from the factory method vtkRenderWindowInteractor::New.<br><br>Clint<span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p><div id="htc_header"><p class=MsoNormal style='margin-bottom:12.0pt'>----- Reply message -----<br>From: &quot;Xiaopeng Yang&quot; &lt;<a href="mailto:yxp233@postech.ac.kr">yxp233@postech.ac.kr</a>&gt;<br>Date: Fri, Jun 24, 2011 6:42 pm<br>Subject: [vtkusers] QT, VTK, and ITK combined program exit problem<br>To: &quot;&amp;apos;vtk&amp;apos;&quot; &lt;<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>&gt;, &lt;<a href="mailto:insight-users@itk.org">insight-users@itk.org</a>&gt;<span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi All,</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I found where the problem is: &#8220;iren-&gt;Start()&#8221;. &#8220;iren&#8221; is the vtkRenderWindowInteractor I defined in my program. If I delete this sentence &#8220;iren-&gt;Start()&#8221;, then I can close both GUI and console windows without warning message &#8220;QObject::killTimers: timers cannot be stopped from another thread&#8221;. Otherwise, the problem I described in the previous Email will occur.</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>However, for seed point selection, I need &#8220;iren-&gt;Start()&#8221;. Then what should I do to solve the problem?</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best,</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Xiaopeng</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&nbsp;</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in;border-width:initial;border-color:initial'><div><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span class=apple-converted-space><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;</span></span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><a href="mailto:vtkusers-bounces@vtk.org">vtkusers-bounces@vtk.org</a><span class=apple-converted-space>&nbsp;</span>[mailto:vtkusers-bounces@vtk.org]<span class=apple-converted-space>&nbsp;</span><b>On Behalf Of<span class=apple-converted-space>&nbsp;</span></b>Xiaopeng Yang<br><b>Sent:</b><span class=apple-converted-space>&nbsp;</span>Friday, June 24, 2011 4:07 PM<br><b>To:</b><span class=apple-converted-space>&nbsp;</span>'vtk';<span class=apple-converted-space>&nbsp;</span><a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br><b>Subject:</b><span class=apple-converted-space>&nbsp;</span>[vtkusers] QT, VTK, and ITK combined program exit problem</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'><o:p></o:p></span></p></div></div></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Dear Users,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>I made a program based on QT, VTK, and ITK. When I run the program, there are GUI window and console window. When I click &#8220;exit&#8221; button in the GUI window, the GUI window exits but the console window doesn&#8217;t. When I click &#8220;exit&#8221; button in the console window, there is a message: QObject::killTimers: timers cannot be stopped from another thread. If someone already had a similar experience, please could you share your knowledge?<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Thank you very much.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Best regards,<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:13.5pt;font-family:"Helvetica","sans-serif"'>_______________________________________________<br>Powered by<span class=apple-converted-space>&nbsp;</span><a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<span class=apple-converted-space>&nbsp;</span><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the VTK FAQ at:<span class=apple-converted-space>&nbsp;</span><a href="http://www.vtk.org/Wiki/VTK_FAQ">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">http://www.vtk.org/mailman/listinfo/vtkusers</a><o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>