Home > vbmeg > functions > gui > preAnalysis > leadfield > pa_leadfield_set_parm.m

pa_leadfield_set_parm

PURPOSE ^

This function sets parameters to leadfield GUI.

SYNOPSIS ^

function pa_leadfield_set_parm(fig, basis_parm)

DESCRIPTION ^

 This function sets parameters to leadfield GUI.
 [USAGE]
    pa_leadfield_set_parm(<fig> [,basis_parm]);
 [IN]
           fig : figure handle of leafield gui.
    basis_parm : to be set basis_parm [default:vb_set_basis_parm()]
 [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_leadfield_set_parm(fig, basis_parm)
0002 % This function sets parameters to leadfield GUI.
0003 % [USAGE]
0004 %    pa_leadfield_set_parm(<fig> [,basis_parm]);
0005 % [IN]
0006 %           fig : figure handle of leafield gui.
0007 %    basis_parm : to be set basis_parm [default:vb_set_basis_parm()]
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 handle.');
0019 end
0020 
0021 % default value
0022 if isempty(basis_parm)
0023     basis_parm = vb_set_basis_parm;
0024 end
0025 
0026 %
0027 % --- Main Procedure
0028 %
0029 
0030 % load data(@see pa_leadfield_create)
0031 data = guidata(fig);
0032 H = data.H; % component handles
0033 
0034 % BRAIN file
0035 set(H.brain_file_edit, 'String', basis_parm.brain_file);
0036 
0037 % AREA file
0038 set(H.area_file_edit, 'String', basis_parm.area_file);
0039 
0040 % MEG-MAT file
0041 set(H.megmat_file_edit, 'String', basis_parm.meg_file);
0042 
0043 % HEAD file
0044 set(H.head_file_edit, 'String', basis_parm.head_file);
0045 
0046 % BEM mode
0047 pa_leadfield_util(fig, 'set_bem_mode', basis_parm.bem_mode);
0048 
0049 % Center of the head
0050 if isfield(basis_parm, 'Vcenter')
0051     set(H.center_head_edit, 'String', num2str(basis_parm.Vcenter, 3));
0052 end
0053 
0054 % Conductivity
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 % Radius
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 % BASIS mode
0077 pa_leadfield_util(fig, 'set_basis_mode', basis_parm.Basis_mode);
0078 
0079 % normal mode
0080 pa_leadfield_util(fig, 'set_normal_mode', basis_parm.normal_mode);
0081 
0082 % Area key
0083 set(H.areakey_edit, 'String', basis_parm.area_key);
0084 
0085 %Save dir
0086 [save_dir] = vb_get_file_parts(basis_parm.basis_file);
0087 set(H.save_dir_edit, 'String', save_dir);
0088 
0089 % BASIS file(output)
0090 set(H.basis_file_edit, 'String', basis_parm.basis_file);
0091 
0092 % save data
0093 data.basis_parm = basis_parm;
0094 guidata(fig, data);
0095 
0096 % view update
0097 pa_leadfield_util(fig, 'update_exec_push_status');

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