Home > bioelectromagnetism > gui_eeg_contour_steps.m

gui_eeg_contour_steps

PURPOSE ^

gui_eeg_contour_steps - GUI for contour steps of topographic maps

SYNOPSIS ^

function [p] = gui_eeg_contour_steps(parent)

DESCRIPTION ^

 gui_eeg_contour_steps - GUI for contour steps of topographic maps

 Usage: [p] = eeg_contour_steps([parent])

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [p] = gui_eeg_contour_steps(parent)
0002 
0003 % gui_eeg_contour_steps - GUI for contour steps of topographic maps
0004 %
0005 % Usage: [p] = eeg_contour_steps([parent])
0006 %
0007 
0008 % $Revision: 1.1 $ $Date: 2004/11/12 01:32:35 $
0009 
0010 % Licence:  GNU GPL, no express or implied warranties
0011 % History:  10/2002, Darren.Weber_at_radiology.ucsf.edu
0012 %
0013 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0014 
0015 
0016 % reset the gui_struct parent field to the handles of the input gui_struct
0017 
0018 if exist('parent','var'),
0019     ContourSteps.parent.gui = parent; 
0020     ParentUserdata = get(parent,'Userdata');
0021     ContourSteps.p = ParentUserdata.p;
0022 else
0023     error('No parent gui parameter supplied');
0024 end
0025 
0026 % GUI General Parameters
0027 GUIwidth  = 200;
0028 GUIheight = 100;
0029 GUI = figure('Name','Contour Steps','Tag','CONTOURSTEPS',...
0030              'NumberTitle','off','HandleVisibility','callback',...
0031              'MenuBar','none','Position',[1 1 GUIwidth GUIheight]);
0032 movegui(GUI,'center');
0033 
0034 ContourSteps.gui = GUI;
0035 
0036 Font.FontName   = 'Helvetica';
0037 Font.FontUnits  = 'Pixels';
0038 Font.FontSize   = 12;
0039 Font.FontWeight = 'normal';
0040 Font.FontAngle  = 'normal';
0041 
0042 % Contour Step Size
0043 
0044 switch ContourSteps.p.contour.stepMethod
0045 case 1,     step = [0 1];
0046 otherwise,  step = [1 0];
0047 end
0048 % Step Size
0049 G.BstepMethod0 = uicontrol('Parent',GUI,'Style','Radiobutton',...
0050     'Units','Normalized',Font,'Position',[.1 .6 .6 .2],...
0051     'String','Step Size','Value',step(1),...
0052     'Callback',strcat('ContourSteps = get(gcbf,''Userdata'');',...
0053                       'ContourSteps.p.contour.stepMethod = 0;',...
0054                       'set(ContourSteps.handles.BstepMethod0,''Value'',1);',...
0055                       'set(ContourSteps.handles.BstepMethod1,''Value'',0);',...
0056                       'set(ContourSteps.handles.EstepMethod0,''String'',num2str(ContourSteps.p.contour.stepSize));',...
0057                       'set(ContourSteps.gui,''Userdata'',ContourSteps); clear ContourSteps;'));
0058 G.EstepMethod0 = uicontrol('Parent',GUI,'Style','edit',...
0059     'Units','Normalized',Font,'Position',[.7 .6 .2 .2],...
0060     'String',num2str(ContourSteps.p.contour.stepSize),...
0061     'Callback',strcat('ContourSteps = get(gcbf,''Userdata'');',...
0062                       'ContourSteps.p.contour.stepSize = str2num(get(ContourSteps.handles.EstepMethod0,''String''));',...
0063                       'set(ContourSteps.gui,''Userdata'',ContourSteps); clear ContourSteps;'));
0064 
0065 
0066 % Number of steps
0067 G.BstepMethod1 = uicontrol('Parent',GUI,'Style','Radiobutton',...
0068     'Units','Normalized',Font,'Position',[.1 .4 .6 .2],...
0069     'String','Number of Steps','Value',step(2),...
0070     'Callback',strcat('ContourSteps = get(gcbf,''Userdata'');',...
0071                       'ContourSteps.p.contour.stepMethod = 1;',...
0072                       'set(ContourSteps.handles.BstepMethod0,''Value'',0);',...
0073                       'set(ContourSteps.handles.BstepMethod1,''Value'',1);',...
0074                       'set(ContourSteps.handles.EstepMethod1,''String'',num2str(ContourSteps.p.contour.Nsteps));',...
0075                       'set(ContourSteps.gui,''Userdata'',ContourSteps); clear ContourSteps;'));
0076 G.EstepMethod1 = uicontrol('Parent',GUI,'Style','edit',...
0077     'Units','Normalized',Font,'Position',[.7 .4 .2 .2],...
0078     'String',num2str(ContourSteps.p.contour.Nsteps),...
0079     'Callback',strcat('ContourSteps = get(gcbf,''Userdata'');',...
0080                       'ContourSteps.p.contour.Nsteps = str2num(get(ContourSteps.handles.EstepMethod1,''String''));',...
0081                       'set(ContourSteps.gui,''Userdata'',ContourSteps); clear ContourSteps;'));
0082 
0083 
0084 
0085 Font.FontWeight = 'bold';
0086 
0087 % OK: Return the parameters!
0088 G.Bdone = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
0089     'Position',[.3 .15 .3 .2],...
0090     'String','OK','BusyAction','queue',...
0091     'TooltipString','Update the ascii parameters.',...
0092     'BackgroundColor',[0.0 0.5 0.0],...
0093     'ForegroundColor', [1 1 1], 'HorizontalAlignment', 'center',...
0094     'Callback',strcat('ContourSteps = get(gcbf,''Userdata'');',...
0095                       'if isfield(ContourSteps,''parent''),',...
0096                           'if isfield(ContourSteps.parent,''gui''),',...
0097                             'parent = get(ContourSteps.parent.gui,''UserData'');',...
0098                             'if isfield(parent,''p'') & isfield(ContourSteps,''p''),',...
0099                                 'parent.p = ContourSteps.p;',...
0100                                 'set(ContourSteps.parent.gui,''UserData'',parent);',...
0101                             'end; ',...
0102                           'end; ',...
0103                       'end; ',...
0104                       'close gcbf;[p] = ContourSteps.p; clear ContourSteps parent;'));
0105                   
0106 % Cancel
0107 G.Bquit = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
0108     'Position',[.6 .15 .3 .2],...
0109     'String','CANCEL','BusyAction','queue',...
0110     'BackgroundColor',[0.75 0.0 0.0],...
0111     'ForegroundColor', [1 1 1], 'HorizontalAlignment', 'center',...
0112     'Callback','close gcbf;');
0113 
0114 
0115 % Update the gui_struct handles for this gui
0116 ContourSteps.handles = G;
0117 set(ContourSteps.gui,'Userdata',ContourSteps);
0118 
0119 p = ContourSteps.p;
0120 return

Generated on Mon 15-Aug-2005 15:36:19 by m2html © 2003