Sinogram 2
Sinogram 2
Sinogram 2
359
%init_img = phantom('Modified Shepp-Logan', 180); % Initial image 2D [100 x 100]
%init_img = phantom(256); % Initial image 2D [100 x 100]
init_img=im2gray(imread('Fig3.png'));
%init_img = phantom(180);
%sino = radon(init_img, 0:179);
%sino = radon(init_img, angs); % Create a sinogram using radon transform
sino=im2gray(imread('sinoFig3.png'));
sino_org=uint8(sino);
%sino=sino';
% Here is your function ....
% Rotate the sinogram 90-degree to be compatible with your codes definition of view
and radial positions
% dim 1 -> view
% dim 2 -> Radial position
sino = sino';
% The 2DFT (2D Fourier transform) of our image will start as a matrix of
% all zeros.
fimg = zeros(diagDim);
%for nn = 80:80
for nn = angs
rowIndex = rowIndex + 1;
end
% Finally, just take the inverse 2D Fourier transform of the image! Don't
% forget - you may need an fftshift or ifftshift here.
rcon = fftshift(ifft2(ifftshift(fimg)));
%rcon = fftshift(ifft2(fimg));
%rcon=rcon';
%rcon=rcon';
%rcon=flip(rcon,1);
rcon=imrotate(rcon,180);
icol=3;
irow=2;
I3 = iradon(double(sino_org),0:179,'linear','Ram-Lak',1,output_size);
%,'linear','none');
nimage=1;
figure,subplot(irow,icol,nimage),imshow(sino_org);title('Original
Image');nimage=nimage+1;
subplot(irow,icol,nimage),imshow(uint8(sino));title('Binary');nimage=nimage+1;
subplot(irow,icol,nimage),imshow(real(rcon));title('BP');nimage=nimage+1;
subplot(irow,icol,nimage),imshow(I3);title('iRadon');nimage=nimage+1;
subplot(irow,icol,nimage),imshow(init_img);title('init_img');nimage=nimage+1;
subplot(irow,icol,nimage),imshow(fimg);title('fimg');nimage=nimage+1;