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

project_mgr_launch_module

PURPOSE ^

launch module.

SYNOPSIS ^

function project_mgr_launch_module(in_fig, module_name, init_parm)

DESCRIPTION ^

 launch module.
 [USAGE]
    project_mgr_launch_module(<in_fig>, <module_name>[, init_parm]);
 [IN]
         in_fig : figure handle of project_mgr gui.
    module_name : modules calls    : This function.
                  'brain'          : vb_job_brain
                  'fmri'           : vb_job_fmri
                  'biosemi_eeg'    : vb_job_meg(with biosemi parameter)
                  'brainamp_eeg'   : vb_job_meg(with brainamp parameter)
                  'sbi_meg'        : vb_job_meg(with sbi parameter)
                  'yokogawa_meg'   : vb_job_meg(with yokogawa parameter)
                  'leadfield'      : vb_job_leadfield
                  'bayes'          : vb_job_vb
                  'current'        : vb_job_current
                  'spm_curry_head' : vb_job_head_1shell / vb_job_head_3shell

 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:

SOURCE CODE ^

0001 function project_mgr_launch_module(in_fig, module_name, init_parm)
0002 % launch module.
0003 % [USAGE]
0004 %    project_mgr_launch_module(<in_fig>, <module_name>[, init_parm]);
0005 % [IN]
0006 %         in_fig : figure handle of project_mgr gui.
0007 %    module_name : modules calls    : This function.
0008 %                  'brain'          : vb_job_brain
0009 %                  'fmri'           : vb_job_fmri
0010 %                  'biosemi_eeg'    : vb_job_meg(with biosemi parameter)
0011 %                  'brainamp_eeg'   : vb_job_meg(with brainamp parameter)
0012 %                  'sbi_meg'        : vb_job_meg(with sbi parameter)
0013 %                  'yokogawa_meg'   : vb_job_meg(with yokogawa parameter)
0014 %                  'leadfield'      : vb_job_leadfield
0015 %                  'bayes'          : vb_job_vb
0016 %                  'current'        : vb_job_current
0017 %                  'spm_curry_head' : vb_job_head_1shell / vb_job_head_3shell
0018 %
0019 % Copyright (C) 2011, ATR All Rights Reserved.
0020 % License : New BSD License(see VBMEG_LICENSE.txt)
0021 
0022 %
0023 % --- Previous check
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 % --- Main Procedure
0037 %
0038 
0039 % load data (@see project_mgr)
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             % brain_parm is for (standard brain or subject smooth brain)
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             % brain_parm is for import BrainVoyager or FreeSurfer
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 % save data
0117 guidata(in_fig, data);

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