⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fssdemoold.m

📁 beamlet变化的工具箱
💻 M
字号:
%********************************************************
function FSSDemo(action)
%Usage: FSSDemo
%Description: Demo for paper Fast Slant Stack 
%Version: 5
%Author: Sou Cheng CHOI
%Date: Mar 16, 2002
%********************************************************
global plotOffset
global LastFigureNo 
global PaperName 
global MakeFigureFilePrefix
global IfNewWindow 
global StopPlot
global WLVERBOSE;
% -------------------------------------------------------
LastFigureNo = 18;
PaperName = 'Fast Slant Stack';
MakeFigureFilePrefix = 'dMakeSSFigure';
%--------------------------------------------------------

WLVERBOSE='No';
%if nargin <= 1
    IfNewWindow = '(1)'; 
%else 
%    IfNewWindow = ''; % empty string
%end

if nargin == 0,
        Initialize_GUI;
        c=get(gcf,'Children');
        [m,n]=size(c); 
        plotOffset = m;
        action = 'restart';
end

%set(findobj('tag','stop'),'userdata',0);
%drawnow;

if isequal(action,'restart'),
   % Retrieve parameters from GUI
   runAllfig  = get(findobj('tag','RunAllFig'),'value');
elseif isequal(action,'ploteach'),
  %  edit1 = get(findobj('tag','edit1'),'value');
   %checked = get(findobj('tag','newWindow'),'value')
  %  if checked
  %      IfNewWindow = ''; 
  %  else
       IfNewWindow = '(1)'; 
 %   end  
  PlotFigure;
elseif isequal(action,'plotall'),
    %checked = get(findobj('tag','newWindow'),'value');
    %if checked
    %    IfNewWindow = ''; 
    %else
        IfNewWindow = '(1)'; 
        %end
    StopPlot = 0;
    PlotAllFigures;
elseif  isequal(action,'stop'),  

    StopPlot = 1;

%elseif isequal(action,'newDemo'),
%    checked = get(findobj('tag','newWindow'),'value');
%    if checked
%        IfNewWindow = ''; 
%    else
%        IfNewWindow = (1); 
%    end   
elseif  isequal(action,'seecode'),   
    edit1 = get(findobj('tag','edit1'),'value');
    s = ['edit', ' ', strcat(MakeFigureFilePrefix, num2str(edit1))];
    eval(s);
elseif  isequal(action,'close'),
        CloseDemoFigures;
end

%********************************************************
function Initialize_GUI 
%********************************************************
% -------------------------------------------------------
fs = 9; %default font size
% -------------------------------------------------------
global LastFigureNo 
global PaperName;
    %CloseDemoFigures
    close all
    figure
    figureNoList = (1:LastFigureNo)';
	clf reset;
	set(gcf,'pos', [50   55   560*1.45   420*1.45], 'Name', PaperName, 'NumberTitle','off');
	set(gcf,'doublebuffer','on','userdata',1);
    uicontrol( ...
         'tag','text1', ...
         'style','text', ...
         'units','normal', ...
         'position', [.85 .82, .12 .06], ... 
         'string','Figure', ...
         'backgroundcolor', [0.8 0.8 0.8],...
         'fontsize',fs);
    uicontrol( ...
         'tag','text2', ...
         'style','text', ...
         'units','normal', ...
         'position', [.04 .93, .7 .04], ... 
         'string','', ...
         'backgroundcolor', [0.8 0.8 0.8],...
         'fontsize',fs);
     uicontrol( ...
         'tag','text3', ...
         'style','text', ...
         'units','normal', ...
         'position', [.04 .01, .7 .04], ... 
         'string','', ...
         'backgroundcolor', [0.8 0.8 0.8],...
         'fontsize',fs);
	uicontrol( ...
         'tag','edit1', ...
         'style','list', ...
         'units','normal', ...
         'position',[.85 .50 .12 .30], ...
         'string',{num2str(figureNoList)}, ...%'value', 1,...
         'backgroundcolor',[0.8 0.8 0.8], ...
         'fontsize',fs, ...
         'callback','FSSDemo(''ploteach'')');
if 0,    
        uicontrol( ...
         'tag','newWindow', ...
         'style','checkbox', ...
         'units','normal', ...
         'position',[.85 .40 .12 .07], ... 
         'string','New Window', ...
         'fontsize',fs, ...
         'userdata',0, ...
         'backgroundcolor',[0.8 0.8 0.8], ...
         'callback','FSSDemo(''newDemo'')');	
 end
     uicontrol( ...
         'tag','RunAllFig', ...
         'style','pushbutton', ...
         'units','normal', ...
         'position',[.85 .32 .12 .07], ...
         'string','Run All Fig' , ...
         'fontsize',fs, ...
         'interruptible','on',...
         'callback','FSSDemo(''plotall'')');
     uicontrol( ...
         'tag','stop', ...
         'style','pushbutton', ...
         'units','normal', ...
         'position',[.85 .24 .12 .07], ... 
         'string','Stop', ...
         'fontsize',fs, ...
         'userdata',0, ...
         'callback','FSSDemo(''stop'');');
         %'callback','set(gcbo,''userdata'',1)');	
    uicontrol( ...
         'tag','SeeCode', ...
         'style','pushbutton', ...
         'units','normal', ...
         'position',[.85 .16 .12 .07], ...
         'string','See Code' , ...
         'fontsize',fs, ...
         'callback', 'FSSDemo(''seecode'')');
     uicontrol( ...
         'style','pushbutton', ...
         'units','normal', ...
         'position',[.85 .08 .12 .07], ...
         'string','Close', ...
         'fontsize',fs, ...
         'callback','close all');

