merge brain_parm which has brain gui has and inputted brain_parm fields. [USAGE] pa_brain_merge_parm(<fig> <,brain_parm>); [IN] fig : figure handle of brain parameter gui. merge_parm : To be merged brain_parm. Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function pa_brain_merge_parm(fig, merge_parm) 0002 % merge brain_parm which has brain gui has and inputted brain_parm fields. 0003 % [USAGE] 0004 % pa_brain_merge_parm(<fig> <,brain_parm>); 0005 % [IN] 0006 % fig : figure handle of brain parameter gui. 0007 % merge_parm : To be merged brain_parm. 0008 % 0009 % Copyright (C) 2011, ATR All Rights Reserved. 0010 % License : New BSD License(see VBMEG_LICENSE.txt) 0011 0012 % 0013 % --- Previous check 0014 % 0015 if ~exist('fig', 'var')|| isempty(fig) || ~ishandle(fig) 0016 error('invalid figure handle.'); 0017 end 0018 if ~exist('merge_parm', 'var') 0019 error('merge_parm is a required parameter.'); 0020 end 0021 0022 % 0023 % --- Main Procedure 0024 % 0025 0026 % load data 0027 data = guidata(fig); 0028 0029 parm_names = fieldnames(merge_parm); 0030 for k=1:length(parm_names) 0031 data.brain_parm.(parm_names{k}) = merge_parm.(parm_names{k}); 0032 end 0033 0034 % save data 0035 guidata(fig, data); 0036