function sn = signal2noise(raw, base, smooth)

% Copyright (c) 2003, 2004 UT M.D. Anderson Cancer Center. All rights reserved.
% See the accompanying file "license.txt" for details.

xx=abs(raw-smooth);
[rx cx] = size(xx);
yy = repmat(0, [rx cx-500]);
for i = 1:cx-500,
   yy(:, i) = mean(xx(:, i:i+500)')';
end
yy=[repmat(yy(:, 1), [1 250]) yy repmat(yy(:, end), [1 250])];
sn = base ./ yy;

