Coding examples
Back
convert2spi.py : converts a micrograph to Spider format. Checks if the file needs to be unzipped. Works for ZI scanned files and some other tif formats output by other scanners.
Here are some Python scripts that perform the same functions as their *.spi counterparts from the Reconstruction with Reference Projections web page. They use some utilities from the Spider.Spiderscripts library.
defsort.py
defavg.py
plotview.py
pnums.py
snums.py
Some examples that use Tkinter to display SPIDER images:
simpleview.py : Code for a simple SPIDER image viewer:
viewseries.py : GUI for displaying a sequence of images
viewstack.py : GUI for displaying images in a SPIDER stack
spiconvert.py : Image conversion utility
runaverage.py : This module writes text to a file, which is then run in SPIDER as a batch file. It looks for a set of files matching the template, then takes the average of these files with the spider command AS R. The resulting average image is then displayed in a window.
Array example:
array2spider.py : Create a test image in Python Numeric, save it as a SPIDER image