This directory contains C programs to compute the MAP estimate using
a generalized Gaussian MRF with a fixed value of p and the ML estimate
of sigma computed directly from the projection data using the EM
algorithm.

Programs:
--------

emis.c - C program to compute MAP image for emission data

  Compilation: make emis
  Usage: emis data.mat initial.mat support.mat p no_iter_param no_iter_rec output.mat VERBOSE

trans.c - C program to compute MAP image for transmission data

  Compilation: make trans
  Usage: trans data.mat initial.mat support.mat p no_iter_param no_iter_rec output.mat VERBOSE

Input files:
-----------

data.mat - MATLAB file containing projection data (see ../data/README)

initial.mat - MATLAB file containing CBP image which is used as the
			  initial condition (see ../CBP/README).  Note the MATLAB 
			  file should contain the CBP image in a matrix named 'img'.

support.mat - MATLAB file containing the binary image of the support of the
			  object (see ../support/README).  Note the MATLAB 
			  file should contain the support image in a matrix named 'mask'.

Output file:
-----------

The programs write out a MATLAB file containing the MAP reconstruction
in a matrix named 'img' and the estimate of sigma used to compute the
reconstruction in a variable named 'sigma'.

Parameters to the programs:
--------------------------

p - Shape parameter of the GGMRF (1 < p <= 2).  When p=2, the GGMRF model
	reduces to the Gaussian MRF.

no_iter_param - no. of iterations for computing the ML estimate of sigma
				using the EM algorithm.  When this is set to 0, the program
				will prompt the user to enter a value for sigma.  This can
				be used to compute the MAP reconstruction for values of
				sigma other than the ML estimate.

no_iter_rec - no. of iterations for computing the MAP reconstruction using the
			  iterative coordinate descent (ICD) algorithm.  When this is
			  set to 0, the program would only compute the ML estimate of
			  sigma and save the image at the last iteration of the EM 
			  algorithm.  The saved image would be a sample from the posterior
			  distribution.

VERBOSE - Set 1 for verbose mode, 0 for quiet mode.


Examples:
--------

EXAMPLE_EMIS - Shell script for computing the MAP reconstruction for the 
			   example emission data
EXAMPLE_TRANS - Shell script for computing the MAP reconstruction for the
				example transmission data



