Home > vbmeg > functions > gui > preAnalysis > sbi_meg > pa_sbi_meg_callback.m

pa_sbi_meg_callback

PURPOSE ^

callback function for sbi meg gui.

SYNOPSIS ^

function H = pa_sbi_meg_callback(fig, hObj)

DESCRIPTION ^

 callback function for sbi meg gui.
 [USAGE]
    pa_sbi_meg_callback(<fig>, <hObj>);
 [IN]
     fig : figure handle of sbi meg gui.
    hObj : event component handle.
 [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:

SOURCE CODE ^

0001 function H = pa_sbi_meg_callback(fig, hObj)
0002 % callback function for sbi meg gui.
0003 % [USAGE]
0004 %    pa_sbi_meg_callback(<fig>, <hObj>);
0005 % [IN]
0006 %     fig : figure handle of sbi meg gui.
0007 %    hObj : event component handle.
0008 % [OUT]
0009 %    none
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 %
0015 % --- Previous check
0016 %
0017 if ~exist('fig', 'var') || isempty(fig) || ~ishandle(fig)
0018     error('invalid figure is specified.');
0019 end
0020 if ~exist('hObj', 'var')
0021     error('hObj is a required parameter.');
0022 end
0023 
0024 %
0025 % --- Main Procedure
0026 %
0027 global vbmeg_inst;
0028 define = vbmeg_inst.const;
0029 
0030 % load data(@see pa_sbi_meg_create)
0031 data = guidata(fig);
0032 H = data.H;
0033 
0034 switch(hObj)
0035     case H.prjroot_push
0036         dir = dir_dialog(get(H.prjroot_edit, 'String'));
0037         if dir ~= 0
0038             set(H.prjroot_edit, 'String', dir);
0039         end
0040     case H.analyze_push
0041         [dir fname] = vb_file_select({'.hdr'});
0042         if ~isempty(dir)
0043             set(H.analyze_edit, 'String', [dir filesep fname{1}]);
0044         end
0045     case H.sbi_push
0046         [dir fname] = vb_file_select({define.MEG1_EXTENSION});
0047         if ~isempty(dir)
0048             set(H.sbi_file_edit, 'String', [dir filesep fname{1}]);
0049         end
0050         pa_sbi_meg_util(fig, 'update_exec_push_status');
0051         pa_sbi_meg_util(fig, 'update_output_fname');
0052     case H.Dicom_push
0053         [dir fname] = vb_file_select({define.DICOM1_EXTENSION});
0054         if ~isempty(dir)
0055             set(H.Dicom_file_edit, 'String', [dir filesep fname{1}]);
0056         end
0057         pa_sbi_meg_util(fig, 'update_output_fname');
0058     case H.save_dir_push
0059         proj_root = get(H.prjroot_edit, 'String');
0060         [dir canceled] = pa_prjdir_select(proj_root);
0061         if ~canceled
0062             set(H.save_dir_edit, 'String', dir);
0063         end
0064         pa_sbi_meg_util(fig, 'update_output_fname');
0065     case H.meg_reset_push
0066         pa_sbi_meg_util(fig, 'reset_parameter');
0067         pa_sbi_meg_util(fig, 'update_exec_push_status');
0068     case H.meg_exec_push
0069         pa_sbi_meg_util(fig, 'exec_meg');
0070     case H.sbi_file_edit
0071         pa_sbi_meg_util(fig, 'update_exec_push_status');
0072     case H.Dicom_file_edit
0073         pa_sbi_meg_util(fig, 'update_exec_push_status');
0074     case H.keyword_edit
0075         pa_sbi_meg_util(fig, 'update_output_fname');
0076         pa_sbi_meg_util(fig, 'update_exec_push_status');
0077     case H.comment_edit
0078         pa_sbi_meg_util(fig, 'update_exec_push_status');
0079     case H.save_dir_edit
0080         pa_sbi_meg_util(fig, 'update_output_fname');
0081 end
0082 
0083 % save data
0084 guidata(fig, data);

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