英文名称为Algebraic reconstruction technique:即代数重建算法
代数重建技术(ART)是一种用于计算机层析成像的迭代重建技术。它从一系列的角度投影(正弦图)中重建一幅图像。Gordon、Bender和Herman首次证明了它在图像重建中的应用。而这种方法被称为数值线性代数中的Kaczmarz方法。
相对于其他重建方法(如滤波反投影),ART的一个优点是,将先验知识(已知的约束条件)纳入重建过程是相对容易的。
该算法的实质是用迭代法求解线性方程组的解,我们将该方程表示为: A x = b Ax = b Ax=b
代码如下:
function [ X, k ] = ART_0( A, b, X0, e0)
%ART_0:to solve linear equation Ax = b
%Input - A: the coefficient matrix (matrix's size is nxn)
% - b: the constant term(n-dimensions vector)
% - X0: the inital point of iteration
% - e0: the termination condition of iteration
%Output - X: the solution of the linear equation(n-dimensions vector)
% - k: the times of itation
n = length(b);
X = X0;
k = 0;
e = 2;
while (norm(e)>e0)
for i = 1:n
unitLen = norm(A(i,:));
d = (b(i)-A(i,:)*X)/unitLen;
Xf = X;
X = X+(d.*(A(i,:)./unitLen))';
e = norm(Xf-X);
end
k = k+1;
end
end
输入参数:
A = [ 3 1 1 5 ] A = \left[\begin{matrix}3&1\\1&5\end{matrix} \right] A=[3115]
b = ( 1 1 ) b = \left(\begin{matrix}1\\1\end{matrix}\right) b=(11)
e0 = eps及 X 0 = ( 0 0 ) X0 = \left(\begin{matrix}0\\0\end{matrix}\right) X0=(00)
我们想得到这个方程求解释的运行路径
clear; clc
%% 参数
A = [3 1;1 5];
b = [1;1];
X0 = [0;0];
e0 = eps;
%% 作直线图
figure(1)
X1 = linspace(0.1,0.6);
Y1 = -3.*X1+1;
plot(X1,Y1,'r')
hold on
X2 = X1;
Y2 = (-X2+ones(size(X2)))./5;
plot(X2,Y2,'b')
%% ART
n = length(b);
X = X0;
k = 0;
e = 2;
Xp = zeros(2,100);
while (norm(e)>e0)
for i = 1:n
unitLen = norm(A(i,:));
d = (b(i)-A(i,:)*X)/unitLen;
Xf = X;
X = X+(d.*(A(i,:)./unitLen))';
e = norm(Xf-X);
Xp(1,:) = linspace(Xf(1),X(1));
Xp(2,:) = linspace(Xf(2),X(2));
plot(Xp(1,:),Xp(2,:),'g')
end
k = k+1;
end
结果如下:
我们发现这个垂直的形态并不明显,经过学姐的指正,原来是横竖两个轴的单位长度不一致导致的。我需要加上一个命令:axis equal