Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: fan beam geometry
Replies: 7   Last Post: May 16, 2012 11:18 AM

 Messages: [ Previous | Next ]
 Vera Posts: 4 Registered: 5/12/12
Re: fan beam geometry
Posted: May 16, 2012 9:09 AM

Well this is what I have
figure(1);
x=linspace(-1,1,101);
y=x;
%D is the distance from the fan-beam vertex to the center of rotation
D=80;
M=20;
L=10;
alpha=pi/L;
d=2*pi/M;
%beta=rotangle;
[xx,yy]=meshgrid(x,y);
rr=xx.^2+yy.^2;
B=(rr<=9/16)-0.75*(rr<=1/4)+0.25*(rr<=1/16);
imshow(B,[0 1]);
%for beta = 0:d:2*gamam+pi
%for gama=-gamam:1:gamam

%theta = gama + beta;
%end;
%end;
%figure(2);
%figure(3)
%imshow(Rad,[], 'n'), axis normal;
%a is half the image diagonal dimension
%a=sqrt(size(B,1)^2 + size(B,2)^2)/2;
%for beta = linspace(0,2*gamam+pi,100)
%for gama=linspace(-gamam,gamam,100)
%t=abs(D.*sin(gama));
%r=0.5*sqrt(9-16*t.^2).*(t<=3/4)-0.75*sqrt(1-4*t.^2).*(t<=0.5)+1/8*sqrt(1-16*t.^2).*(t<=0.25);
%r=0.5*sqrt(9-16*D.*sin(gama).^2).*(D.*sin(gama)<=3/4)-0.75*sqrt(1-4*D.*sin(gama).^2).*(D.*sin(gama)<=0.5)+1/8*sqrt(1-16*D.*sin(gama).^2).*(D.*sin(gama)<=0.25);
%end;
%end;

figure(2);
plot(x,r(x,y),'k-','Linewidth',3)
h=convp(r2,g);
n=-50:50;
yi = interp1(h,n);

figure(3)
plot(x,yi,'k-','Linewidth',3)
figure(7)
for beta=0:d:2*pi
gamas=atan((x*cos(beta-y))/(D+x*sin(beta-y)));
f=d*sum((1/(l(x,y,beta)^2))*yi(beta,gamas));
end;

and the functions
function [L] = l(r,fi,beta)
D=80;
L=sqrt((D+r*sin(beta-fi))^2+(r*cos(beta-fi))^2);
end

function [R2] = r2(x,y)
D = 80;
R2 = r(x,y)*D*cos(y);
end

function [R]=r(x,y)

R=0.5*sqrt(9-16*x.^2).*(abs(x)<=3/4)-0.75*sqrt(1-4*x.^2).*(abs(x)<=0.5)+1/8*sqrt(1-16*x.^2).*(abs(x)<=0.25);

end

function h = convp(f,g)
% function [b h] = convp(f,g)
%CONVP Convolution of discrete periodic functions.
% h = CONVP(f,g) convolves the discrete N-periodic functions f and g.
% The resulting function is a discrete N-periodic function.

N=length(f);
for m=1:N
h(m) = f(1:m)*g(m:-1:1)' + f(m+1:N)*g(N:-1:m+1)';
end;

Date Subject Author
5/12/12 Vera
5/12/12 Matt J
5/12/12 Nasser Abbasi
5/16/12 Vera
5/16/12 Matt J
5/16/12 Vera
5/16/12 Matt J
5/16/12 Vera