模拟的r射线,不用考虑散射了。
function []=spheresource()
h=input('source to collimator:');
H=input('source to detector:');
r=input('hole diameter:');
d1=input('pinhole1 parameter(x y axis):');
d2=input('pinhole2 parameter:');
d3=input('pinhole3 parameter:');
d4=input('pinhole4 parameter:');
%h is distanse source to collimator,H is source to detector
%dx is center of the hole to y axis
%dy is center of the hole to x axis
%spheresource(5,20,3,3,4)
%spheresource(5,20,-3,3,4)
%spheresource(5,20,2.5 ,2.5,-2.5 ,2.5,2.5,-2.5,-2.5,-2.5,4)
N=80;%256可调分辨率
I64=zeros(N,N); %预定义平面164的灰度值为O
[m,n]=meshgrid(linspace(-N/2,N/2-1,N));%确定坐标系及坐标原点的位置
% h=1;H=2;
% dx=5;
% r=5;
r1=r*H/h; %圆半径大小控制变量(单位pixel)
a1=d1(1)*H/h; %圆心位置控制变量
b1=