ifratfd.m

来自「为stanford大学donoho教授所编写的redgit变换源代码。是用c编写」· M 代码 · 共 44 行

M
44
字号
function f = ifratfd(r, m)
% IFRATFD  Inverse Finite Radon Transform
%
%       f = ifratfd(r, m)
%
% Input:
%       r:      a N by (N+1) matrix.  One projection per each column.
%       m:      (optional) normalized mean of the input matrix.
%
% Output:
%       f:      reconstructed matrix of size N by N.
%
% Note:		Require (2N-1) is a prime number.
%
% See also:     FRATFD

if ndims(r) ~= 2
    error('Input must be a matrix of 2 dimensions');
end

n = size(r, 1);
p = 2 * n - 1;

if (size(r, 2) ~= (n+1)) | ~isprime(p)
    error('Input must be a N by (N+1) matrix where (2N-1) is a prime number')
end

% Construct the folded FRAT coefficients
% Use ALMOST the same function that construct folded image!
I = [1:n, n:-1:2];
J = [1:n+1, n:-1:2];

rd = r(I, :);
rd = rd(:, J);

% Compute the IFRAT of the folded image
if nargin < 2
    f = ifrat(rd);
else
    f = ifrat(rd, m);
end

% Extract the original image from the folded image
f = f(1:n, 1:n);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?