0001 function pa_brain_set_parm(fig, brain_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(brain_parm)
0023 brain_parm = vb_set_brain_parm;
0024 end
0025
0026
0027
0028
0029
0030
0031 data = guidata(fig);
0032
0033 H = data.H;
0034
0035
0036 set(H.analyze_edit, 'String', brain_parm.analyze_file);
0037
0038
0039
0040
0041
0042 if isfield(brain_parm, 'BV_left_file') && ~isempty(brain_parm.BV_left_file);
0043 set(H.model_brainvoyager_radiobutton, 'Value', 1);
0044 set(H.left_edit, 'String', brain_parm.BV_left_file);
0045 else
0046 set(H.model_brainvoyager_radiobutton, 'Value', 0);
0047 end
0048
0049
0050 if isfield(brain_parm, 'BV_right_file')
0051 set(H.right_edit, 'String', brain_parm.BV_right_file);
0052 end
0053
0054
0055 if isfield(brain_parm, 'BV_left_infl_file');
0056 set(H.left_inflate_edit, 'String', brain_parm.BV_left_infl_file);
0057 end
0058
0059
0060 if isfield(brain_parm, 'BV_right_infl_file')
0061 set(H.right_inflate_edit, 'String', brain_parm.BV_right_infl_file);
0062 end
0063
0064
0065
0066
0067
0068 if isfield(brain_parm, 'FS_left_file') && ~isempty(brain_parm.FS_left_file)
0069 set(H.model_freesurfer_radiobutton, 'Value', 1);
0070 set(H.freesurfer_left_edit, 'String', brain_parm.FS_left_file);
0071 else
0072 set(H.model_freesurfer_radiobutton, 'Value', 0);
0073 end
0074
0075
0076 if isfield(brain_parm, 'FS_right_file')
0077 set(H.freesurfer_right_edit, 'String', brain_parm.FS_right_file);
0078 end
0079
0080
0081 if isfield(brain_parm, 'FS_left_infl_file')
0082 set(H.freesurfer_left_inflate_edit, 'String', brain_parm.FS_left_infl_file);
0083 end
0084
0085
0086 if isfield(brain_parm, 'FS_right_infl_file')
0087 set(H.freesurfer_right_inflate_edit, 'String', brain_parm.FS_right_infl_file);
0088 end
0089
0090
0091 if isfield(brain_parm, 'FS_left_curv_file')
0092 set(H.freesurfer_left_curv_edit, 'String', brain_parm.FS_left_curv_file);
0093 end
0094
0095
0096 if isfield(brain_parm, 'FS_right_curv_file')
0097 set(H.freesurfer_right_curv_edit, 'String', brain_parm.FS_right_curv_file);
0098 end
0099
0100
0101 if isfield(brain_parm, 'FS_left_label_file')
0102 set(H.freesurfer_left_label_edit, 'String', brain_parm.FS_left_label_file);
0103 end
0104
0105
0106 if isfield(brain_parm, 'FS_right_label_file')
0107 set(H.freesurfer_right_label_edit, 'String', brain_parm.FS_right_label_file);
0108 end
0109
0110
0111 if isfield(brain_parm, 'FS_left_sphere_file')
0112 set(H.freesurfer_left_sphere_edit, 'String', brain_parm.FS_left_sphere_file);
0113 end
0114
0115
0116 if isfield(brain_parm, 'FS_right_sphere_file')
0117 set(H.freesurfer_right_sphere_edit, 'String', brain_parm.FS_right_sphere_file);
0118 end
0119
0120
0121 if isfield(brain_parm, 'spm_normalization_file')
0122 set(H.spm_normalization_file_edit, 'String', brain_parm.spm_normalization_file);
0123 end
0124
0125
0126 [save_dir] = vb_get_file_parts(brain_parm.brain_file);
0127 set(H.save_dir_edit, 'String', save_dir);
0128
0129
0130 set(H.brain_file_edit, 'String', brain_parm.brain_file);
0131
0132
0133 set(H.area_file_edit, 'String', brain_parm.area_file);
0134
0135
0136 set(H.act_file_edit, 'String', brain_parm.act_file);
0137
0138
0139 if get(H.model_brainvoyager_radiobutton, 'Value') == 0 && ...
0140 get(H.model_freesurfer_radiobutton, 'Value') == 0
0141
0142 set(H.model_freesurfer_radiobutton, 'Value', 1);
0143 end
0144
0145
0146
0147 data.brain_parm = brain_parm;
0148 guidata(fig, data);
0149
0150
0151 pa_brain_util(fig, 'update_model_type');
0152 pa_brain_util(fig, 'update_output_fname');