Matlab Code

Description


Our MATLAB code is comprised of 4 main functions: go.m, projfilter.m, back.m, and proj.m.  Our file, proj.m, takes an image in matlab format and pads it with enough zeros so that when the image is rotated, none of the original picture is lost.  Then it performs line integrals for different thetas around the image to create projections of the image.  You can choose how many projections are performed (obviously the more there are, the better the reconstructed image will be).  These projections are then stored in a matrix.   The function projfilter.m is passed one argument, the projections of the image we are testing on in a matrix format where each column of the matrix represents a projection of the image from a different angle.  The function then takes those projections and pplies a 1-D filter on each one, the filter implemented can easily be switched by commenting out code.  Once the projections have been filtered, the new filtered projections are returned.  Then the function back.m takes these filtered projections and performs the "smearing" on another plot that is the final reconstructed image.  Finally, in order to create an easy way to implement our code in MATLAB, we wrote go.m in order to take us from start to finish with only one command.  Go.m ran through the entire process on a specified image and displayed the image, the projections, and the reconstructed image.

 

go.m Enables a simple line of code to perform all of the three functions below on a given image
proj.m Calculates the projections of the given image
back.m Performs the back-projection algorithm and implements the filter function below
projfilter.m Applies a specified filter to each projection
pic3.m Basic code describing how we created the pictures