0001 function project_mgr_launch_module(in_fig, module_name, init_parm)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 if ~exist('in_fig', 'var') || isempty(in_fig) || ~ishandle(in_fig)
0026 error('invalid figure handle is specified.');
0027 end
0028 if ~exist('module_name', 'var') || isempty(module_name)
0029 error('invalid module_name is specified.');
0030 end
0031 if ~exist('init_parm', 'var')
0032 init_parm = [];
0033 end
0034
0035
0036
0037
0038
0039
0040 data = guidata(in_fig);
0041 proj_root = get(data.H.project_root_edit, 'String');
0042
0043 fig = [];
0044
0045 switch(module_name)
0046 case 'brain'
0047 if isfield(init_parm, 'std_brain') || ...
0048 isfield(init_parm, 'subj_mask')
0049
0050 obj = brain_file_maker_new(proj_root);
0051 obj = brain_file_maker_set_parm(obj, init_parm);
0052 fig = brain_file_maker_get_figure_handle(obj);
0053 data.tools_fig = [data.tools_fig; fig];
0054 else
0055
0056 fig = pa_brain_create(proj_root);
0057 if ishandle(fig)
0058 pa_brain_set_parm(fig, init_parm);
0059 data.pa_brain_fig = [data.pa_brain_fig; fig];
0060 end
0061 end
0062 case 'fmri'
0063 fig = pa_fmri_create(proj_root);
0064 if ishandle(fig)
0065 pa_fmri_set_parm(fig, init_parm);
0066 data.pa_fmri_fig = [data.pa_fmri_fig; fig];
0067 end
0068 case 'biosemi_eeg'
0069 fig = pa_biosemi_eeg_create(proj_root);
0070 if ishandle(fig)
0071 pa_biosemi_eeg_set_parm(fig, init_parm);
0072 data.pa_biosemi_eeg_fig = [data.pa_biosemi_eeg_fig; fig];
0073 end
0074 case 'brainamp_eeg'
0075 fig = pa_brainamp_eeg_create(proj_root);
0076 if ishandle(fig)
0077 pa_brainamp_eeg_set_parm(fig, init_parm);
0078 data.pa_brainamp_eeg_fig = [data.pa_brainamp_eeg_fig; fig];
0079 end
0080 case 'sbi_meg'
0081 fig = pa_sbi_meg_create(proj_root);
0082 if ishandle(fig)
0083 pa_sbi_meg_set_parm(fig, init_parm);
0084 data.pa_sbi_meg_fig = [data.pa_sbi_meg_fig; fig];
0085 end
0086 case 'yokogawa_meg'
0087 fig = pa_yokogawa_meg_create(proj_root);
0088 if ishandle(fig)
0089 pa_yokogawa_meg_set_parm(fig, init_parm);
0090 data.pa_yokogawa_meg_fig = [data.pa_yokogawa_meg_fig; fig];
0091 end
0092 case 'spm_curry_head'
0093 fig = pa_head_create(proj_root);
0094 if ishandle(fig)
0095 pa_head_set_parm(fig, init_parm);
0096 data.pa_head_fig = [data.pa_head_fig; fig];
0097 end
0098 case 'leadfield'
0099 fig = pa_leadfield_create(proj_root);
0100 if ishandle(fig)
0101 pa_leadfield_set_parm(fig, init_parm);
0102 data.pa_leadfield_fig = [data.pa_leadfield_fig; fig];
0103 end
0104 case 'bayes'
0105 fig = bayes_parm_editor_init(proj_root, init_parm);
0106 if ishandle(fig)
0107 data.bayes_fig = [data.bayes_fig; fig];
0108 end
0109 case 'current'
0110 fig = current_gui_new(proj_root, init_parm);
0111 if ishandle(fig)
0112 data.current_fig = [data.current_fig; fig];
0113 end
0114 end
0115
0116
0117 guidata(in_fig, data);