Home > vbmeg > functions > gui > preAnalysis > brain > pa_brain_set_parm.m

pa_brain_set_parm

PURPOSE ^

This function sets parameters to brain GUI.

SYNOPSIS ^

function pa_brain_set_parm(fig, brain_parm)

DESCRIPTION ^

 This function sets parameters to brain GUI.
 [USAGE]
    pa_brain_set_parm(<fig> [,brain_parm]);
 [IN]
          fig : figure handle of brain gui.
    brain_parm: to be set brain_parm  [default:vb_set_brain_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_brain_set_parm(fig, brain_parm)
0002 % This function sets parameters to brain GUI.
0003 % [USAGE]
0004 %    pa_brain_set_parm(<fig> [,brain_parm]);
0005 % [IN]
0006 %          fig : figure handle of brain gui.
0007 %    brain_parm: to be set brain_parm  [default:vb_set_brain_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(brain_parm)
0023     brain_parm = vb_set_brain_parm;
0024 end
0025 
0026 %
0027 % --- Main Procedure
0028 %
0029 
0030 % load data(@see pa_brain_create)
0031 data = guidata(fig);
0032 
0033 H = data.H; % component handles
0034 
0035 % Analyze file
0036 set(H.analyze_edit, 'String', brain_parm.analyze_file);
0037 
0038 %
0039 % --- BrainVoyager files
0040 %
0041 % Left-brain file
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 % Right-brain file
0050 if isfield(brain_parm, 'BV_right_file')
0051     set(H.right_edit, 'String', brain_parm.BV_right_file);
0052 end
0053 
0054 % Left-inflate file
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 % Right-inflate file
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 % --- FreeSurfer files
0066 %
0067 % Left-brain file
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 % Right-brain file
0076 if isfield(brain_parm, 'FS_right_file')
0077     set(H.freesurfer_right_edit, 'String', brain_parm.FS_right_file);
0078 end
0079 
0080 % Left-inflate file
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 % Right-inflate file
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 % Left-curv file
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 % Right-curv file
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 % Left-label file
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 % Right-label file
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 % Left-sphere file
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 % Right-sphere file
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 % SPM normalization file
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 % Save dir
0126 [save_dir] = vb_get_file_parts(brain_parm.brain_file);
0127 set(H.save_dir_edit, 'String', save_dir);
0128 
0129 % BRAIN file
0130 set(H.brain_file_edit, 'String', brain_parm.brain_file);
0131 
0132 % AREA file
0133 set(H.area_file_edit, 'String', brain_parm.area_file);
0134 
0135 % Act file
0136 set(H.act_file_edit, 'String', brain_parm.act_file);
0137 
0138 % Default model
0139 if get(H.model_brainvoyager_radiobutton, 'Value') == 0 && ...
0140    get(H.model_freesurfer_radiobutton, 'Value') == 0
0141     % FreeSurfer
0142     set(H.model_freesurfer_radiobutton, 'Value', 1);
0143 end
0144 
0145 
0146 % save brain_parm
0147 data.brain_parm = brain_parm;
0148 guidata(fig, data);
0149 
0150 % view update
0151 pa_brain_util(fig, 'update_model_type');
0152 pa_brain_util(fig, 'update_output_fname');

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