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

📄 fssdemo.m

📁 beamlet变化的工具箱
💻 M
字号:
%********************************************************
function FSSDemo(action)
%Usage: FSSDemo
%Description: Demo for paper Fast Slant Stack
%Version: 6
%Author: Sou Cheng CHOI
%Date: May 8, 2002
%********************************************************
global plotOffset
global LastFigureNo 
global PaperName 
global MakeFigureFilePrefix
global IfNewWindow
global IfAddTitle 
global IfLoadData 
global StopPlot
global WLVERBOSE
global NRfigures
global CRfigures
global UnderConstructionFigures
%-------------------------------------------------------
LastFigureNo = 18;
PaperName = 'Fast Slant Stack';
MakeFigureFilePrefix = 'dMakeSSFigure';
NRfigures = {18}; 
CRfigures = {};
UnderConstructionFigures = {};
%--------------------------------------------------------

WLVERBOSE='No';
IfNewWindow = 0; 
IfAddTitle = 0; 
IfCompute = 0;

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

if  isequal(action,'NewWindow'),
    IfNewWindow = get(findobj(gcf,'tag','newWindow'),'value');
    if IfNewWindow,FSSDemo;end
elseif  isequal(action,'AddTitle'),
    IfAddTitle = get(findobj(gcf,'tag','iftitle'),'value');
elseif  isequal(action,'Compute'),
    IfCompute = get(findobj(gcf,'tag','IfCompute'),'value');
elseif isequal(action,'ploteach'),
  PlotFigure;
elseif isequal(action,'plotall'),
    StopPlot = 0;
    PlotAllFigures;
elseif  isequal(action,'stop'),  
    StopPlot = 1;
elseif  isequal(action,'seecode'),
    edit1 = get(findobj(gcf,'tag','edit1'),'value');
    %if edit1 < 10, 
    %    s=strcat('0', num2str(edit1));
    %else
        s=num2str(edit1);
    %end
    s = ['edit', ' ', strcat(MakeFigureFilePrefix, s)];
    eval(s);
elseif  isequal(action,'CloseAllDemo'),
        CloseDemoFigures;
        ClearGlobalVariables;
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','newWindow', 'style','checkbox', ...
         'units','normal',  'position',[.85 .92, .12 .05], ... 
         'string','New Window', 'fontsize',fs, ...
         'userdata',0, 'backgroundcolor', [0.8 0.8 0.8],...
         'callback','FSSDemo(''NewWindow'')');	

     uicontrol('tag','iftitle', 'style','checkbox', ...
         'units','normal',  'position',[.85 .88, .12 .05], ... 
         'string','Title',  'fontsize',fs, ...
         'userdata',0,      'backgroundcolor', [0.8 0.8 0.8],...
         'callback','FSSDemo(''AddTitle'')');	
 
     uicontrol( 'tag','IfCompute',   'style','checkbox', ...
         'units','normal', 'position',[.85 .84, .12 .05], ... 
         'string','Compute',  'fontsize',fs, ...
         'userdata',0,  'backgroundcolor', [0.8 0.8 0.8],...
         'callback','FSSDemo(''Compute'')');
    uicontrol( 'tag','text1',    'style','text', ...
         'units','normal', 'position', [.85 .79, .12 .04], ... 
         '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 .49 .12 .31], ...
         'string',{num2str(figureNoList)}, 'backgroundcolor',[0.8 0.8 0.8], ...
         'fontsize',fs,  'callback','FSSDemo(''ploteach'')');


     uicontrol( 'tag','RunAllFig', 'style','pushbutton', ...
         'units','normal',  'position',[.85 .40 .12 .06], ...
         'string','Run All Fig' ,  'fontsize',fs, ...
         'interruptible','on',   'callback','FSSDemo(''plotall'')');
     
     uicontrol( 'tag','stop',  'style','pushbutton', ...
         'units','normal',   'position',[.85 .32 .12 .06], ... 
         'string','Stop',    'fontsize',fs, ...
         'userdata',0,   'callback','FSSDemo(''stop'');');
         %'callback','set(gcbo,''userdata'',1)');	
     uicontrol(  'tag','SeeCode',   'style','pushbutton', ...
         'units','normal',   'position',[.85 .24 .12 .06], ...
         'string','See Code' ,   'fontsize',fs, ...
         'callback', 'FSSDemo(''seecode'')');
     uicontrol(  'style','pushbutton',    'units','normal', ...
         'position',[.85 .16 .12 .06],   'string','Close', ...
         'fontsize',fs,   'callback','close');
     uicontrol(  'style','pushbutton',  'units','normal', ...
         'position',[.85 .08 .12 .06],   'string','Close All', ...
         'fontsize',fs, 'callback','FSSDemo(''CloseAllDemo'')');