%********************************************************
function PlotFigure
%********************************************************
global MakeFigureFilePrefix  
global IfNewWindow 
    DeleteSubplots;
    set(gcf,'Visible', 'off');
    edit1 = get(findobj('tag','edit1'),'value');   
         
    s=num2str(edit1);
    s=strcat(strcat(MakeFigureFilePrefix, s), IfNewWindow);
    fprintf('\n\n\nComputing for Figure %d...\n', edit1);
%    tic;
    eval(s);
    fprintf('\nComputations done.  Figure %d generated.\n', edit1);
%     toc,
    WriteCaptions(edit1);
    AdjustSubplots;
    titles= strcat('Figure ', num2Str(edit1));
    text1 = findobj('tag','text1');
    set(text1,'string', titles);  
    set(gcf,'Visible', 'on');
%********************************************************
function PlotAllFigures
%********************************************************
global LastFigureNo  
global StopPlot
    for i=1:LastFigureNo,
        if StopPlot == 1, 
            break; 
        end
        h=findobj('tag','edit1'); 
        set(h,'Value',i);
        PlotFigure;
        pause(3);
        %DeleteNonDemoFigures
    end
%******************************************************** 
function WriteCaptions(edit1)
%********************************************************
global MakeFigureFilePrefix
    switch  edit1
       case 1
           captions = 'The slant stack of a point is a broken line';       
       case 2
           captions = 'The backprojection of a point is a line';    
       case 3
           captions = 'Shearing of an image, m = 2n';     
       case 4
           captions = 'Summing unsheared image along slanted lines is the same as a sheared image along horizontal lines';    
       case 5
           captions = 'The pseudopolar grid for n = 8';     
       case 6
           captions = 'Lines in frequency space corresponding to pseudopolar angles';    
       case 7
           captions = 'Definition of pseudopolar grid points';    
       case 8
           captions = 'Converting from Cartesian Grid to Panel s = 1 of Pseudopolar grid';    
       case 9
           captions = 'Operator G_n_,_k.  Cartesian to Pseudopolar resampling within a single row';    
       case 10
           captions = 'Operator H_n_,_k.  Pseudopolar to Cartesian to resampling within a single row';
       case 11
           captions = 'Removing Cartesian points from Pseudopolar points';
       case 12
           captions = 'Resampling effect of Operator C';
       case 13
           captions = 'Norm ||H_n_,_k^e^x^t|| for a range of n and k';
       case 14
           captions = 'Image shearing with m = n';
       case 15
           captions = 'Summing along slanted lines with m = n is the same as a wrapped image along horizontal lines';
       case 16
           captions = 'With m = n, backprojection of a Radon-domain array with single non-zero entry yields "lines" with exhibit wrap-around artifacts';
       case 17
           captions = 'The concentric squares of Mersereau and Oppenheim for n = 8';
       case 18
           captions = 'Decomposition of three-D Fourier domain into 3 panels';
   end
   text2 = findobj('tag','text2');
   set(text2,'string', captions);  
   text3 = findobj('tag','text3');
   switch edit1,
    case 18
       set(text3,'string',   ['This figure is produced by pyramid.jpg', '               ', '(NR)']);  
    otherwise   
        set(text3,'string',   ['This figure is produced by', ' ', strcat(MakeFigureFilePrefix, num2str(edit1)),'.m', '               ', '(R)']);  
  end
    drawnow

%********************************************************
function AdjustSubplots2
%********************************************************
   global plotOffset
           MagnificationFactor = 0.92;
           f = get(0,'Children');
           [fm,fn]=size(f);
           c = get(f(fm),'Children');
           [m1,n1]=size(c);
           m=m1-plotOffset;
           p = zeros(m, 4);
           for i=m:-1:1,
              p(i,:) = get(c(i),'position');
              REMAPFIG(p(i,:), p(i,:).* MagnificationFactor);
           end            
%********************************************************
function AdjustSubplots
%********************************************************
global plotOffset
           set(gcf,'Visible', 'off');
           MagnificationFactor = 0.92;
           right = 0.85;   
           f = get(0,'Children');
           [fm,fn]=size(f);
           c = get(f(fm),'Children');
           [m1,n1]=size(c);
           m=m1-plotOffset;
           p = zeros(m, 4);
           for i=m:-1:1,
              %get all suplots'  positions
              p(i,:) = get(c(i),'position');
              
           end     
           % contract all subplots
           p = p * MagnificationFactor;
           col=length(unique(p(:,1)));
           if col > 0,
             row = m/col;
           end
           for i=m:-1:1    
               %Adjust spacing between subplots
               width = p(i,3);
               hshift = (right - col * width) / (col+1);
               in_col = mod(i,col)+1;
               p(i,1) = width * (in_col - 1) + hshift * (in_col);
               set(c(i), 'position', p(i,:)); 
           end
      
%********************************************************
function DeleteSubplots
%********************************************************
global plotOffset
           c = get(gcf,'Children');
           [m1,n1]=size(c);
           m=m1-plotOffset;
           for i=1:m,
                   delete(c(i));
           end
%********************************************************
function DeleteNonDemoFigures
%********************************************************       
    h=findobj(0,'Type','figure');
    [m,n]=size(h);
    for i=1:m,
        if h(i)~=1
            close(h(i));
        end
   end
%********************************************************
function CloseDemoFigures
%********************************************************   
global PaperName;
    h=findobj(0,'Name', PaperName);
    [m,n]=size(h);
    for i=1:m,
        close(h(i))
    end
        %% 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 + -