Home > vbmeg > functions > gui > project_mgr_dir > project_mgr_close.m

project_mgr_close

PURPOSE ^

close project_mgr gui and module guis.

SYNOPSIS ^

function project_mgr_close(fig)

DESCRIPTION ^

 close project_mgr gui and module guis.
 [USAGE]
    project_mgr_close(<fig>);
 [IN]
    fig : figure handle of project_mgr gui.
 [OUT]
    none

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function project_mgr_close(fig)
0002 % close project_mgr gui and module guis.
0003 % [USAGE]
0004 %    project_mgr_close(<fig>);
0005 % [IN]
0006 %    fig : figure handle of project_mgr gui.
0007 % [OUT]
0008 %    none
0009 %
0010 % Copyright (C) 2011, ATR All Rights Reserved.
0011 % License : New BSD License(see VBMEG_LICENSE.txt)
0012 
0013 %
0014 % --- Previous check
0015 %
0016 if ~exist('fig', 'var') || isempty(fig) || ~ishandle(fig)
0017     error('invalid figure handle is specified.'); 
0018 end
0019 
0020 %
0021 % --- Main Procedure
0022 %
0023 
0024 % load data (@see project_mgr)
0025 data = guidata(fig);
0026 
0027 % brain figure close
0028 figures = inner_get_valid_handle(data.pa_brain_fig);
0029 if ~isempty(figures)
0030     for k=1:length(figures)
0031         pa_brain_close(figures(k));
0032     end
0033 end
0034 
0035 % fmri figure close
0036 figures = inner_get_valid_handle(data.pa_fmri_fig);
0037 if ~isempty(figures)
0038     for k=1:length(figures)
0039         pa_fmri_close(figures(k));
0040     end
0041 end
0042 
0043 % biosemi eeg figure close
0044 figures = inner_get_valid_handle(data.pa_biosemi_eeg_fig);
0045 if ~isempty(figures)
0046     for k=1:length(figures)
0047         pa_biosemi_eeg_close(figures(k));
0048     end
0049 end
0050 
0051 % brainamp eeg figure close
0052 figures = inner_get_valid_handle(data.pa_brainamp_eeg_fig);
0053 if ~isempty(figures)
0054     for k=1:length(figures)
0055         pa_brainamp_eeg_close(figures(k));
0056     end
0057 end
0058 
0059 % yokogawa meg figure close
0060 figures = inner_get_valid_handle(data.pa_yokogawa_meg_fig);
0061 if ~isempty(figures)
0062     for k=1:length(figures)
0063         pa_yokogawa_meg_close(figures(k));
0064     end
0065 end
0066 
0067 % sbi meg figure close
0068 figures = inner_get_valid_handle(data.pa_sbi_meg_fig);
0069 if ~isempty(figures)
0070     for k=1:length(figures)
0071         pa_sbi_meg_close(figures(k));
0072     end
0073 end
0074 
0075 % leadfield figures close
0076 figures = inner_get_valid_handle(data.pa_leadfield_fig);
0077 if ~isempty(figures)
0078     for k=1:length(figures)
0079         pa_leadfield_close(figures(k));
0080     end
0081 end
0082 
0083 % bayes figures close
0084 figures = inner_get_valid_handle(data.bayes_fig);
0085 if ~isempty(figures)
0086     for k=1:length(figures)
0087         bayes_parm_editor(figures(k), 'finish_request');
0088     end
0089 end
0090 
0091 % Head figures close
0092 figures = inner_get_valid_handle(data.pa_head_fig);
0093 if ~isempty(figures)
0094     for k=1:length(figures)
0095         pa_head_close(figures(k));
0096     end
0097 end
0098 
0099 % Current figures close
0100 figures = inner_get_valid_handle(data.current_fig);
0101 if ~isempty(figures)
0102     for k=1:length(figures)
0103         current_gui_delete(figures(k));
0104     end
0105 end
0106 
0107 % Tools figures close
0108 figures = inner_get_valid_handle(data.tools_fig);
0109 if ~isempty(figures)
0110     for k=1:length(figures)
0111         set(0, 'CurrentFigure', figures(k));
0112         tool_launcher('exit');
0113     end
0114 end
0115 
0116 % Batch builder close
0117 figures = inner_get_valid_handle(data.batch_fig);
0118 if ~isempty(figures)
0119     for k=1:length(figures)
0120         delete(figures(k));
0121     end
0122 end
0123 
0124 % project mgr figure close
0125 delete(fig);
0126 
0127 function [handles] = inner_get_valid_handle(handles)
0128 % check and return valid figure handles
0129 % [USAGE]
0130 %    handles = inner_get_valid_handle(<handles>);
0131 % [IN]
0132 %    handles : figure handles
0133 % [OUT]
0134 %    handles : valid handles
0135 
0136 % remove empty entry
0137 empty_ix = isempty(handles);
0138 if isempty(empty_ix)
0139     handles(empty_ix) = [];
0140 end
0141 
0142 % extract valid handle list
0143 valid_ix = find(ishandle(handles) == 1);
0144 handles = handles(valid_ix, :);

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005