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

📄 gui_eeg_contours.m

📁 Matlab下的EEG处理程序库
💻 M
📖 第 1 页 / 共 3 页
字号:
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Contour Size
    height = (height - .01) - frameheight;
    
    G.Frame_step = uicontrol('Parent',GUI,'Style','frame','Units','Normalized',...
        'Position',[frameindent   height framewidth frameheight]);
    
    G.Bcontourstep = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
        'Position',[frameindent*2 height+L(1) titlewidth textheight],...
        'String','Contour Steps','HorizontalAlignment','left',...
        'BackgroundColor',[0.0 0.0 0.75],'ForegroundColor', [1 1 1],...
        'Callback','gui_eeg_contour_steps(gcbf);');
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Contour ColorMap
    height = (height - .01) - frameheight;
    
    G.Frame_step = uicontrol('Parent',GUI,'Style','frame','Units','Normalized',...
        'Position',[frameindent   height framewidth frameheight]);
    
    G.Title_step = uicontrol('Parent',GUI,'Style','text','Units','Normalized', Font, ...
        'Position',[frameindent*2 height+L(1) titlewidth textheight],...
        'String','Color Maps','HorizontalAlignment','left');

    G.BEEGcolorMap = uicontrol('Parent',GUI,'Style','pushbutton',...
        'Units','Normalized', Font, ...
        'Position',[indent(2)+.01 height+L(1) radiowidth radioheight], 'String','EEG ColorMaps',...
        'BusyAction','queue','HorizontalAlignment', 'center',...
        'BackgroundColor',[0.0 0.0 0.75],'ForegroundColor', [1 1 1],...
        'Callback',strcat('EEGCONTOURS = get(gcbf,''Userdata'');',...
            'tmp = gui_eeg_colormap(EEGCONTOURS.gui);',...
            'clear tmp EEGCONTOURS;'));
    
    G.BcolorMap = uicontrol('Parent',GUI,'Style','pushbutton',...
        'Units','Normalized', Font, ...
        'Position',[indent(3)+.01 height+L(1) radiowidth radioheight], 'String','MATLAB ColorMaps',...
        'BusyAction','queue','HorizontalAlignment', 'center',...
        'BackgroundColor',[0.0 0.0 0.75],'ForegroundColor', [1 1 1],...
        'Callback',strcat('EEGCONTOURS = get(gcbf,''Userdata'');',...
            'EEGCONTOURS.p.colorMap.map = ColorMapsShow;',...
            'set(EEGCONTOURS.gui,''Userdata'',EEGCONTOURS); clear EEGCONTOURS;'));
    
    G.BcreateCMap = uicontrol('Parent',GUI,'Style','pushbutton',...
        'Units','Normalized', Font, ...
        'Position',[indent(4) height+L(1) radiowidth radioheight], 'String','Create ColorMap',...
        'BusyAction','queue','HorizontalAlignment', 'center',...
        'BackgroundColor',[0.0 0.0 0.75],'ForegroundColor', [1 1 1],...
        'Tooltipstring','Not yet integrated fully with EEG toolbox - can export to main workspace.',...
        'Callback','ColorMapsMake;');

    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Plot Controls
    height = (height - .01) - frameheight*3;
    
    G.Frame_plots = uicontrol('Parent',GUI,'Style','frame','Units','Normalized', ...
        'Position',[frameindent   height  framewidth frameheight*3]);
    
    G.Title_plots = uicontrol('Parent',GUI,'Style','text','Units','Normalized', Font, ...
        'Position',[frameindent*2 height+L(3) titlewidth  textheight],...
        'String','Plot Control','HorizontalAlignment','left');
    
    G.BplotElec = uicontrol('Parent',GUI,'Style','Checkbox','Units','Normalized', Font, ...
        'Position',[indent(2) height+L(3) radiowidth radioheight],...
        'String','Electrodes','Value',p.elec.plot,...
        'Callback',strcat('EEGCONTOURS = get(gcbf,''Userdata'');',...
        'EEGCONTOURS.p.elec.plot = get(EEGCONTOURS.handles.BplotElec, ''Value'');',...
        'set(EEGCONTOURS.gui,''Userdata'',EEGCONTOURS); clear EEGCONTOURS;'));
    
    G.BplotESurface    = uicontrol('Parent',GUI,'Style','Checkbox',...
        'Units','Normalized', Font, ...
        'Position',[indent(2) height+L(2) radiowidth radioheight],...
        'String','Elec Surface','Value',p.elec.plotSurf,...
        'Callback',strcat('EEGCONTOURS = get(gcbf,''Userdata'');',...
        'EEGCONTOURS.p.elec.plotSurf = get(EEGCONTOURS.handles.BplotESurface, ''Value'');',...
        'set(EEGCONTOURS.gui,''Userdata'',EEGCONTOURS); clear EEGCONTOURS;'));

    G.BplotMSurface    = uicontrol('Parent',GUI,'Style','Checkbox',...
        'Units','Normalized', Font, ...
        'Position',[indent(2) height+L(1) radiowidth radioheight],...
        'String','Mesh Surface','Value',p.mesh.plotSurf,...
        'Callback',strcat('EEGCONTOURS = get(gcbf,''Userdata'');',...
        'EEGCONTOURS.p.mesh.plotSurf = get(EEGCONTOURS.handles.BplotMSurface, ''Value'');',...
        'set(EEGCONTOURS.gui,''Userdata'',EEGCONTOURS); clear EEGCONTOURS;'));
    
    G.BplotRaw2D      = uicontrol('Parent',GUI,'Style','Checkbox',...
        'Units','Normalized', Font, ...
        'Position',[indent(3) height+L(3) radiowidth radioheight],...
        'String','2D Contour','Value',p.contour.raw2D,...
        'Callback',strcat('EEGCONTOURS = get(gcbf,''Userdata'');',...
        'EEGCONTOURS.p.contour.raw2D =      get(EEGCONTOURS.handles.BplotRaw2D, ''Value'');',...
        'set(EEGCONTOURS.gui,''Userdata'',EEGCONTOURS); clear EEGCONTOURS;'));

    G.Bplot2D = uicontrol('Parent',GUI,'Style','Checkbox','Units','Normalized', Font, ...
        'Position',[indent(3) height+L(2) radiowidth radioheight],...
        'String','2D Projected','Value',p.contour.plot2D,...
        'Callback',strcat('EEGCONTOURS = get(gcbf,''Userdata'');',...
        'EEGCONTOURS.p.contour.plot2D =     get(EEGCONTOURS.handles.Bplot2D, ''Value'');',...
        'set(EEGCONTOURS.gui,''Userdata'',EEGCONTOURS); clear EEGCONTOURS;'));
    
    G.Bplot3D = uicontrol('Parent',GUI,'Style','Checkbox','Units','Normalized', Font, ...
        'Position',[indent(3) height+L(1) radiowidth radioheight],...
        'String','3D contour','Value',p.contour.plot3D,...
        'Callback',strcat('EEGCONTOURS = get(gcbf,''Userdata'');',...
        'EEGCONTOURS.p.contour.plot3D =     get(EEGCONTOURS.handles.Bplot3D, ''Value'');',...
        'set(EEGCONTOURS.gui,''Userdata'',EEGCONTOURS); clear EEGCONTOURS;'));

    switch p.saveGraphics
    case 'Save Plots', graphics = 1;
    case 'eps',  graphics = 2;
    case 'jpg',  graphics = 3;
    case 'tif',  graphics = 4;
    case 'png',  graphics = 5;
    otherwise,   graphics = 1;
    end
    G.BsaveGraphics = uicontrol('Tag','PinterpMethod','Parent',GUI,'Style','popupmenu',...
        'Units','Normalized',Font,...
        'TooltipString','Automatically save plot(s) to specified graphics file format.',...
        'Position',[indent(4) height+L(3) radiowidth popupheight],...
        'String',{'Save Plots' 'eps' 'jpg' 'tif' 'png'},...
        'Value',graphics,...
        'Callback',strcat('EEGCONTOURS = get(gcbf,''Userdata'');',...
        'EEGCONTOURS.p.saveGraphics = popupstr(EEGCONTOURS.handles.BsaveGraphics);',...
        'set(EEGCONTOURS.gui,''Userdata'',EEGCONTOURS); clear EEGCONTOURS;'));
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % GUI Controls
    height = (height - .01) - frameheight;
    boxwidth = 0.2;
    
    Font.FontWeight = 'bold';
    
    G.Bquit = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
        'Position',[indent(1) height+L(1) boxwidth boxheight],...
        'String','QUIT','BusyAction','queue',...
        'BackgroundColor',[0.75 0.0 0.0],...
        'ForegroundColor', [1 1 1], 'HorizontalAlignment', 'center',...
        'Callback',strcat('EEGCONTOURS = get(gcbf,''Userdata'');',...
                          'p = EEGCONTOURS.p;',...
                          'if isfield(EEGCONTOURS,''parent''), ',...
                              'parent = get(EEGCONTOURS.parent.gui,''Userdata''); ',...
                              'parent.p = EEGCONTOURS.p; ',...
                              'set(EEGCONTOURS.parent.gui,''Userdata'',parent); ',...
                              'clear parent; ',...
                          'end; ',...
                          'clear EEGCONTOURS; close gcbf;'));
    
    % SAVE GUI PARAMETERS
    G.Bsave = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
        'Position',[indent(2) height+L(1) boxwidth boxheight],...
        'String','SAVE','BusyAction','queue',...
        'TooltipString','Save current parameters as defaults for current working directory.',...
        'BackgroundColor',[0.0 0.0 0.75],...
        'ForegroundColor', [1 1 1], 'HorizontalAlignment', 'center',...
        'Callback',strcat('EEGCONTOURS = get(gcbf,''Userdata'');',...
                          'eeg_toolbox_defaults(''write'',EEGCONTOURS.p);',...
                          'clear EEGCONTOURS;'));
    

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % NEXT: Run the engine!
    
    G.Bplot = uicontrol('Parent',GUI,'Style','pushbutton','Units','Normalized', Font, ...
        'Position',[indent(3) height+L(1) boxwidth boxheight],...
        'String','PLOT','BusyAction','queue',...
        'TooltipString','Create plots for given parameters.',...
        'BackgroundColor',[0.0 0.5 0.0],...
        'ForegroundColor', [1 1 1], 'HorizontalAlignment', 'center',...
        'Callback',strcat('EEGCONTOURS = get(gcbf,''Userdata'');',...
        'set(EEGCONTOURS.gui,''Pointer'',''watch'');',...
        'p = eeg_contours_engine(EEGCONTOURS.p);',...
        'set(EEGCONTOURS.handles.EminimumIntensity,''String'', num2str(p.minimumIntensity), ''Value'', p.minimumIntensity ); ',...
        'set(EEGCONTOURS.handles.EmaximumIntensity,''String'', num2str(p.maximumIntensity), ''Value'', p.maximumIntensity ); ',...
        'set(EEGCONTOURS.handles.EtimePoint,''String'', num2str(p.volt.samplePoint),''Value'', p.volt.samplePoint ); ',...
        'set(EEGCONTOURS.handles.EgridSize,''String'', num2str(p.grid.size),''Value'', p.grid.size ); ',...
        'set(EEGCONTOURS.handles.EgridRes,''String'', num2str(p.grid.res),''Value'', p.grid.res ); ',...
        'EEGCONTOURS.p = p; ',...
        'if isequal(get(EEGCONTOURS.handles.Bhold,''Value''),0),',...
            'p = gui_updateparent(EEGCONTOURS,0);',...
            'set(EEGCONTOURS.gui,''Pointer'',''arrow'');',...
            'close gcbf;',...
        'else, ',...
            'set(EEGCONTOURS.gui,''Userdata'',EEGCONTOURS); ',...
            'set(EEGCONTOURS.gui,''Pointer'',''arrow'');',...
        'end; clear EEGCONTOURS;'));

    % Hold GUI Open checkbox
	G.Bhold = uicontrol('Parent',GUI,'Style','checkbox','Units','Normalized', Font, ...
        'Position',[indent(4) height+L(1) boxwidth boxheight],...
        'String','Hold GUI','BusyAction','queue',...
        'TooltipString','EEG Contours remains open after ''Plot'' command.',...
        'Value',p.hold,'HorizontalAlignment', 'center');
    
    EEGCONTOURS.gui = GUI;
    EEGCONTOURS.handles = G;
    if exist('parent','var'), EEGCONTOURS.parent.gui = parent; end
    set(EEGCONTOURS.gui,'UserData',EEGCONTOURS);
    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -