How to reconstruct a radially symmetric image from one projection using matlab?

时间:2015-06-30 13:28:59

标签: matlab

I have one projection from a radially symmetric image (or data), and I need to reconstruct from this projection the 2D image or data. In order to check how to do it I tried for example to reconstruct an image of a circle from one projection. I created the projections matrix of the circle, which I need to send to iradon, by repmat the vector of the sum of the circle (the vector of summations along the columns of the circle image) to 180 columns of the projections matrix, in order to mimic as if I have 180 projections for theta=0:179 degrees. However, the reconstructed circle achieved in this way was degraded with comparison to the one which was reconstructed using the projections matrix created by radon.m (instead of having a white circle like the original, I got a circle consisting of whitish-grayish rings) . How can I get better results for the reconstruction of a radially symmetric image from one projection?

The code of radon.m and of my version of radon, for one projection of a radially symmetric image, are copied below.

radon.m:

function PR = radon(IMG, THETA)

% pad the image with zeros

    [iLength, iWidth] = size(IMG);
    iDiag = sqrt(iLength^2 + iWidth^2);
    LengthPad = ceil(iDiag - iLength) + 2;
    WidthPad = ceil(iDiag - iWidth) + 2;
    padIMG = zeros(iLength+LengthPad, iWidth+WidthPad);
    padIMG(ceil(LengthPad/2):(ceil(LengthPad/2)+iLength-1), ...
        ceil(WidthPad/2):(ceil(WidthPad/2)+iWidth-1)) = IMG;

%create the projections matrix

    n = max(size(padIMG)); 
    x = linspace(-1,1,n);
    [X1,Y1] = meshgrid(x,x);
    n = length(THETA);
    PR = zeros(max(size(padIMG)),n);
    for i = 1:n
        theta = -THETA(i)*pi/180;
        X = cos(theta)*X1 + -sin(theta)*Y1;
        Y = sin(theta)*X1 + cos(theta)*Y1;
        tmpimg = interp2(X1,Y1,padIMG,X,Y);
        tmpimg(isnan(tmpimg)) = 0;
        PR(:,i) = (sum(tmpimg))';
    end

my radon:

function PR = radonOfRadialSymmetricImage(IMG,theta)

%pad image with zeros 

    [iLength, iWidth] = size(IMG);
    iDiag = sqrt(iLength^2 + iWidth^2);
    LengthPad = ceil(iDiag - iLength) + 2;
    WidthPad = ceil(iDiag - iWidth) + 2;
    padIMG = zeros(iLength+LengthPad, iWidth+WidthPad);
    padIMG(ceil(LengthPad/2):(ceil(LengthPad/2)+iLength-1), ...
        ceil(WidthPad/2):(ceil(WidthPad/2)+iWidth-1)) = IMG;

%create the projections matrix

    n = length(theta);
    PR = zeros(max(size(padIMG)), n);
    projectionData=(sum(padIMG))';
    PR= repmat(projectionData,1,n);  

0 个答案:

没有答案