function [image] = Landweber(data,maxiter,alpha)
%------------------------------------------------------------------
% Function: Landweber(data,maxiter,alpha)
%
% Inputs:    data - 2 Dimensional projection data 
%         maxiter - maximum iteration number
%           alpha - relaxation parameter (controls convergence)
%
% Output:   image - 2 Dimensional reconstructed image
%------------------------------------------------------------------

    %Find the number of projection angles and bins
    [M N] = size(data);
    nangles = M;
    npixels = N;
    
    iold = backproject2D(data);      % initial guess
    itemp = zeros(N,N);              % temporary array
    image = zeros(N,N);              % reconstructed image
    
    
    % Loop through iterations
    for l = 1:maxiter
        
        fprintf('Landweber iteration [%g] \n',l);
        
        ptemp = project2D(iold,nangles);
        diff = data - ptemp;
        itemp = alpha.*backproject2D(diff);
        inew = iold + itemp;
        iold = inew;

    end
    
    image = iold;