📄 guiparfssfig4.m
字号:
function guiparFSSFig4(varargin)
% GUIPARFSSFIG4.m -- Figure 3 of the paper "Fast Slant Stack"
% Usage: GUIPARFSSFIG4 will start a new figure window and plot Figure 3 of Slant Stack Paper.
% GUIPARFSSFIG4(n) for any argument type n will plot the figure on the current figure
% window and plot Figure 3 of Slant Stack Paper.
if nargin == 0
fig = figure;
fs = 8; %default font size
clf reset;
set(fig, 'pos',[100 200 672 504], 'Name', 'FSS Figure4 : Summing unsheared image', 'NumberTitle', 'off');
set(fig,'doublebuffer','on','userdata',1);
txt = strvcat('Summing unsheared image along slanted lines', ...
'is the same as summing a sheared image along horizontal lines.', ...
' ', ...
' ', ...
'Plese choose the parameter: ',...
'ell : the slope', ...
'For example, ell = 29');
uicontrol( ...
'tag', 'Instruction_text', ...
'style', 'text', ...
'units', 'normal', ...
'position', [.2 .2 .6 .5], ...
'string', txt, ...
'backgroundcolor', [.8 .8 .8], ...
'fontsize', fs);
uicontrol( ...
'tag','ellrange_text', ...
'style','text', ...
'units','normal', ...
'position', [.85 .82, .12 .06], ...
'string','slant parameter', ...
'backgroundcolor', [0.8 0.8 0.8],...
'fontsize',fs);
uicontrol( ...
'tag','ellRange', ...
'style','list', ...
'units','normal', ...
'position', [.85 .50 .12 .30], ...
'string',{num2str([0:5:40]')}, ...
'backgroundcolor',[0.8 0.8 0.8], ...
'fontsize',fs, ...
'callback', 'guiparFSSFig4(''ellRange_Callback'')');
uicontrol( ...
'tag','draw_pushbutton', ...
'style','pushbutton', ...
'units','normal', ...
'position', [.85 .32 .12 .07], ...
'string','Draw' , ...
'fontsize',fs, ...
'callback','guiparFSSFig4(''draw_pushbutton_Callback'')');
uicontrol( ...
'tag', 'close_pushbutton', ...
'style','pushbutton', ...
'units','normal', ...
'position', [.85 .08 .12 .07], ...
'string','Close', ...
'fontsize',fs, ...
'callback','close all');
if nargout > 0
varargout{1} = fig;
end
elseif ischar(varargin{1}) % INVOKE NAMED SUBFUNCTION OR CALLBACK
try
if (nargout)
[varargout{1:nargout}] = feval(varargin{:}); % FEVAL switchyard
else
feval(varargin{:}); % FEVAL switchyard
end
catch
disp(lasterr);
end
end
% --------------------------------------------------------------------
function draw_pushbutton_Callback
ell = ellRange_Callback;
FSSFig4('Lincoln', ell);
smartset;
% --------------------------------------------------------------------
function ell = ellRange_Callback
handles = guihandles(gcf);
ellInd = get(handles.ellRange, 'Value');
ellRan = get(handles.ellRange, 'String');
ell = str2double(ellRan(ellInd));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function FSSFig4(name, ell)
%------------------------------------------
% to supress the output text by ReadImage.m
global WLVERBOSE %set by BeamPath.m
WLVERBOSE = 'No';
%------------------------------------------
Img = ReadImage(name);
n1 = size(Img, 1);
n2 = 2*n1;
theta = atan(2*ell/n1);
%
BigImg = zeros(n2,n1);
BigImg((n1+1 - (n1/2)):(n1+ n1/2),:) = Img;
%
ExactShift = zeros(n2,n1);
%
% Build matrices of Difference
for i=1:n1,
vshift = Shift1dSignal(BigImg(:,i),(i-n1/2-1).*tan(theta));
ExactShift(:,i) = real(vshift(:));
end
%
%figure;
subplot(1,2,1);
imagesc(BigImg);
axis('image')
st = [num2str(2*ell), '/', num2str(n1)];
title(strcat('Lines at Slope ', st, ', Ordinary Image'));
colormap(gray)
subplot(1,2,2);
imagesc(ExactShift);
axis('image')
title(strcat('Horizontal Lines; Image Sheared at(', st, ')'))
colormap(gray)
% superpose families of lines.
subplot(1,2,1)
slope = 2*ell/n1;
hold on;
for k=-n1:(n2-1),
if rem(k,2)== 0,
plot([1 n1],[(n1+1+k) (n1+1+k - n1*slope)], 'y')
end
end
subplot(1,2,2)
hold on;
for k=-n1:(n1-1),
if rem(k,2)==0,
plot([1 n1],[(n1+1+k) (n1+1+k)], 'y')
end
end
%------------------
WLVERBOSE = 'Yes';
%------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function smartset
chd = get(gcf, 'Children');
set(chd(length(chd)), 'Visible', 'off');
fs = 7;
set(chd(1), 'Position', [.5 .1 .25 .8], 'FontSize', fs);
set(get(chd(1), 'Title'), 'FontSize', fs);
set(chd(2), 'Position', [.1 .1 .25 .8], 'FontSize', fs);
set(get(chd(2), 'Title'), 'FontSize', fs);
%% Part of BeamLab Version:200% Built:Friday,23-Aug-2002 00:00:00% This is Copyrighted Material% For Copying permissions see COPYING.m% Comments? e-mail beamlab@stat.stanford.edu%%% Part of BeamLab Version:200% Built:Saturday,14-Sep-2002 00:00:00% This is Copyrighted Material% For Copying permissions see COPYING.m% Comments? e-mail beamlab@stat.stanford.edu%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -