Lecture IX CT reconstruction Simulation 1
Review 1. Direct back projection alg0rithm?. Filtered back projection 3. R-L, S-L filter 4. What are the four kinds of back projection algorithm? 5. What are the processes and features?
Contents 1. Shepp Logan phantom. Generation of simulation data 3. Convolution process 4. Back projection 5. Result evaluation 3
1. Shepp-Logan phantom 4
Shepp-Logan Phantom " Used to evaluate the algorithm. " Shepp-Logan phantom is the most famous one. " Shepp-Logan phantom consists of ten ellipses named a-j, with different center, axis, rotate angle and attenuation coefficient. " Pay attention to the attenuation coefficient accumulation. 5
Shepp-Logan phantom " Ellipse function " Matlab program " Coordinate transform 6 ellip = [x0 y0 z0 a b angle mu]; t=0:pi/50:*pi; axis([-1 1-1 1]); hold on; grid on; for m=1:10 x=ellip(m,5)*cos(t); y=ellip(m,4)*sin(t); xx=x*cos(ellip(m,6)*pi/180) -y*sin(ellip(m,6)*pi/180)+ellip(m,1); yy=x*sin(ellip(m,6)*pi /180)+y*cos(ellip(m,6)*pi/180)+ellip(m,); plot(xx,yy); end
Shepp-Logan phantom gray image " Discretization 1. 每行每列遍历图像中各点, 根据坐标位置判断处于哪个椭圆的区域, 从而确定灰度. 确定了椭圆, 进行离散, 形成矩阵 然后进行矩阵操作 : 选择和平移 课下自己尝试! P = phantom(def, n); P = phantom(e, n); 7
. Parallel beam projection 8
Parallel beam projection - for ellipse located at origin point and without rotation 1. Density function. Projection function x y ρ + 1 (, ) f x y = A B gθ ( R) = ρdl = ρmn MN 0 Others 3. Line MN 4. Point of intersection x cosθ + ysinθ = R x y 1, 1, RA = RB = cosθ ± AB sinθ r sinθ ± AB cosθ r r r R R 5. Length of MN MN = r = A cos θ + B AB r r ( x1 x ) + ( y1 y) = 6. Final projection function R sin θ g 9 θ ( R) = ρ AB r r 0 R R r Others
Parallel beam projection for arbitrary ellipse 1. Ellipse function [( x x ) cosα + ( y y ) sinα ] [ ( x x ) sinα + ( y y ) cosα ] 0 0 0 0 + = AB PQ = r α = A cos A. Length of PQ α α r r R α ( θ α ) + B sin ( θ α ) B 1 θ g θ, α ( R) = ρpq ( R) 0 g θ, α = AB = ρ A cos R α = R x 0 cosθ y0 sinθ 3. Final projection function ( θ α ) + B sin ( θ α ) ( R x0 cosθ y0 sinθ ) A cos ( θ α ) + B sin ( θ α ) 10 Rα r α Others
Projection program % P_Projection function function P=P_projection() Y_Length=40; L=3; %Projection times in 180 degree N=18; d=y_length/n; ellip=sub_shepp; P=zeros(L,N,10); k=0; for i=1:size(ellip,1) %size(ellip,1)=10 k=k+1; x_0=ellip(i,1)*y_length/; %Origin point coordinate x0 y_0=ellip(i,)*y_length/; %Origin point coordinate y0 A=ellip(i,4)*Y_Length/; %Long semi-axis B=ellip(i,5)*Y_Length/; %Short semi-axis rf=ellip(i,6)*pi/180; %Alpha,rotate angle of ellipse rol=ellip(i,7); %Attenuation Coefficient p=0; for theta=0:pi/l:pi-pi/l %theta=0~31 p=p+1; n=-n/:n/-1;%n=[-64:1:63] C=*rol*A*B;% constant C=*rol*A*B T=(A^)*(cos(theta-rf))^+(B^)*(sin(theta -rf))^;%r^ I=(n.*d-x_0*cos(theta)-y_0*sin(theta)).^;%Vector G=(C*sqrt(T-I)./T).*(I<=T)+0.*(I>T); %subplot(1); figure(k) plot(g); hold on; grid on; P1(p,:)=G;%P1-Single ellipse' projection, 3 angles,18 points end P(:,:,k)=P1;%10 ellipses' projection hold on figure(10+k); surf(p1); %imshow(p1,[]);%we need change the width end 11 R = radon(i, theta);
Projection results " Ellipse a " Ellipse j 1
3. R-L filter 13
Filter description ( ) = ρ sin ( ρ ) sin ( ρ ) = ( ) h R c R c R C R R L 0 0 0 14
R-L filter Matlab program T=1; %Sample interval L=64; RouZero=1/(*T); N=linspace(-floor(L/),floor(L/)-1,L); %N[64]=[-3,-31,...0,...31] R=N*T; RFFilterConvolutionFunction=RouZero^*(*sinc(*RouZero*R)- sinc(rouzero*r).^); RFFilterFunction=abs(ifftshift(fft(RFFilterConvolutionFunction))); figure(1); subplot(,1,1); plot(rffilterconvolutionfunction); hold on; plot(rffilterconvolutionfunction,'r*'); grid on; xlabel('t (sample =NT)'); ylabel('rffilterconvolutionfunction'); title(['interval=',numstr(t)]); subplot(1); plot(rffilterfunction); grid on; 15
4-1. Filter correction 16
Filter correction Matlab program function Q=h_projection() close all; clear all; Y_Length=40; L=64; N=18; d=y_length/n; p=0; q=0; H=zeros(L,N,10); h1=ones(l,1);%vector of 64*1 H1=sub_hfilter(N,d);%Matrix of 1*18 H=h1*ifftshift(H1);%Matrix of 64*18 for j=1:10 H(:,:,j)=H;%Matrix of 64*18*10 end load P_projection; S=fftn(P);%Matrix of 64*18*10 Q=ifftn(S.*H); OriginProjection=P(1,:,1); CorrectedProjectoin=Q(1,:,1); figure(); subplot(,1,1); plot(originprojection); hold on; subplot(,1,); plot(correctedprojectoin); filename='h_projection'; save(filename,'q'); FFT -> Multiply -> IFFT 17
4- Convolution correction 18
Convolution process wrong " 投影函数将向两边分别延伸 N 点 " 卷积函数对称截取 N 点 " 卷积运算后截取 N 点 %%%%%%%%%%%%%%%%%%%%%%% %%%%R_L filter 56 point t=linspace(-18,17,56); filt=0.065*(sinc(t)/-sinc(t/).^/4); figure; plot(filt); title('r L filter); %%%%%%%%%% convoluation process tic shade_temp = zeros(768,180); %56*3 shade_temp(57:51,:) = shade;%middle part 56 element for n = 1:180; shade1_temp(:,n) = conv(shade_temp(:,n),filt');%conv. end shade1 = shade1_temp(385:640,:); %Obtain the result shade1_temp(:,n) = conv(shade_temp(:,n),filt, same ); 19
5. Backprojection process 0
Back projection R 0 y0 x y 0 0 R 0 = x 0 cosθ + sinθ [ i ( N + 1) / ] Δ j ( N + 1) / = = [ ]Δ N + 1 N + 1 = i cosθ + j sinθ Δ N 1 = = R R 0 0 = ( i 1) cosθ + ( j 1) sinθ ( cosθ + sinθ ) Δ + ( N / ) Δ N 1 ( i 1) cosθ + ( j 1) sinθ ( cosθ + sinθ ) + Δ N Pixel driven or ray driven? N N 1 C θ = ( cosθ + sinθ ) R0 = ( i 1) cosθ + ( j 1) sinθ + C = n + δ 0 ( i, j) = ( 1 δ ) Q ( n ) + δq ( n 1) F θ 0 θ 0 + θ 1
Back projection program %%%%%%%%%%%%%%%% Back projection d_th = pi/180; re = zeros(56,56); for view = 1:180 l = ((18.5)*sin((view-1)*d_th))+((18.5)*cos((view-1)*d_th))-18; %-C θ l_temp(view) = l; for x = 1:56 for y = 1:56 n = (x-1)*sin((view-1)*d_th)+(y-1)*cos((view-1)*d_th)-l; if (1<n)&&(n<56) nn = fix(n); n0 = n-nn; re(x,y) = re(x,y)+(1-n0)*shade1(nn,view)+n0*shade1(nn+1,view); %interpolation else re(x,y) = re(x,y); end end end end I = iradon(p, theta, interp, filter, frequency_scaling, output_size);
6. Evaluation 3
Evaluation of result figure x1 = re(18,:); imshow(re,[]) title( 重建后图像 ') load head.mat figure y1 = head(18,:); imshow(head,[]) title( 重建前图像 '); figure plot(x1,'r') hold on plot(y1); title( 红 --- 重建图像蓝 --- 原始图像 ') 4
Evaluation criteria " 归一化均方根距离判据 d = N N ( tu, v ru, v ) u= 1 v= 1 N N ( t ) u, v t u= 1 v= 1 " 归一化平均绝对距离判据 r N N u= 1 v= 1 = N t u, v N u= 1 v= 1 t r u, v " 最坏情况距离 [ N / ] [ N / ] u, v e = max Ti, j Ri, j 1 i 1 j 1 1 T ( t + t + t t ) R ( R + R + R R ) i, j = i, j i+ 1, j i, j+ 1 + i+ 1, j+ 1 4 5 i, j " Any other??? tic,toc = i, j i+ 1, j i, j+ 1 + i+ 1, j+ 1 4
Conclusion 1. Parallel beam backprojection reconstruction process?. Filter function 3. Convolution & filter correction 4. Result evaluation 6
Questions??? 7