%********************************************************
function PlotFigure
%********************************************************
global MakeFigureFilePrefix  
global IfNewWindow 
global IfAddTitle
global IfCompute
global NRfigures
global CRfigures
global UnderConstructionFigures

    DeleteSubplots;
    %set(gcf,'Visible', 'off');
    edit1 = get(findobj(gcf,'tag','edit1'),'value'); 
    IfAddTitle = get(findobj(gcf,'tag','iftitle'),'value');
    IfCompute = get(findobj(gcf,'tag','IfCompute'),'value');
    %IfNewWindow = get(findobj(gcf,'tag','newWindow'),'value');
    IfNewWindow = 0; 

    %if edit1 < 10, 
    %    s=strcat('0', num2str(edit1));
    %else
        s=num2str(edit1);
    %end
    IfLoadData = ~IfCompute;
    switch edit1,
        case UnderConstructionFigures
            fprintf('\n\nFigure %d is still under construction', edit1);
        case NRfigures
            s=[strcat(MakeFigureFilePrefix, s), '(', num2str(IfNewWindow), ',', num2str(IfAddTitle),',', num2str(IfLoadData),')'];
                fprintf('\n\n\nLoading Data for Figure %d...\n', edit1);
			    %    tic;
                eval(s);
                fprintf('\nData Loaded.  Figure %d generated.\n', edit1);
        case CRfigures
            s=[strcat(MakeFigureFilePrefix, s), '(', num2str(IfNewWindow), ',', num2str(IfAddTitle),',', num2str(IfLoadData),')'];
            if IfLoadData,
                fprintf('\n\n\nLoading Data for Figure %d...\n', edit1);
			    %    tic;
                eval(s);
                fprintf('\nData Loaded.  Figure %d generated.\n', edit1);
			    %     toc,    
            else 
                fprintf('\n\n\nComputing for Figure %d...\n', edit1);
                eval(s);
                fprintf('\nComputations done.  Figure %d generated.\n', edit1);
            end
        otherwise 
            s=[strcat(MakeFigureFilePrefix, s), '(', num2str(IfNewWindow), ',', num2str(IfAddTitle),')'];
            fprintf('\n\n\nComputing for Figure %d...\n', edit1);
		%    tic;
            eval(s);
            fprintf('\nComputations done.  Figure %d generated.\n', edit1);
		%     toc,
    end
   
    WriteCaptions(edit1);
    AdjustSubplots;
    titles= ['Figure ', num2Str(edit1)];
    text1 = findobj(gcbo,'tag','text1');
    set(text1,'string', titles);  

    %set(gcf,'Visible', 'on');
%********************************************************
function PlotAllFigures
%********************************************************
global LastFigureNo  
global StopPlot
global IfNewWindow

    for i=1:LastFigureNo,
        if StopPlot == 1, 
            break; 
        end
        h=findobj(gcf,'tag','edit1'); 
        set(h,'Value',i);
        PlotFigure;
        pause(3);
        %DeleteNonDemoFigures
    end
%******************************************************** 
function WriteCaptions(edit1)
%********************************************************
global MakeFigureFilePrefix
global NRfigures
global CRfigures
global UnderConstructionFigures
    captions='';
    IfAddTitle = get(findobj(gcf,'tag','iftitle'),'value');
    if IfAddTitle,
        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);  
   end
    %if edit1 < 10, 
    %    s=strcat('0', num2str(edit1));
    %else
        s=num2str(edit1);
    %end

   text3 = findobj(gcf,'tag','text3');
   switch edit1,
     case UnderConstructionFigures
       set(text3,'string',   ['This figure is still under construction']);  
     case NRfigures
        set(text3,'string',   ['This figure is produced by', ' ', strcat(MakeFigureFilePrefix, num2str(edit1)),'.m','               ','(NR)']);  
     case CRfigures
        set(text3,'string',   ['This figure is produced by', ' ', strcat(MakeFigureFilePrefix, num2str(edit1)),'.m','               ','(CR)']);  
     otherwise
        set(text3,'string',   ['This figure is produced by', ' ', strcat(MakeFigureFilePrefix, s),'.m', '               ', '(R)']);  
   end

%********************************************************
function AdjustSubplots
%********************************************************
global plotOffset
          % set(gcf,'Visible', 'off');
           MagnificationFactor = 0.92;
           right = 0.85;   
           c = get(gcf,'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=sum(unique(p(:,1))<1);
           diff = length(unique(p(:,1))) - col;
           if col > 0,
             row = m/col;
           end
           %simpliy do a horizontal shift for children like "camera" menu
           hshift = .05;
           for i=m:-1:1
                if p(i,1)<1
                    width = p(i,3);
                    %hshift = (right - col * width) / (col+1);
                    p(i,1) = p(i,1) - hshift;
                    set(c(i), 'position', p(i,:));  
                end
            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
%********************************************************
function ClearGlobalVariables
%********************************************************  
global plotOffset
global LastFigureNo 
global PaperName 
global MakeFigureFilePrefix
global IfNewWindow
global IfAddTitle 
global IfLoadData 
global StopPlot
global WLVERBOSE;
global NRfigures;
global CRfigures;
global UnderConstructionFigures;

clear plotOffset
clear LastFigureNo 
clear PaperName 
clear MakeFigureFilePrefix
clear IfNewWindow
clear IfAddTitle 
clear IfLoadData 
clear StopPlot
clear WLVERBOSE;
clear NRfigures;
clear CRfigures;
clear UnderConstructionFigures;%% 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 + -