Home > bioelectromagnetism > gui_eeg_colormap.m

gui_eeg_colormap

PURPOSE ^

gui_eeg_colormap - display colormaps for eeg_toolbox

SYNOPSIS ^

function [p] = gui_eeg_colormap(parent)

DESCRIPTION ^

 gui_eeg_colormap - display colormaps for eeg_toolbox

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [p] = gui_eeg_colormap(parent)
0002 
0003 % gui_eeg_colormap - display colormaps for eeg_toolbox
0004 %
0005 % Usage: [p] = gui_eeg_colormap([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 
0017 % reset the gui_struct parent field to the handles of the input gui_struct
0018 
0019 if exist('parent','var'),
0020     COLORMAP.parent.gui = parent; 
0021     ParentUserdata = get(parent,'Userdata');
0022     COLORMAP.p = ParentUserdata.p;
0023 else
0024     error('No parent gui parameter supplied');
0025 end
0026 
0027 % GUI General Parameters
0028 GUIwidth  = 200;
0029 GUIheight = 200;
0030 GUI = figure('Name','EEG Color Maps','Tag','COLORMAP',...
0031              'NumberTitle','off','HandleVisibility','callback',...
0032              'MenuBar','none','Position',[1 1 GUIwidth GUIheight]);
0033 movegui(GUI,'center');
0034 
0035 COLORMAP.gui = GUI;
0036 
0037 Font.FontName   = 'Helvetica';
0038 Font.FontUnits  = 'Pixels';
0039 Font.FontSize   = 12;
0040 Font.FontWeight = 'normal';
0041 Font.FontAngle  = 'normal';
0042 
0043 % Colormap style
0044 
0045 switch COLORMAP.p.colorMap.style
0046 case 'Red/Blue/White', Cmap = 1; COLORMAP.p = eeg_colormap(COLORMAP.p);
0047 case 'Red/Blue',       Cmap = 2; COLORMAP.p = eeg_colormap(COLORMAP.p);
0048 case 'Gray',           Cmap = 3; COLORMAP.p = eeg_colormap(COLORMAP.p);
0049 otherwise,
0050     Cmap = 4;
0051     if isempty(COLORMAP.p.colorMap.map),
0052         COLORMAP.p.colorMap.style = 'default';
0053         COLORMAP.p = eeg_colormap(COLORMAP.p);
0054     end
0055 end
0056 
0057 G.Title_style = uicontrol('Parent',GUI,'Style','text','Units','Normalized',Font,...
0058     'Position',[.05 .8 .9 .1],...
0059     'HorizontalAlignment', 'left',...
0060     'String',' Map Style');
0061 G.PcolorMap = uicontrol('Tag','PcolorMap','Parent',GUI,'Style','popupmenu',...
0062     'Units','Normalized',Font,...
0063     'Position',[.05 .7 .9 .1],...
0064     'String',{'Red/Blue/White' 'Red/Blue' 'Gray' 'default'},'Value',Cmap,...
0065     'Callback',strcat('COLORMAP = get(gcbf,''Userdata'');',...
0066         'COLORMAP.p.colorMap.style = popupstr(COLORMAP.handles.PcolorMap);',...
0067         'switch COLORMAP.p.colorMap.style, ',...
0068         'case {''Gray'',''default''},',...
0069             'set(COLORMAP.handles.ECmapExponent,''Enable'',''off'');',...
0070         'otherwise, ',...
0071             'set(COLORMAP.handles.ECmapExponent,''Enable'',''on'');',...
0072         'end; ',...
0073         'COLORMAP.p = eeg_colormap(COLORMAP.p);',...
0074         'set(COLORMAP.gui,''Userdata'',COLORMAP); clear COLORMAP;'));
0075 
0076 % Cmap Length
0077 toolstr = 'Length of the map matrix used for colormap command (integer values only).';
0078 G.Title_length = uicontrol('Parent',GUI,'Style','text','Units','Normalized',Font,...
0079     'Position',[.05 .5 .6 .1],...
0080     'HorizontalAlignment', 'left',...
0081     'String',' Map Length',...
0082     'TooltipString', toolstr);
0083 G.ECmapLength = uicontrol('Parent',GUI,'Style','edit','Units','Normalized',Font,...
0084     'Position',[.65 .5 .3 .1],...
0085     'String',num2str(COLORMAP.p.colorMap.length),...
0086     'TooltipString', toolstr,...
0087     'Callback',strcat('COLORMAP = get(gcbf,''Userdata'');',...
0088                       'COLORMAP.p.colorMap.length = str2num(get(COLORMAP.handles.ECmapLength,''String''));',...
0089                       'set(COLORMAP.gui,''Userdata'',COLORMAP); clear COLORMAP;'));
0090 
0091 % Cmap Exponent
0092 toolstr = 'Enhance extreme values with larger exponents (integer values only, not used for Gray or default).';
0093 G.Title_length = uicontrol('Parent',GUI,'Style','text','Units','Normalized',Font,...
0094     'Position',[.05 .4 .6 .1],...
0095     'HorizontalAlignment', 'left',...
0096     'TooltipString',toolstr,...
0097     'String',' Map Exponent');
0098 G.ECmapExponent = uicontrol('Parent',GUI,'Style','edit','Units','Normalized',Font,...
0099     'Position',[.65 .4 .3 .1],...
0100     'String',num2str(COLORMAP.p.colorMap.exp),...
0101     'TooltipString',toolstr,...
0102     'Callback',strcat('COLORMAP = get(gcbf,''Userdata'');',...
0103                       'COLORMAP.p.colorMap.exp = str2num(get(COLORMAP.handles.ECmapExponent,''String''));',...
0104                       'set(COLORMAP.gui,''Userdata'',COLORMAP); clear COLORMAP;'));
0105 
0106 
0107 % Cmap Cmin
0108 toolstr = ' 0 <= color min < color max  (float values)';
0109 G.Title_cmin = uicontrol('Parent',GUI,'Style','text','Units','Normalized',Font,...
0110     'Position',[.05 .3 .6 .1],...
0111     'HorizontalAlignment', 'left',...
0112     'String',' Map Color Min',...
0113     'TooltipString',toolstr);
0114 G.ECmapCmin = uicontrol('Parent',GUI,'Style','edit','Units','Normalized',Font,...
0115     'Position',[.65 .3 .3 .1],...
0116     'String',num2str(COLORMAP.p.colorMap.Cmin),...
0117     'TooltipString',toolstr,...
0118     'Callback',strcat('COLORMAP = get(gcbf,''Userdata'');',...
0119                       'COLORMAP.p.colorMap.Cmin = str2num(get(COLORMAP.handles.ECmapCmin,''String''));',...
0120                       'set(COLORMAP.gui,''Userdata'',COLORMAP); clear COLORMAP;'));
0121 
0122 
0123 % Cmap Cmax
0124 toolstr = ' color min < color max <= 1 (float values)';
0125 G.Title_cmax = uicontrol('Parent',GUI,'Style','text','Units','Normalized',Font,...
0126     'Position',[.05 .2 .6 .1],...
0127     'HorizontalAlignment', 'left',...
0128     'String',' Map Color Max',...
0129     'TooltipString',toolstr);
0130 G.ECmapCmax = uicontrol('Parent',GUI,'Style','edit','Units','Normalized',Font,...
0131     'Position',[.65 .2 .3 .1],...
0132     'String',num2str(COLORMAP.p.colorMap.Cmax),...
0133     'TooltipString', toolstr,...
0134     'Callback',strcat('COLORMAP = get(gcbf,''Userdata'');',...
0135                       'COLORMAP.p.colorMap.Cmax = str2num(get(COLORMAP.handles.ECmapCmax,''String''));',...
0136                       'set(COLORMAP.gui,''Userdata'',COLORMAP); clear COLORMAP;'));
0137 
0138 
0139 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0140 Font.FontWeight = 'bold';
0141 
0142 % Plot and Return the colormap!
0143 G.Bplot = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
0144     'Position',[.05 .01 .29 .1],...
0145     'String','PLOT','BusyAction','queue',...
0146     'TooltipString','Plot the colormap (using rgbplot and colorbar).',...
0147     'BackgroundColor',[0.0 0.5 0.0],...
0148     'ForegroundColor', [1 1 1], 'HorizontalAlignment', 'center',...
0149     'Callback',strcat('COLORMAP = get(gcbf,''Userdata'');',...
0150                       'COLORMAP.p.colorMap.plot = 1;',...
0151                       'p = eeg_colormap(COLORMAP.p);',...
0152                       'COLORMAP.p.colorMap.plot = 0;',...
0153                       'set(COLORMAP.gui,''Userdata'',COLORMAP); clear COLORMAP;'));
0154                   
0155 % Return the colormap!
0156 G.Bdone = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
0157     'Position',[.35 .01 .29 .1],...
0158     'String','RETURN','BusyAction','queue',...
0159     'TooltipString','Return the colormap and parameters.',...
0160     'BackgroundColor',[0.0 0.5 0.0],...
0161     'ForegroundColor', [1 1 1], 'HorizontalAlignment', 'center',...
0162     'Callback',strcat('COLORMAP = get(gcbf,''Userdata'');',...
0163                       'p = gui_updateparent(COLORMAP);',...
0164                       'close gcbf; clear COLORMAP;'));
0165                   
0166 % Cancel
0167 G.Bquit = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
0168     'Position',[.65 .01 .3 .1],...
0169     'String','CANCEL','BusyAction','queue',...
0170     'BackgroundColor',[0.75 0.0 0.0],...
0171     'ForegroundColor', [1 1 1], 'HorizontalAlignment', 'center',...
0172     'Callback','close gcbf;');
0173 
0174 
0175 % Update the gui_struct handles for this gui
0176 COLORMAP.handles = G;
0177 set(COLORMAP.gui,'Userdata',COLORMAP);
0178 
0179 p = COLORMAP.p;
0180 return

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