Displaying images with Tkinter
To display images, you need a graphics library, such as Tk, wxWindows,
or Qt. Tkinter is the Python interface to the Tk library, included
with the Python distribution.
The Tkinter Manual
Tkinter documentation and links
The example below uses the Python Imaging Library (PIL) to read SPIDER
images into Python, and the
ImageTk module from PIL to
paste photos into the Tkinter graphics display.
SPIDER images must be converted to byte format before they can be
converted to Tk.PhotoImages. The standard PIL method for converting to
new = im.convert('L')
often fails for very small floating point numbers, so it is better to
which is a method of
SPIDER files that have been opened in Image.
import Image, ImageTk
im = Image.open('slice001.hrs').convert2byte()
root = Tkinter.Tk()
tkimage = ImageTk.PhotoImage(im)
Code for a simple SPIDER image
GUI for displaying a sequence of
GUI for displaying a images in a SPIDER
For more elaborate examples, see the Graphical tools supplied with Spire.