HOWTO: DECONVOLUTION OF MICROSCOPE IMAGE SETS using WinNT or Win9*.

back to xcosm home page

This is what you need know in order to use the regularized  expectation maximization deconvolution algorithm  developed by  J.-A. Conchello  and coded in "C" by Keith Doolittle  of  Washington University,  St. Louis. And a program for generating PSF 's by Conchello, Doolittle,   Zou  and Preza  The algorithms and utility programs are easily separated from the X-Window dependent interface and can be used as command line programs.  These can be compiled very simply from the C source code using the CYGNUS tools - a port of many of the GNU development tools including the GNU C compiler.

At a minimum you will also need these files that should be included with this:

"psf_help" is the text of the original online documentation from the C source files for generating PSFs.
"psf.template" is a template for the XCOSM_PSF  program and will have to be changed to reflect your conditions
"deconv.template"  is a template for the XCOSM_EM  program and will have to be changed to reflect your conditions

You must also read the original documentation "README"  files at come with the XCOSM Package.

HARDWARE REQUIREMENTS:

The EM algorithm needs RAM resources equal to about 24*X*Y*Z bytes (where X, Y, Z are the size of the data set).   Data sets which are larger than physical RAM will cause much slower processing.  Processing time depends on processor speed and data set size.  Each iteration requires about 35 seconds for a data size of 256x256x64 on a Pentium II 350 MHz.  100 or more iterations are commonly used for this type of algorithm.

MAKING THE PROGRAMS:

(note commands to type are given in bold below are given within the Cygwin shell):

 Go to the Cygwin site to down load then install the Cygwin tools: http://sourceware.cygnus.com/cygwin/      "The Cygwin tools are ports of the popular GNU development tools and utilities for Windows 95, 98, and NT. They function by using the Cygwin library which provides a UNIX-like API on top of the Win32 API"  (quote from the web site).  This means that you can fairly easily produce executable programs from "C" source code written for a UNIX-like environments.

Within the cygwin shell basic UNIX commands are available.  These include:
 
 

UNIX DOS
cd cd
cp copy
rm del
mv = move not in DOS

note: cd //c  brings you to the root of C: drive.

Get the XCOSM source code: http://3Dmicroscopy.wustl.edu/~xcosm.  Read the instructions at the site for unpacking the code.  Currently it is an uncompressed tar archive so:   cat <archive_name> | tar xvf -     should work as well.  This will create a new subdirectory XCOSM containing all the source files.

Apply the patch file (cygwin_diffs) provided:

patch  < cygwin_diffs    this makes minor changes in the code.  I'm not too familiar with using patch so you will probably get a message something like this:
 

can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -bur XCOSM/Makefile new/Makefile
|--- XCOSM/Makefile     Fri Apr 07 12:48:34 2000
|+++ new/Makefile       Wed Apr 12 14:37:30 2000
--------------------------
File to patch:

at this point just type the file name on the "--- "line  (XCOSM/Makefile,  in this case)  to apply each patch and then the other filenames as prompted.

After all the "hunks"  are applied to the different files (there are  4 files to be changed in total)  the code should be ready to build.  If you have trouble with patch look at the cygwin_diffs file.  It contains the information you need to make the changes:  under each file name there are "-" lines to be removed and "+" lines to be added surrounded by a few lines of context.  Each hunk is marked by a "@@" line.  Use a text editor (e.g. Wordpad) and make sure not to change the name of the file when saved.

To make the executable programs:
 

cd XCOSM
make utils
make xcosm_em
make xcosm_psf


You should now have a number of .exe files in the XCOSM and the HEADSRC and PSF sub directories.  Move these to somewhere on your path  (e.g. C:\WINDOWS).  You can now run the programs from the Cygwin shell (or from a DOS prompt if the cygwin1.dll is also linked to your path).
 

BASIC PROCEDURE:

For most users, file headers will have to be removed from the original data sets.  If you can convert the image stacks to a series of TIFF format files the tiffs2washu utility can also be used.  This utility doesn't support all of the various features of the TIFF format.

Assuming that the raw data set can be prepared the normal procedure would involve typing the commands in a DOS window:

addh <raw_data_file> (add 1024 byte washu header) or tiifs2washu
xcosm_psf <psf.templateor generate your own psf  and prepare it using the utilities
 ===wait=========
xcosm_em <deconv.template>
======= wait - can be hours depending on the data array size and number of iterations========
tobyte <deblurred.image.data> (converts float type data array to byte for viewing).
removeh <deblurred.image.data> (removes washu header)

Templates of the text files psf.template   and deconv.template used by xcosm_psf and xcosm_em, respectively are included.  They will have to be edited to fit your configuration.

You have to use the utilities to manipulate your experimentally derived psfs (see README.PSF).

back to xcosm home page

Prepared by Andrew Ridsdale. April 2000.