<div dir="ltr"><div>Hi Aude,</div><div><br></div><div>What version of VTK are you using?</div><div><br></div><div>Can you try loading the vtkTkRederWidget binary model before opening the file dialog? For example, something like this:</div><div><br></div><div><div>    import Tkinter</div><div>    from vtk.tk.vtkLoadPythonTkWidgets import vtkLoadPythonTkWidgets</div><div>    vtkLoadPythonTkWidgets(Tkinter.Tk())</div></div><div><br></div><div> - David</div><div><br></div><div><br></div><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 11, 2016 at 5:38 AM, CHENET Aude (External) <span dir="ltr"><<a href="mailto:Aude.CHENET-ext@galderma.com" target="_blank">Aude.CHENET-ext@galderma.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">





<div lang="FR" link="blue" vlink="purple">
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span lang="EN-US">I’m using vtk with python and try to do the following program :<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Choose a file using tkFileDialog (filepath = tkFileDialog.askopenfilename(title="Choisir une image",filetypes=[('tif files','.tif'),('tiff files','.tiff')]))<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US">Show the image in a window (render_widget</span><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:black"> = vtkTkRenderWindowInteractor(renderer_frame,</span><span lang="EN-US" style="font-size:10pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:black">                                                    </span><span style="font-size:10pt;font-family:Consolas;color:black">rw=renWin,
 width=</span><span style="font-size:10pt;font-family:Consolas;color:maroon">600</span><span style="font-size:10pt;font-family:Consolas;color:black">,</span><span style="font-size:10pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Consolas;color:black">                                                    height=</span><span style="font-size:10pt;font-family:Consolas;color:maroon">500</span><span style="font-size:10pt;font-family:Consolas;color:black">))</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US">My program have the following error
<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:red">Traceback (most recent call last):</span><span lang="EN-US" style="font-size:10pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:red"> 
</span><u><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:rgb(0,102,204)">File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line 328, in <module></span></u><span lang="EN-US" style="font-size:10pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:red">    V = Viewer(filepath)#("D:\resultatsOCT\Didier Cheek01 b_reconstr.tif”)<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:red"> 
</span><u><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:rgb(0,102,204)">File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line 165, in __init__</span></u><span lang="EN-US" style="font-size:10pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:red">    height=500)</span><span lang="EN-US" style="font-size:10pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:red"> 
</span><u><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:rgb(0,102,204)">File "C:\Python27\Lib\site-packages\vtk\tk\vtkTkRenderWindowInteractor.py", line 70, in __init__</span></u><span lang="EN-US" style="font-size:10pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:red">    Tkinter.Widget.__init__(self, master, 'vtkTkRenderWidget', cnf, kw)</span><span lang="EN-US" style="font-size:10pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:red"> 
</span><u><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:rgb(0,102,204)">File "C:\Python27\Lib\lib-tk\Tkinter.py", line 2090, in __init__</span></u><span lang="EN-US" style="font-size:10pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:red">    (widgetName, self._w) + extra + self._options(cnf))</span><span lang="EN-US" style="font-size:10pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:red">_tkinter.TclError: invalid command name "vtkTkRenderWidget"<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10pt;font-family:Consolas;color:red"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">The program runs normally if I don’t call tkFileDialog to choose the file. It seems like we can’t call tkFileDialog and then create a vtkTkRenderWindowInteractor<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Does anyone have an idea?<span class=""><font color="#888888"><u></u><u></u></font></span></span></p><span class=""><font color="#888888">
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Aude<u></u><u></u></span></p>
</font></span></div>
</div>

</blockquote></div><br></div></div>