Home > functions > gui > preAnalysis > head > head_spm_curry > pa_head_callback.m

pa_head_callback

PURPOSE ^

callback function for head gui.

SYNOPSIS ^

function pa_head_callback(fig, hObj)

DESCRIPTION ^

 callback function for head gui.
 [USAGE]
    pa_head_callback(<fig>, <hObj>);
 [IN]
     fig : figure handle of head 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 pa_head_callback(fig, hObj)
0002 % callback function for head gui.
0003 % [USAGE]
0004 %    pa_head_callback(<fig>, <hObj>);
0005 % [IN]
0006 %     fig : figure handle of head 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_head_create)
0031 data = guidata(fig);
0032 H = data.H;
0033 
0034 %get(gcbo, 'Tag')% debug
0035 switch( hObj )
0036     case H.prjroot_push
0037         dir = dir_dialog(get(H.prjroot_edit, 'String'));
0038         if dir ~= 0
0039             set(H.prjroot_edit, 'String', dir);
0040         end
0041     case {H.vertices_1shell_edit, H.vertices_3shell_edit}
0042         pa_head_util(fig, 'update_output_fname');
0043     case H.analyze_file_push
0044         [dir fname] = vb_file_select({'.hdr'}, 'Select analyze file');
0045         if ~isempty(dir)
0046             set(H.analyze_file_edit, 'String', [dir filesep fname{1}]);
0047         end
0048         pa_head_util(fig, 'update_output_fname');
0049     case {H.model_1shell_radiobutton, ...
0050           H.model_3shell_radiobutton }
0051         group = [H.model_1shell_radiobutton;
0052                  H.model_3shell_radiobutton];
0053         set(group, 'Value', 0);
0054         set(hObj, 'Value', 1);
0055         pa_head_util(fig, 'update_model_type');
0056         pa_head_util(fig, 'update_output_fname');
0057     case H.csf_source_popup
0058         pa_head_util(fig, 'update_csf_source');
0059         pa_head_util(fig, 'update_exec_push_status');
0060     case H.fs_csf_file_edit
0061         pa_head_util(fig, 'update_exec_push_status');
0062     case H.fs_csf_file_push
0063         [dir fname] = vb_file_select({'.asc'}, 'Select FreeSurfer surface file(inner skull)');
0064         if ~isempty(dir)
0065             set(H.fs_csf_file_edit, 'String', [dir filesep fname{1}]);
0066         end
0067         pa_head_util(fig, 'update_exec_push_status');
0068     case H.gray_file_edit
0069         pa_head_util(fig, 'update_exec_push_status');
0070     case H.gray_file_push
0071         [dir fname] = vb_file_select({'.hdr'}, 'Select SPM gray file');
0072         if ~isempty(dir)
0073             set(H.gray_file_edit, 'String', [dir filesep fname{1}]);
0074         end
0075         pa_head_util(fig, 'update_exec_push_status');
0076     case H.brain_file_edit
0077         pa_head_util(fig, 'update_exec_push_status');
0078     case H.brain_file_push
0079         proj_root = get(H.prjroot_edit, 'String');
0080         [dir fname canceled] = pa_prjfile_select(proj_root, {define.BRAIN_EXTENSION}, 'Select cortical model file');
0081         if ~canceled
0082             set(H.brain_file_edit, 'String', [dir filesep fname{1}]);
0083             pa_head_util(fig, 'update_exec_push_status');
0084         end
0085     case H.curry_file_edit
0086         pa_head_util(fig, 'update_exec_push_status');
0087     case H.curry_file_push
0088         [dir fname] = vb_file_select({'.*'}, 'Select Curry surface file');
0089         if ~isempty(dir)
0090             set(H.curry_file_edit, 'String', [dir filesep fname{1}]);
0091         end
0092         pa_head_util(fig, 'update_exec_push_status');
0093     case H.gray_morphology_edit
0094         pa_head_util(fig, 'update_exec_push_status');
0095     case H.curry_morphology_edit
0096         pa_head_util(fig, 'update_exec_push_status');
0097     case H.fs_morphology_edit
0098         pa_head_util(fig, 'update_exec_push_status');
0099     case H.skull_source_popup
0100         pa_head_util(fig, 'update_skull_source');
0101         pa_head_util(fig, 'update_exec_push_status');
0102     case H.fs_skull_file_edit
0103         pa_head_util(fig, 'update_exec_push_status');
0104     case H.fs_skull_file_push
0105         [dir fname] = vb_file_select({'.asc'}, 'Select FreeSurfer surface file(outer skull)');
0106         if ~isempty(dir)
0107             set(H.fs_skull_file_edit, 'String', [dir filesep fname{1}]);
0108         end
0109         pa_head_util(fig, 'update_exec_push_status');
0110     case H.min_skull_thickness_edit
0111         pa_head_util(fig, 'update_exec_push_status');
0112     case H.scalp_thickness_edit
0113         pa_head_util(fig, 'update_exec_push_status');
0114     case H.scalp_source_popup
0115         pa_head_util(fig, 'update_scalp_source');
0116         pa_head_util(fig, 'update_exec_push_status');
0117     case H.fs_scalp_file_edit
0118         pa_head_util(fig, 'update_exec_push_status');
0119     case H.fs_scalp_file_push
0120         [dir fname] = vb_file_select({'.asc'}, 'Select FreeSurfer surface file(outer skin)');
0121         if ~isempty(dir)
0122             set(H.fs_scalp_file_edit, 'String', [dir filesep fname{1}]);
0123         end
0124         pa_head_util(fig, 'update_exec_push_status');
0125     case H.face_file_edit
0126         pa_head_util(fig, 'update_exec_push_status');
0127     case H.face_file_push
0128         [dir fname] = vb_file_select({'.face.mat'}, 'Select Face surface file');
0129         if ~isempty(dir)
0130             set(H.face_file_edit, 'String', [dir filesep fname{1}]);
0131         end
0132         pa_head_util(fig, 'update_exec_push_status');
0133     case H.head_file_edit
0134         pa_head_util(fig, 'update_output_fname');
0135     case H.save_dir_edit
0136         pa_head_util(fig, 'update_output_fname');
0137     case H.save_dir_push
0138         proj_root = get(H.prjroot_edit, 'String');
0139         [dir canceled] = pa_prjdir_select(proj_root);
0140         if ~canceled
0141             set(H.save_dir_edit, 'String', dir);
0142         end
0143         pa_head_util(fig, 'update_output_fname');
0144     case H.reset_push
0145         pa_head_util(fig, 'reset_parameter');
0146     case H.exec_push
0147         pa_head_util(fig, 'exec_head');
0148     case H.view2d_push
0149         pa_head_util(fig, 'view2d');
0150     case H.view3d_push
0151         pa_head_util(fig, 'view3d');
0152 %     case H.head_parm_push
0153 %         if ishandle(data.adv_fig)
0154 %             figure(data.adv_fig);
0155 %         else
0156 %             data.adv_fig = pa_head_parm_gui_create(fig, data.head_parm);
0157 %         end
0158 end
0159 
0160 % save data
0161 guidata(fig, data);

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005