-
大小: 2KB文件类型: .rar金币: 2下载: 2 次发布日期: 2021-06-08
- 语言: Matlab
- 标签:
资源简介
针对平行束投影数据,通过直接反投影算法、滤波反投影算法和卷积反投影算法进行图像重建。文件是三种算法的源程序。
代码片段和文件信息
function [] = CBP(projData filter)
% Fuction [] = CBP(projData,filter)
% projData is the projection data.
% filter is R-L Filter or S-L Filter. “filter = 1;“ -- R-L & “filter = 2;“-- S--L
% Aim : 2D Convoluted Back-Projection
% Result: draw the sinogram and the restruction image
% Figure: 1111 & 2222
% Draw the sinogram
figure(111111);imshow(projData[]);title(‘Sinogram‘);
% Restruction -- Convoluted Back-Projection
rowNum = size(projData1);
columnNum = size(projData2);
imageSzie = pow2(nextpow2(size(projData1))-1);
% Selecte the style of Filter
switch filter
case 1
% R-L Filter
filterCore = zeros((rowNum*2-1)1);
for i = 0:(rowNum-1)
if i == 0
filterCore(rowNum) = 1/4;
elseif rem(i2) == 0
filterCore(rowNum-i) = 0;
filterCore(rowNum+i) = 0;
else
filterCore(rowNum-i) = -1/(i*pi)^2;
filterCore(rowNum+i) = -1/(i*pi)^2;
end
end
case 2
% S-L Filter
filterCore = -2/pi^2./(4*(-(rowNum-1):(rowNum-1)).^2-1);
otherwise
filterCore = 0; % 有待完善
end
%Convolution
projCon = zeros(rowNumcolumnNum);
for i = 1:columnNum
s = projData(:i);
dataCon = conv(s‘filterCore‘);
projCon(:i) = dataCon(rowNum:2*rowNum-1);
end
% Back-Projection
imageRes = zeros(imageSzieimageSzie);
for i = 1:imageSzie
for j = 1:imageSzie
for k = 0:179
theta = k/180*pi;
t=(j-imageSzie/2-0.5)*cos(theta)+(imageSzie/2+0.5-i)*sin(theta)+(rowNum+1)/2;
if(t < rowNum && t >= 1)
t1 = floor(t);
t2 = floor(t+1);
imageRes(ij) = imageRes(ij)+(t2-t)*projCon(t1k+1)+(t-t1)*projCon(t2k+1);
end
end
end
end
imageRes = pi/columnNum*imageRes;
figure(222222);imshow(imageRes[]);title(‘Restruction Image(CBP)‘);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 755 2018-04-12 19:05 Try_main.m
文件 1979 2018-04-12 11:25 CBP.m
文件 896 2018-04-07 16:16 DBP.m
文件 1384 2018-04-07 16:35 FBP.m
----------- --------- ---------- ----- ----
5014 4
- 上一篇:chirp.m线性调频信号
- 下一篇:逻辑---15道批判性思维题目测试
评论
共有 条评论