天天看点

shepp-logan模型笛卡尔坐标变换到极坐标,环状伪影仿真

利用shepp-logan模型进行环状伪影仿真,处理方法为后处理方法,即对CT图像进行处理,将图像从笛卡尔坐标变换到极坐标系中。

clc
clear all
L = ;**图像大小
P = phantom(L);
theta = :;
R = radon(P,theta);**获得正弦图
for ii = :
    for jj = :
        R(ii,jj) = ;
    end
end
for ii = :
    for jj = :
        R(ii,jj) = ;
    end
end
for ii = :
    for jj = :
        R(ii,jj) = ;
    end
end
%figure,imshow(R,[])
I = iradon(R, theta, 'linear', 'Hamming', L);%%获得重建图像
JG = *pi/(*L);%%角度采样频率
width = *pi/(JG) + ;
[m,n] = size(I);
radius = ceil(sqrt(m^ + n^)/);
POL = zeros(radius*, width);
for gama = :JG:(*pi)
    for rad = ::radius   %%半径采样频率
        i = round(gama/JG+);
        j = (rad-)* + ;
        x = rad*cos(gama);%%x坐标变换
        y = rad*sin(gama);%%y坐标变换
        ceil_x = ceil(x);
        ceil_y = ceil(y);
        floor_x = floor(x);
        floor_y = floor(y);
        chae3 = abs(x - floor_x);
        chae4 = abs(y - floor_y);
        x1 = floor_x + L/;
        x2 = ceil_x + L/;
        y1 = floor_y + L/;
        y2 = ceil_y + L/;
        if x1>L
            x1 = L;
        end
        if x1<
            x1 = ;
        end
        if x2>L
            x2 = L;
        end
        if x2<
            x2 = ;
        end
        if y1>L
            y1 = L;
        end
        if y1<
            y1 = ;
        end
        if y2>L
            y2 = L;
        end
        if y2<
            y2 = ;
        end
        POL(j,i) = (-chae3)*(-chae4)*I(x1,y1) + chae3*(-chae4)*I(x2,y1) + (-chae3)*chae4*I(x1,y2) + chae3*chae4*I(x2,y2);%%双线性插值
    end
end
figure, hold on
subplot(,,),imshow(I)
subplot(,,),imshow(POL)
           

结果如下图所示

shepp-logan模型笛卡尔坐标变换到极坐标,环状伪影仿真