0001 function pa_leadfield_set_parm(fig, basis_parm)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 if ~exist('fig', 'var') || isempty(fig) || ~ishandle(fig)
0018 error('invalid figure handle.');
0019 end
0020
0021
0022 if isempty(basis_parm)
0023 basis_parm = vb_set_basis_parm;
0024 end
0025
0026
0027
0028
0029
0030
0031 data = guidata(fig);
0032 H = data.H;
0033
0034
0035 set(H.brain_file_edit, 'String', basis_parm.brain_file);
0036
0037
0038 set(H.area_file_edit, 'String', basis_parm.area_file);
0039
0040
0041 set(H.megmat_file_edit, 'String', basis_parm.meg_file);
0042
0043
0044 set(H.head_file_edit, 'String', basis_parm.head_file);
0045
0046
0047 pa_leadfield_util(fig, 'set_bem_mode', basis_parm.bem_mode);
0048
0049
0050 if isfield(basis_parm, 'Vcenter')
0051 set(H.center_head_edit, 'String', num2str(basis_parm.Vcenter, 3));
0052 end
0053
0054
0055 conduct_str = '';
0056 Nlayer = length(basis_parm.sigma);
0057 for k=1:Nlayer
0058 conduct_str = [conduct_str, num2str(basis_parm.sigma(k)) ', '];
0059 if k == Nlayer
0060 conduct_str = conduct_str(1:(length(conduct_str)-2));
0061 end
0062 end
0063 set(H.conductivity_edit, 'String', conduct_str);
0064
0065
0066 radius_str = '';
0067 Nradius = length(basis_parm.radius);
0068 for k=1:Nradius
0069 radius_str = [radius_str, num2str(basis_parm.radius(k)), ', '];
0070 if k == Nradius
0071 radius_str = radius_str(1:(length(radius_str)-2));
0072 end
0073 end
0074 set(H.sphere_radius_edit, 'String', radius_str);
0075
0076
0077 pa_leadfield_util(fig, 'set_basis_mode', basis_parm.Basis_mode);
0078
0079
0080 pa_leadfield_util(fig, 'set_normal_mode', basis_parm.normal_mode);
0081
0082
0083 set(H.areakey_edit, 'String', basis_parm.area_key);
0084
0085
0086 [save_dir] = vb_get_file_parts(basis_parm.basis_file);
0087 set(H.save_dir_edit, 'String', save_dir);
0088
0089
0090 set(H.basis_file_edit, 'String', basis_parm.basis_file);
0091
0092
0093 data.basis_parm = basis_parm;
0094 guidata(fig, data);
0095
0096
0097 pa_leadfield_util(fig, 'update_exec_push_status');