Thomas Frese, 5/11/2001, frese@ecn.purdue.edu


This directory contains code for convolution
backprojection (CBP) for the IndyPET scanner.

The code is somewhat experimental and meant
for research use - specifically, it requires
that the CBP reconstruction filter is first 
generated in matlab (supplied routine mkfilt.m, 
filters are in filters/ subdirectory) before
using the cbp reconstruction program.

For installation instructions, see the file README.INSTALL.



Sections in this file:

I. General description
II. Using the program
III. Example supplied
 



I. General description
-------------------------------------------------------

The CBP code in this directory is similar
to the general CBP_PU code, however, it 
is specifically meant for PET data from
the IndyPET scanner in CTI or Matlab format.

The program takes the original projection
data in the form of the diamond shaped sinogram
segments for each frame (frame=single gantry angle)
and sorts them into a complete sinogram 
with uniformly spaced angles and displacements.
A mask is used for each diamond shaped segment to
eliminate the larger projection angles which reduces
the approximation made by the resorting (see TMI paper).

The resorting is performed by the routine
'resort_sino_forcbp' in the file 
src/ansi_lib_loc/A_comp_iupui.c. 
The last argument in the call to resort_sino_forcbp
on line 149 in cbp.c specifies the width of the mask
for the frame sinogram segments, as supplied, the
32 central rows out of 56 are used.

Note, that the system kernel 'sysmat_p0' in the
CBP_IU directory is required to read-in scanner
parameters such as the detector separation, however,
the CBP routine does NOT compute or use the 
actual tomographic projection matrix or system kernel.

The CBP code in this directory uses exactly the same
file I/O and configuration files as the IUrecon MAP
reconstruction code for the IndyPET scanner.

The CBP code here uses a Hanning reconstruction filter
with variable cutoff frequency. However, for cutoff
parameters >1 (i.e. >100%), the filter slowly transitions
to a ramp filter as described in the TMI paper.






II. Using the program
-----------------------------------------------------

By default, the cbp program uses a generalized Hanning
reconstruction filter with variable cutoff frequency.
For most cases, the filters already supplied
in the filters/ subdirectory should be sufficient.
If you need a cutoff parameter for which a filter
is not supplied in the filters directory, edit the
first line of mkfilt.m such that freq=xxx where xxx
is the cutoff parameter you want. Then start matlab
and type mkfilt which will write the new filter to the
filters directory.
 
The main program for the CBP reconstruction is called cbp.
The command-line syntax for cbp is obtained by just typing 'cbp'
without arguments at the command-line:

Usage:
cbp [-p plane (default=0)] [-r recon_resolution] 
[-f freq-cutoff Hann (0.8)] cfg_file out_file


1) cfg-file: configuration file exactly as used
     for the IUrecon MAP reconstruction routine. See the
     file README.cfg for detailed specifications. Note that
     the README.cfg here is identical to that in IUrecon.

2) out-file: Name out output file to which the CBP reconstruction
     will be written. This should be a .mat file. The file
     will contain a matrix called 'img'. Note, that this will 
     be transposed as compared to what IUrecon writes.

3) Options:

   -p	: plane, use only the direct planes 0, 9 ,18, 27, 36, 45, 54, and 63.
          note that plane 0 can be empty for real data scans, so
          don't be surprised if you get only noise when using -p 0.

   -r   : reconstruction resolution in pixels. If not specified, the
          default resolution as specified in cfg-file will be used.

   -f   : cutoff parameter of Hanning filter. This parameter
          can be anywhere between 0 and infinity. 
          A smaller value will result in smoother reconstructions,
          a larger value will result in less smoothing. 
          A value of 1 (-f 1.0) corresponds to a Hanning filter 
          with 100% cutoff frequency which is what is typically 
          referred to as a 'Hanning filter'.
          For values >1, the filter smoothly transitions to a ramp
          filter. For practical purposes, the value 40000.0
          for which a filter is supplied in filters/ 
          will result in a ramp filter.
          NOTE THAT YOU CAN ONLY USE -f PARAMETER VALUES FOR WHICH
          A FILTER IS SUPPLIED IN THE filters/ DIRECTORY
          I.E. 0.1, 0.2, .... IF YOU NEED DIFFERENT VALUES, GENERATE
          A FILTER FIRST USING mkfilt.m .



III.  Example supplied
-------------------------------------------------------

The subdirectory EXAMPLE contains a configuration
file and a shell script with a sample command line
for CBP reconstruction of the bar phantom. 

Running this example requires that you first install the
barphtm_hc.tar.gz package with the sinogram data. 
The file config_file_bar_hc2 assumes that the barphtm_hc
subdirectory is in the same directory as the CBP_IU
directory.

To run the example, make sure you are in the EXAMPLE
subdirectory (cd EXAMPLE). Then type 'run_example'.

The output will be written to the file EXAMPLE/ex_result.mat.
For reference, the nominal result is supplied in
the file ex_result_ref.mat .






