Presentation is loading. Please wait.

Presentation is loading. Please wait.

Electronic Visualization Laboratory University of Illinois at Chicago VTK-Python and Other CS 526 Things Allan Spale

Similar presentations


Presentation on theme: "Electronic Visualization Laboratory University of Illinois at Chicago VTK-Python and Other CS 526 Things Allan Spale"— Presentation transcript:

1 Electronic Visualization Laboratory University of Illinois at Chicago VTK-Python and Other CS 526 Things Allan Spale aspale@evl.uic.edu

2 Electronic Visualization Laboratory University of Illinois at Chicago You Won’t Have All the Answers It’s likely that no one else will know everything either –Don’t be afraid to ask questions Unless you like to spend 2 hours staring at the screen instead of doing something else –Some people are likely feeling the same way that you are Be open to sharing your setup knowledge with others at the appropriate time –Some people are more than willing to help out

3 Electronic Visualization Laboratory University of Illinois at Chicago Why I Used Python with VTK No segmentation faults…well, most of the time Ports to all platforms Interpreted language –Try stuff from the Python “command line”…except for GUI stuff Weakly typed, object-orientated language The tradeoff –Tkinter (the somewhat unpleasant UI toolkit with Python) –Could try wxPython bindings (there should be VTK support)… http://www.wxpython.orghttp://www.wxpython.org

4 Electronic Visualization Laboratory University of Illinois at Chicago Python Where to download the code/executables, read documentation –http://www.python.orghttp://www.python.org –Use the Python editor (IDLE) or your favorite text editor If you really like Windows and want to use Python… –Download a nice IDE from http://www.activestate.orghttp://www.activestate.org If you really like Java but want to try Python –Go to http://www.jython.org (Java implementation of Python)http://www.jython.org Disclaimer: I have not tried VTK and Jython

5 Electronic Visualization Laboratory University of Illinois at Chicago VTK-Python Setup http://www.imaging.robarts.ca/~dgobbi/vtk/vtkpython.html http://www.imaging.robarts.ca/~dgobbi/vtk/vtkpython.html 1.Download and install/compile Python –Upside: If you are using the CD from the book, Python is already there in a nice “happy” format Downside: It’s old…Python 2.1 Downside: If you feel adventurous and want to use wxPython (wxWindows), good luck trying to get a compatible version with the old Python 2.In the directory that Python is installed, make a file called VTK.pth This text file should only contain the letters VTK

6 Electronic Visualization Laboratory University of Illinois at Chicago VTK-Python Setup http://www.imaging.robarts.ca/~dgobbi/vtk/vtkpython.html http://www.imaging.robarts.ca/~dgobbi/vtk/vtkpython.html 3.Make a directory in the Python root directory called vtk. –Copy all the files and directories from vtk42\Wrapping\Python (or your appropriate path) to the vtk directory in the Python root directory 4.Follow the instructions in the README.txt file for installation option 3 (found at http://www.imaging.robarts.ca/~dgobbi/vtk/vt kpython.html in the link named README.python) http://www.imaging.robarts.ca/~dgobbi/vtk/vt kpython.html –This basically ends up calling python setup.py.in install...wherever the setup.py.in files are located.

7 Electronic Visualization Laboratory University of Illinois at Chicago VTK-Python Setup http://www.imaging.robarts.ca/~dgobbi/vtk/vtkpython.html http://www.imaging.robarts.ca/~dgobbi/vtk/vtkpython.html 5.From vtk42\bin, I would just copy everything to the vtk directory of the Python root directory. –Windows note: one could be more careful, but I did not feel like picking and choosing the not-so-obvious.dlls and.exes that did not have Python in the name 6.Make a system variable VTK_DATA_ROOT to correspond to the directory with the data for all the example files. –You will learn more by playing with the examples provided by VTK than you will reading documentation –The documentation is a bit difficult to understand –At first, it’s hard to find what you are looking for

8 Electronic Visualization Laboratory University of Illinois at Chicago Links of Hope Repeating a useful VTK-Python link –http://www.imaging.robarts.ca/~dgobbi/vtk/v tkpython.htmlhttp://www.imaging.robarts.ca/~dgobbi/vtk/v tkpython.html –Has Python-VTK code examples Allan’s VTK Tutorial –http://www.evl.uic.edu/aspalehttp://www.evl.uic.edu/aspale Click on the link VTK Tutorial Courtesy of Andy’s final from last year Tkinter PDF –Do a Google search for “An Introduction to Tkinter”

9 Electronic Visualization Laboratory University of Illinois at Chicago And For Those of You Who Studied These Slides Prepare beforehand for demo presentations Slides should have a good style and be organized in a logical manner –Text should be easy to read –Style should not detract from the presentation Bring a watch to carefully monitor how much time you are spending –Things break or do not work the first time –Have a backup plan Take questions up-front while fixing things –Know when to give up if things won’t work

10 Electronic Visualization Laboratory University of Illinois at Chicago Questions and Answers


Download ppt "Electronic Visualization Laboratory University of Illinois at Chicago VTK-Python and Other CS 526 Things Allan Spale"

Similar presentations


Ads by Google