Home > vbmeg > functions > job > job_plot_currentmap_dir > job_plot_currentmap.m

job_plot_currentmap

PURPOSE ^

Plot spatio-temporal pattern of estimated current.

SYNOPSIS ^

function job_plot_currentmap(brain_file,curr_file,ix_trial,area_file,act_file,filedlg_mode)

DESCRIPTION ^

 Plot spatio-temporal pattern of estimated current.

 [syntax]
 job_plot_currentmap(brain_file,curr_file,ix_trial,area_file,act_file,filedlg_mode)

 [input]
 brain_file  : <optional> <<string>> Cortical surface model file
               (.brain.mat).
 curr_file   : <optional> <<string>> Cortical current file (.curr.mat) or
               time-frequency file (.tf.mat; not supported yet). 
 ix_trial    : <optional> <<int>> Trial index of the current data. If this
               parameter is empty, average current data will be loaded. 
 area_file   : <optional> <<string>> Cortical area file (.area.mat).
 act_file    : <optional> <<string>> Cortical activity file (.act.mat).
 filedlg_mode: <optional> <<int>> See job_plot_cmap_setting_dlg (default=1).

 [example]
 job_plot_currentmap('./sbj_dir/brain/3D.brain.mat', ...
                     './sbj_dir/result/result1.curr.mat',12, ...
                     './sbj_dir/brain/3D.area.mat', ...
                     './sbj_dir/brain/3D.act.mat')

 [note for developers]
 Plotting mode (current/time-freq) is determined as follows: 
  If Jact of plotcmap{n} is not empty, plotting mode is 'current'. If
  Jact is empty and data of plotcmap{n} is not empty, plotting mode is
  'time-freq'. Otherwise, plotting mode is not defined. 

 Fields of vbmeg_inst.plotcmap{n} are as follows:
 ---
  (cortical surface model variables)
  brain_file: Cortical surface model file.
  model     : Indicating original or inflated display. 
  V         : Vertex coordinate values for cortical surface model. 
  Vinf      : Vertex coordinate values for inflated surface model. 
  F         : Face indices. 
  inf_C     : Face color for inflated model. 
  xxA       : Cortical area size (assigned for vertices, not faces). 
  Vtal      : Talairach brain coordinate values. 
  nextDD    : Distance to the neighbouring vertices. 
  nextIX    : Indices of the neighbouring vertices.

  (cortical current variables)
  curr_file: Cortical current file. 
  Jact     : J-current matrix. Cortical current data is always loaded as
             J-current (@see job_plot_cmap_load_current). 
  Jmax     : Maximum amplitude in Jact. This is set when loadging
             cortical current data (@see job_plot_cmap_load_current). 
  Jmax_plot: Maximum threshold of current for display. 
  Jmin_plot: Minimum threshold of current for display. 
  ix_trial : Trial index
  ave_mode : current average mode
  toi      : Time of interest (selected time window). 
  foi      : Frequency of interest (ignored).
  Jinfo    : Current information accessed by vb_load_current_info.

  (time-frequency variables)
  tffile    : Time-frequency file. 
  data      : Time-frequency data. 
  TFmax     : Maximum amplitude in data. This is set when loading
             time-frequency data (@see job_plot_cmap_load_current). 
  TFmin     : Minimum value in data. This variable is used to judge tf
              value is always positive or not. 
  TFmax_plot: Maximum threshold of TFdata for display.
  TFmax_plot: Minimum threshold of TFdata for display.
  ix_trial  : Trial index (ignored). 
  toi       : Time of interest (selected time window).
  foi       : Frequency of interest (selected frequency window).
  TFinfo    : Time-frequency data information. 

  (activity map variables)
  act_file  : Activity map file currently loaded.
  xxP       : Activity map to be shown.

  (cortical area variables)
  area_file : Cortical area file currently loaded.
  area_key  : ID of cortical area to be shown. 
 
  (plotting parameters)
  plot_parm: Structure of plot parameters.
  ix_peak  : Index of selected vertex.
  J_hold   : Switch of hold mode for displaying timecourses. 
  W        : Smoothing matrix used for timecourse plot.

  (obsolete variables in 0.9-0.a.0 or later)
  Jbck      : Background current, for compatibility with older versions. 
  ix_act    : Vertex indices for J-current. -> ix_act in Jinfo.
  ix_bck    : Indices of background vertices.
  Tstart    : 
  T         : Actual time. -> Tmsec in Jinfo or TFinfo.
  t         : Selected time window -> toi. 
  patch_norm: Flag of patch normalization -> patch_norm in Jinfo.
 ---

 [history]
 2007-01-30 Taku Yoshioka
 2007-03-13 Taku Yoshioka
 2008-09-29 Taku Yoshioka
 2008-12-16 Taku Yoshioka
  Current map threshold is replaced by actual amplitude. 
 2010-12-01 taku-y
  [internal change] 'Jinfo' replaces 'MEGinfo'. 
 2010-12-11 taku-y
  [enhancement] Time-frequency data supported. 
 2011-01-28 taku-y
  [enhancement] Activity map plot supported. 
 2011-02-16 taku-y
  [enhancement] Cortical area plot supported. 
  [enhancement] Show area list including selected vertex. 
 2011-03-14 taku-y
  [debug] Automatic update of camera position when pressing viewpoint
  buttons on GUI ('Left', 'Right', etc.). 
 2011-04-01 taku-y
  [debug] Make '>/>>' buttons available. 
 2012-01-26 sako
  [minor change] n_trial -> "n_trial" was replaced to "ix_trial"
 2012-02-17 taku-y
  [major] File menu was replaced with a new dialog. 
 2012-02-28 taku-y
  [minor] File dialog was modified to recognize input arguments as
  default value of the file names and trial index. 
 2012-08-31 taku-y
  [minor] Added file dialog mode (filedlg_mode) to make cortical current
  file be optional in the dialog. 

 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:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function job_plot_currentmap(brain_file,curr_file,ix_trial,area_file,act_file,filedlg_mode)
0002 % Plot spatio-temporal pattern of estimated current.
0003 %
0004 % [syntax]
0005 % job_plot_currentmap(brain_file,curr_file,ix_trial,area_file,act_file,filedlg_mode)
0006 %
0007 % [input]
0008 % brain_file  : <optional> <<string>> Cortical surface model file
0009 %               (.brain.mat).
0010 % curr_file   : <optional> <<string>> Cortical current file (.curr.mat) or
0011 %               time-frequency file (.tf.mat; not supported yet).
0012 % ix_trial    : <optional> <<int>> Trial index of the current data. If this
0013 %               parameter is empty, average current data will be loaded.
0014 % area_file   : <optional> <<string>> Cortical area file (.area.mat).
0015 % act_file    : <optional> <<string>> Cortical activity file (.act.mat).
0016 % filedlg_mode: <optional> <<int>> See job_plot_cmap_setting_dlg (default=1).
0017 %
0018 % [example]
0019 % job_plot_currentmap('./sbj_dir/brain/3D.brain.mat', ...
0020 %                     './sbj_dir/result/result1.curr.mat',12, ...
0021 %                     './sbj_dir/brain/3D.area.mat', ...
0022 %                     './sbj_dir/brain/3D.act.mat')
0023 %
0024 % [note for developers]
0025 % Plotting mode (current/time-freq) is determined as follows:
0026 %  If Jact of plotcmap{n} is not empty, plotting mode is 'current'. If
0027 %  Jact is empty and data of plotcmap{n} is not empty, plotting mode is
0028 %  'time-freq'. Otherwise, plotting mode is not defined.
0029 %
0030 % Fields of vbmeg_inst.plotcmap{n} are as follows:
0031 % ---
0032 %  (cortical surface model variables)
0033 %  brain_file: Cortical surface model file.
0034 %  model     : Indicating original or inflated display.
0035 %  V         : Vertex coordinate values for cortical surface model.
0036 %  Vinf      : Vertex coordinate values for inflated surface model.
0037 %  F         : Face indices.
0038 %  inf_C     : Face color for inflated model.
0039 %  xxA       : Cortical area size (assigned for vertices, not faces).
0040 %  Vtal      : Talairach brain coordinate values.
0041 %  nextDD    : Distance to the neighbouring vertices.
0042 %  nextIX    : Indices of the neighbouring vertices.
0043 %
0044 %  (cortical current variables)
0045 %  curr_file: Cortical current file.
0046 %  Jact     : J-current matrix. Cortical current data is always loaded as
0047 %             J-current (@see job_plot_cmap_load_current).
0048 %  Jmax     : Maximum amplitude in Jact. This is set when loadging
0049 %             cortical current data (@see job_plot_cmap_load_current).
0050 %  Jmax_plot: Maximum threshold of current for display.
0051 %  Jmin_plot: Minimum threshold of current for display.
0052 %  ix_trial : Trial index
0053 %  ave_mode : current average mode
0054 %  toi      : Time of interest (selected time window).
0055 %  foi      : Frequency of interest (ignored).
0056 %  Jinfo    : Current information accessed by vb_load_current_info.
0057 %
0058 %  (time-frequency variables)
0059 %  tffile    : Time-frequency file.
0060 %  data      : Time-frequency data.
0061 %  TFmax     : Maximum amplitude in data. This is set when loading
0062 %             time-frequency data (@see job_plot_cmap_load_current).
0063 %  TFmin     : Minimum value in data. This variable is used to judge tf
0064 %              value is always positive or not.
0065 %  TFmax_plot: Maximum threshold of TFdata for display.
0066 %  TFmax_plot: Minimum threshold of TFdata for display.
0067 %  ix_trial  : Trial index (ignored).
0068 %  toi       : Time of interest (selected time window).
0069 %  foi       : Frequency of interest (selected frequency window).
0070 %  TFinfo    : Time-frequency data information.
0071 %
0072 %  (activity map variables)
0073 %  act_file  : Activity map file currently loaded.
0074 %  xxP       : Activity map to be shown.
0075 %
0076 %  (cortical area variables)
0077 %  area_file : Cortical area file currently loaded.
0078 %  area_key  : ID of cortical area to be shown.
0079 %
0080 %  (plotting parameters)
0081 %  plot_parm: Structure of plot parameters.
0082 %  ix_peak  : Index of selected vertex.
0083 %  J_hold   : Switch of hold mode for displaying timecourses.
0084 %  W        : Smoothing matrix used for timecourse plot.
0085 %
0086 %  (obsolete variables in 0.9-0.a.0 or later)
0087 %  Jbck      : Background current, for compatibility with older versions.
0088 %  ix_act    : Vertex indices for J-current. -> ix_act in Jinfo.
0089 %  ix_bck    : Indices of background vertices.
0090 %  Tstart    :
0091 %  T         : Actual time. -> Tmsec in Jinfo or TFinfo.
0092 %  t         : Selected time window -> toi.
0093 %  patch_norm: Flag of patch normalization -> patch_norm in Jinfo.
0094 % ---
0095 %
0096 % [history]
0097 % 2007-01-30 Taku Yoshioka
0098 % 2007-03-13 Taku Yoshioka
0099 % 2008-09-29 Taku Yoshioka
0100 % 2008-12-16 Taku Yoshioka
0101 %  Current map threshold is replaced by actual amplitude.
0102 % 2010-12-01 taku-y
0103 %  [internal change] 'Jinfo' replaces 'MEGinfo'.
0104 % 2010-12-11 taku-y
0105 %  [enhancement] Time-frequency data supported.
0106 % 2011-01-28 taku-y
0107 %  [enhancement] Activity map plot supported.
0108 % 2011-02-16 taku-y
0109 %  [enhancement] Cortical area plot supported.
0110 %  [enhancement] Show area list including selected vertex.
0111 % 2011-03-14 taku-y
0112 %  [debug] Automatic update of camera position when pressing viewpoint
0113 %  buttons on GUI ('Left', 'Right', etc.).
0114 % 2011-04-01 taku-y
0115 %  [debug] Make '>/>>' buttons available.
0116 % 2012-01-26 sako
0117 %  [minor change] n_trial -> "n_trial" was replaced to "ix_trial"
0118 % 2012-02-17 taku-y
0119 %  [major] File menu was replaced with a new dialog.
0120 % 2012-02-28 taku-y
0121 %  [minor] File dialog was modified to recognize input arguments as
0122 %  default value of the file names and trial index.
0123 % 2012-08-31 taku-y
0124 %  [minor] Added file dialog mode (filedlg_mode) to make cortical current
0125 %  file be optional in the dialog.
0126 %
0127 % Copyright (C) 2011, ATR All Rights Reserved.
0128 % License : New BSD License(see VBMEG_LICENSE.txt)
0129 
0130 % --- Check input parameters
0131 if nargin<6                    , filedlg_mode = 0; end
0132 if nargin<5                    , act_file   = '' ; end
0133 if nargin<4                    , area_file  = '' ; end
0134 if nargin<3 | isempty(ix_trial), ix_trial   = 1  ; end
0135 if nargin<2                    , curr_file  = '' ; end
0136 if nargin<1                    , brain_file = '' ; end
0137 
0138 inst_id = create_instance;
0139 if isempty(inst_id), return; end
0140 
0141 % --- check model
0142 if ~exist('model', 'var'), model =0; end % Inflated model
0143 if model ~= 0, model = 1; end            % original model
0144 
0145 % --- Create GUI and update plots
0146 create_GUI(inst_id,brain_file,curr_file,ix_trial,area_file,act_file, ...
0147            model,filedlg_mode);
0148 job_plot_cmap_update_filterradius(inst_id);
0149 job_plot_cmap_update_timecourse(inst_id); 
0150 job_plot_cmap_update_spatialpattern(inst_id);
0151 
0152 return;
0153 
0154 % --- Inner function: create instance of GUI
0155 function inst_id = create_instance
0156 
0157 global vbmeg_inst
0158 
0159 if isfield(vbmeg_inst,'plotcmap'),
0160   for inst_id=1:vbmeg_inst.const.PLOTCMAP_MAX
0161     if isempty(vbmeg_inst.plotcmap{inst_id}), return; end;
0162   end
0163   vb_disp(['The number of instances of ''job_plot_currentmap''' ...
0164        ' GUIs reaches the maximum number.']);
0165   inst_id = [];
0166 elseif isfield(vbmeg_inst,'const'), 
0167   vbmeg_inst.plotcmap = cell(vbmeg_inst.const.PLOTCMAP_MAX,1);
0168   inst_id = 1;
0169 else
0170   vb_disp(['''vbmeg_inst'' was not correct. You have to invoke' ...
0171        '''vbmeg'' to create an instance of VBMEG.']); 
0172   inst_id = []; 
0173 end
0174 
0175 return;
0176 
0177 % --- Inner function: create GUI
0178 function create_GUI(inst_id,brain_file,curr_file,ix_trial,area_file, ...
0179                     act_file,model,filedlg_mode)
0180 
0181 global vbmeg_inst;
0182 
0183 % --- Initialize parameters
0184 % Cortical surface model variables
0185 plotcmap.brain_file = '';
0186 plotcmap.V      = [];
0187 plotcmap.Vinf   = [];
0188 plotcmap.F      = [];
0189 plotcmap.inf_C  = [];
0190 plotcmap.xxA    = [];
0191 plotcmap.Vtal   = [];
0192 plotcmap.nextDD = [];
0193 plotcmap.nextIX = [];
0194 
0195 % Cortical current variables
0196 Jmin_plot = 0;
0197 Jmax_plot = 1;
0198 plotcmap.curr_file = '';
0199 plotcmap.Jact      = [];
0200 plotcmap.Jmax      = [];
0201 plotcmap.Jmin      = [];
0202 plotcmap.Jmax_plot = Jmax_plot;
0203 plotcmap.Jmin_plot = Jmin_plot;
0204 plotcmap.ix_trial  = 1;
0205 plotcmap.ave_mode  = true;
0206 plotcmap.toi       = [];
0207 plotcmap.foi       = [];
0208 plotcmap.Jinfo     = [];
0209 
0210 % Time-frequency variables
0211 plotcmap.tf_file    = '';
0212 plotcmap.data       = [];
0213 plotcmap.TFinfo     = [];
0214 plotcmap.TFmax      = [];
0215 plotcmap.TFmin      = [];
0216 plotcmap.TFmin_plot = 0;
0217 plotcmap.TFmax_plot = 1;
0218 
0219 % Activity map variables
0220 plotcmap.act_file = '';
0221 plotcmap.xxP      = [];
0222 
0223 % Cortical area variables
0224 plotcmap.area_file = '';
0225 plotcmap.area_key  = [];
0226 
0227 % Plotting parameters
0228 plotcmap.plot_parm = vb_set_plot_parm;
0229 plotcmap.plot_parm.index = [];
0230 plotcmap.plot_parm.LRflag = 'LR';
0231 plotcmap.ix_peak = 1;
0232 plotcmap.J_hold = [];
0233 % plotcmap.ix_selected_area = [];
0234 
0235 % file dialog parameters
0236 plotcmap.filedlg_mode = filedlg_mode;
0237 
0238 % Obsolete variables in 0.9-0.a.0 or later
0239 plotcmap.Jbck       = [];
0240 plotcmap.ix_act     = [];
0241 plotcmap.ix_bck     = [];
0242 plotcmap.Tstart     = [];
0243 plotcmap.T          = [];
0244 plotcmap.t          = []; 
0245 plotcmap.patch_norm = [];
0246 
0247 % --- Open GUI
0248 h_fig = open('job_plot_cmap.fig');
0249 set(h_fig,'HandleVisibility','on');
0250 set(h_fig,'Pointer','watch');
0251 drawnow; 
0252 
0253 % input parameter
0254 plotcmap.model_type = model;
0255 
0256 % --- handles of GUI components
0257 plotcmap.h_fig     = h_fig;
0258 plotcmap.h_time    = get_child_handle(h_fig,'plot_time');
0259 plotcmap.h_space   = get_child_handle(h_fig,'plot_brain');
0260 plotcmap.h_cbar    = get_child_handle(h_fig,'colorbar');
0261 plotcmap.h_cbar_tf = get_child_handle(h_fig,'colorbar_tf');
0262 plotcmap.ed1 = get_child_handle(h_fig,'trial_number');
0263 plotcmap.ed2 = get_child_handle(h_fig,'time_window_start');
0264 plotcmap.ed3 = get_child_handle(h_fig,'time_window_end');
0265 plotcmap.ed4 = get_child_handle(h_fig,'ix_peak');
0266 plotcmap.ed5 = get_child_handle(h_fig,'spatial_peak_size');
0267 plotcmap.ed6 = get_child_handle(h_fig,'tal_coord');
0268 plotcmap.ed7 = get_child_handle(h_fig,'temporal_peak_size');
0269 plotcmap.ed8 = get_child_handle(h_fig,'freq_window_min');
0270 plotcmap.ed9 = get_child_handle(h_fig,'freq_window_max');
0271 plotcmap.ed10 = get_child_handle(h_fig,'Jmax_tf_plot_edit');
0272 plotcmap.pb1 = get_child_handle(get_child_handle(h_fig,'save_menu'), ...
0273                                 'spatial_pattern_menu');
0274 plotcmap.pb2 = get_child_handle(get_child_handle(h_fig,'save_menu'), ...
0275                                 'temporal_pattern_menu');
0276 plotcmap.pb3 = get_child_handle(h_fig,'rotate');
0277 plotcmap.pb4 = get_child_handle(h_fig,'move_forward');
0278 plotcmap.pb5 = get_child_handle(h_fig,'move_forward_fast');
0279 plotcmap.pb6 = get_child_handle(h_fig,'move_back');
0280 plotcmap.pb7 = get_child_handle(h_fig,'move_back_fast');
0281 plotcmap.pb8 = get_child_handle(h_fig,'search_spatial_peak');
0282 plotcmap.pb9 = get_child_handle(h_fig,'search_temporal_peak');
0283 plotcmap.pb10 = get_child_handle(get_child_handle(h_fig, 'save_menu'), ...
0284                                  'cortical_activity_map_menu');
0285 plotcmap.pb12 = get_child_handle(get_child_handle(h_fig, 'save_menu'), ...
0286                                  'cortical_area_menu');
0287 plotcmap.pb13 = get_child_handle(h_fig,'left_button');
0288 plotcmap.pb14 = get_child_handle(h_fig,'right_button');
0289 plotcmap.pb15 = get_child_handle(h_fig,'top_button');
0290 plotcmap.pb16 = get_child_handle(h_fig,'bottom_button');
0291 plotcmap.pb17 = get_child_handle(h_fig,'front_button');
0292 plotcmap.pb18 = get_child_handle(h_fig,'back_button');
0293 plotcmap.rb1 = get_child_handle(h_fig,'talairach');
0294 plotcmap.rb2 = get_child_handle(h_fig,'mni');
0295 plotcmap.cb1 = get_child_handle(h_fig,'fix_colorbar');
0296 plotcmap.cb2 = get_child_handle(h_fig,'left_brain');
0297 plotcmap.cb3 = get_child_handle(h_fig,'right_brain');
0298 plotcmap.cb4 = get_child_handle(h_fig,'hold_on');
0299 plotcmap.cb5 = get_child_handle(h_fig,'show_roi');
0300 plotcmap.cb6 = get_child_handle(h_fig,'fix_colorbar_tf');
0301 plotcmap.cb7 = get_child_handle(h_fig,'show_act_map');
0302 plotcmap.cb8 = get_child_handle(h_fig,'show_cortical_area');
0303 plotcmap.lb1 = get_child_handle(h_fig,'act_key_list');
0304 plotcmap.lb2 = get_child_handle(h_fig,'area_key_list');
0305 plotcmap.lb3 = get_child_handle(h_fig,'cortical_area');
0306 plotcmap.Jmin_plot_edit = get_child_handle(h_fig, 'Jmin_plot_edit');
0307 plotcmap.Jmax_plot_edit = get_child_handle(h_fig, 'Jmax_plot_edit');
0308 plotcmap.model_type_original_rb ...
0309     = get_child_handle(h_fig,'model_type_original_rb');
0310 plotcmap.model_type_inflate_rb ...
0311     = get_child_handle(h_fig,'model_type_inflate_rb');
0312 plotcmap.load_data_menu ...
0313     = get_child_handle(get_child_handle(h_fig,'file_menu'), ...
0314                        'load_data_menu');
0315 plotcmap.loaded_files_menu ...
0316     = get_child_handle(get_child_handle(h_fig,'file_menu'), ...
0317                        'loaded_files_menu');
0318 plotcmap.close_menu ...
0319     = get_child_handle(get_child_handle(h_fig,'file_menu'), ...
0320                        'close_menu');
0321 
0322 plotcmap.h_rotate  = rotate3d(h_fig); % to control camlight
0323 
0324 % Set GUI values
0325 set(plotcmap.ed1,'String','1');
0326 set(plotcmap.ed1,'Enable','off')
0327 
0328 % --- callback functions
0329 inst_str = num2str(inst_id); 
0330 plotcmap_str = ['vbmeg_inst.plotcmap{' inst_str '}'];
0331 
0332 % Remove instance after window close
0333 command = ['global vbmeg_inst; '...
0334        'vbmeg_inst.plotcmap{' inst_str '}=[];'];
0335 set(h_fig,'DeleteFcn',command);
0336 
0337 % Zoom button
0338 command = ['job_plot_cmap_push_zoom_button(' inst_str ');']; 
0339 set(plotcmap.pb3,'Callback',command);
0340 if vb_matlab_version('>=', '7.6')
0341   set(plotcmap.pb3, 'Visible', 'off');
0342 end
0343 
0344 % Rotation of cortex model
0345 if vb_matlab_version('>=', '7.3');
0346     set(plotcmap.h_rotate, 'ActionPostCallback', @after_rotate_callback);
0347 end
0348 
0349 % Trial number
0350 command = ['job_plot_cmap_change_trial(' inst_str ');'];
0351 set(plotcmap.ed1,'Callback',command);
0352 
0353 % Time window
0354 command = ['global vbmeg_inst; ' ...
0355        plotcmap_str '.toi(1)=' ...
0356        'str2num(get(' plotcmap_str '.ed2,''String''));' ...
0357        'job_plot_cmap_update_timecourse(' inst_str ');' ...
0358        'job_plot_cmap_update_spatialpattern(' inst_str ');'];
0359 set(plotcmap.ed2,'Callback',command);
0360 command = ['global vbmeg_inst; ' ...
0361        plotcmap_str '.toi(2)=' ...
0362        'str2num(get(' plotcmap_str '.ed3,''String''));' ...
0363        'job_plot_cmap_update_timecourse(' inst_str ');' ...
0364        'job_plot_cmap_update_spatialpattern(' inst_str ');'];
0365 set(plotcmap.ed3,'Callback',command);
0366 
0367 % Frequency window
0368 command = ['global vbmeg_inst; ' ...
0369        plotcmap_str '.foi(1)=' ...
0370        'str2num(get(' plotcmap_str '.ed8,''String''));' ...
0371        'job_plot_cmap_update_timecourse(' inst_str ');' ...
0372        'job_plot_cmap_update_spatialpattern(' inst_str ');'];
0373 set(plotcmap.ed8,'Callback',command);
0374 command = ['global vbmeg_inst; ' ...
0375        plotcmap_str '.foi(2)=' ...
0376        'str2num(get(' plotcmap_str '.ed9,''String''));' ...
0377        'job_plot_cmap_update_timecourse(' inst_str ');' ...
0378        'job_plot_cmap_update_spatialpattern(' inst_str ');'];
0379 set(plotcmap.ed9,'Callback',command);
0380 
0381 % Time window shift
0382 command = ['global vbmeg_inst; '...
0383        'dt = ' plotcmap_str '.toi(2)-' plotcmap_str '.toi(1);' ...
0384        plotcmap_str '.toi=' plotcmap_str '.toi+dt;' ...
0385        'job_plot_cmap_update_timecourse(' inst_str ');' ...
0386        'job_plot_cmap_update_spatialpattern(' inst_str ');'];
0387 set(plotcmap.pb4,'Callback',command);
0388 command = ['global vbmeg_inst; '...
0389        'dt = ' plotcmap_str '.toi(2)-' plotcmap_str '.toi(1);' ...
0390        plotcmap_str '.toi=' plotcmap_str '.toi+5*dt;' ...
0391        'job_plot_cmap_update_timecourse(' inst_str ');' ...
0392        'job_plot_cmap_update_spatialpattern(' inst_str ');'];
0393 set(plotcmap.pb5,'Callback',command);
0394 command = ['global vbmeg_inst; '...
0395        'dt = ' plotcmap_str '.toi(2)-' plotcmap_str '.toi(1);' ...
0396        plotcmap_str '.toi=' plotcmap_str '.toi-dt;' ...
0397        'job_plot_cmap_update_timecourse(' inst_str ');' ...
0398        'job_plot_cmap_update_spatialpattern(' inst_str ');'];
0399 set(plotcmap.pb6,'Callback',command);
0400 command = ['global vbmeg_inst; '...
0401        'dt = ' plotcmap_str '.toi(2)-' plotcmap_str '.toi(1);' ...
0402        plotcmap_str '.toi=' plotcmap_str '.toi-5*dt;' ...
0403        'job_plot_cmap_update_timecourse(' inst_str ');' ...
0404        'job_plot_cmap_update_spatialpattern(' inst_str ');'];
0405 set(plotcmap.pb7,'Callback',command);
0406 
0407 % Search peak
0408 command = ['job_plot_cmap_spatial_peak(' inst_str ');'];
0409 set(plotcmap.pb8,'Callback',command);
0410 command = ['job_plot_cmap_temporal_peak(' inst_str ');'];
0411 set(plotcmap.pb9,'Callback',command);
0412 
0413 % Jmax_plot_edit and Jmin_plot_edit
0414 command = ['job_plot_cmap_change_Jplot(' inst_str ');'];
0415 set(plotcmap.Jmin_plot_edit,'Callback',command);
0416 set(plotcmap.Jmax_plot_edit,'Callback',command);
0417 set(plotcmap.Jmin_plot_edit,'String','');
0418 set(plotcmap.Jmax_plot_edit,'String','');
0419 
0420 % Jmax_tf_plot_edit
0421 command = ['job_plot_cmap_change_Jplot_tf(' inst_str ');'];
0422 set(plotcmap.ed10,'Callback',command);
0423 set(plotcmap.ed10,'String','');
0424 
0425 % Print figure
0426 command = ['job_plot_cmap_print_spatialpattern(' inst_str ');'];
0427 set(plotcmap.pb1,'Callback',command);
0428 command = ['job_plot_cmap_print_temporalpattern(' inst_str ');'];
0429 set(plotcmap.pb2,'Callback',command);
0430 
0431 % Change vertex
0432 command = ['global vbmeg_inst;' ...
0433        plotcmap_str '.ix_peak = ' ...
0434        'str2num(get(' plotcmap_str '.ed4,''String''));' ...
0435        'job_plot_cmap_update_timecourse(' inst_str ');' ...
0436        'job_plot_cmap_update_spatialpattern(' inst_str ');'];
0437 set(plotcmap.ed4,'Callback',command);
0438 
0439 % Change standard brain coordinate
0440 command = ['global vbmeg_inst;' ...
0441        'job_plot_cmap_change_talcoord(' inst_str ');'];
0442 set(plotcmap.ed6,'Callback',command);
0443 
0444 % Change filter radius
0445 command = ['job_plot_cmap_update_filterradius(' inst_str ');' ...
0446            'job_plot_cmap_update_spatialpattern(' inst_str ');' ...
0447        'job_plot_cmap_update_timecourse(' inst_str ');'];
0448 set(plotcmap.ed5,'Callback',command);
0449 
0450 % Store activity map
0451 command = ['job_plot_cmap_register_activity(' inst_str ');'];
0452 set(plotcmap.pb10,'Callback',command);
0453 
0454 % Store area
0455 command = ['job_plot_cmap_register_area(' inst_str ');'];
0456 set(plotcmap.pb12,'Callback',command);
0457 
0458 % Radio button check
0459 command = ['job_plot_cmap_change_rb1(' inst_str ');'];
0460 set(plotcmap.rb1,'Callback',command);
0461 command = ['job_plot_cmap_change_rb2(' inst_str ');'];
0462 set(plotcmap.rb2,'Callback',command);
0463 
0464 % Hold on
0465 command = ['job_plot_cmap_holdon(' inst_str ');'];
0466 set(plotcmap.cb4,'Callback',command);
0467 
0468 % Show ROI
0469 command = ['job_plot_cmap_show_roi(' inst_str ');'];
0470 set(plotcmap.cb5,'Callback',command);
0471 
0472 % Fix colorbar
0473 command = ['job_plot_cmap_update_colorbarscale(' inst_str ');'];
0474 set(plotcmap.cb1,'Callback',command);
0475 set(plotcmap.cb6,'Callback',command);
0476 
0477 % Left/Right brain
0478 command = ['job_plot_cmap_update_spatialpattern(' inst_str ');'];
0479 set(plotcmap.cb2,'Callback',command);
0480 set(plotcmap.cb3,'Callback',command);
0481 
0482 % Show activity map
0483 command = ['job_plot_cmap_update_colorbarscale(' inst_str ');' ...
0484            'job_plot_cmap_update_spatialpattern(' inst_str ');'];
0485 set(plotcmap.cb7,'Callback',command);
0486 
0487 % Show cortical area
0488 %command = ['job_plot_cmap_update_colorbarscale(' inst_str ');' ...
0489 %           'job_plot_cmap_update_spatialpattern(' inst_str ');'];
0490 command = ['job_plot_cmap_update_spatialpattern(' inst_str ');'];
0491 set(plotcmap.cb8,'Callback',command);
0492 
0493 % Select activity map
0494 command = ['global vbmeg_inst; '...
0495            'job_plot_cmap_update_xxP(' inst_str ');' ...
0496            'job_plot_cmap_update_colorbarscale(' inst_str ');' ...
0497            'job_plot_cmap_update_spatialpattern(' inst_str ');'];
0498 set(plotcmap.lb1,'Callback',command);
0499 
0500 % Select cortical area
0501 command = ['global vbmeg_inst; '...
0502            'job_plot_cmap_update_area(' inst_str ');' ...
0503            'job_plot_cmap_update_spatialpattern(' inst_str ');'];
0504 set(plotcmap.lb2,'Callback',command);
0505 
0506 % Model type
0507 model_type_group = [plotcmap.model_type_inflate_rb,
0508                     plotcmap.model_type_original_rb];
0509 command = ['job_plot_cmap_change_modeltype(' inst_str ');'];
0510 set(model_type_group, 'Callback', command);
0511 set(model_type_group, 'Value', 0); % both off
0512 if model == 0
0513     set(plotcmap.model_type_inflate_rb, 'Value', 1);
0514 else
0515     set(plotcmap.model_type_original_rb, 'Value', 1);
0516 end
0517 
0518 % % Cancel
0519 % set(h_fig,'WindowButtonUpFcn','rotate3d off;');
0520 
0521 % Load data
0522 command = ['job_plot_cmap_load_data(' inst_str ');'];
0523 set(plotcmap.load_data_menu, 'Callback', command);
0524 
0525 % Show loaded files
0526 command = ['job_plot_cmap_show_loaded_files(' inst_str ');']; 
0527 set(plotcmap.loaded_files_menu, 'Callback', command);
0528 
0529 % Close window
0530 command = 'close;';
0531 set(plotcmap.close_menu,'Callback',command);
0532 
0533 % Angle
0534 command = ['job_plot_cmap_change_angle(' inst_str ',''left'');' ...
0535            'job_plot_cmap_update_camera(' inst_str ');'];
0536 set(plotcmap.pb13,'Callback',command);
0537 command = ['job_plot_cmap_change_angle(' inst_str ',''right'');' ...
0538            'job_plot_cmap_update_camera(' inst_str ');'];
0539 set(plotcmap.pb14,'Callback',command);
0540 command = ['job_plot_cmap_change_angle(' inst_str ',''top'');' ...
0541            'job_plot_cmap_update_camera(' inst_str ');'];
0542 set(plotcmap.pb15,'Callback',command);
0543 command = ['job_plot_cmap_change_angle(' inst_str ',''bottom'');' ...
0544            'job_plot_cmap_update_camera(' inst_str ');'];
0545 set(plotcmap.pb16,'Callback',command);
0546 command = ['job_plot_cmap_change_angle(' inst_str ',''front'');' ...
0547            'job_plot_cmap_update_camera(' inst_str ');'];
0548 set(plotcmap.pb17,'Callback',command);
0549 command = ['job_plot_cmap_change_angle(' inst_str ',''back'');' ...
0550            'job_plot_cmap_update_camera(' inst_str ');'];
0551 set(plotcmap.pb18,'Callback',command);
0552 
0553 % --- properties of axis for cortex plot
0554 set(h_fig,'Renderer','zbuffer');
0555 set(h_fig,'CurrentAxes',plotcmap.h_space);
0556 axis off;
0557 %axis tight; % 2006/11/22 hayashi delete
0558 %axis equal; % These commands causes axes LimMode change(auto-->manual)
0559              % after MATLAB 7.0.1. and brain model is not displayed.
0560 
0561 % --- set instance
0562 vbmeg_inst.plotcmap{inst_id} = plotcmap; 
0563 
0564 % Set pointer to arrow
0565 set(h_fig,'Pointer','arrow');
0566 
0567 % --- Load data
0568 parms = [];
0569 
0570 if ~isempty(brain_file),
0571   parms.brain_file = brain_file;
0572 end
0573 
0574 if ~isempty(curr_file),
0575   [tmp1,tmp2] = fileparts(curr_file);
0576   [tmp1,tmp2,str_ext] = fileparts([tmp1 filesep tmp2]);
0577   
0578   switch str_ext
0579    case '.curr',
0580     parms.curr_file = curr_file;
0581     parms.tf_file   = [];
0582     
0583    case '.tf',
0584     parms.curr_file = [];
0585     parms.tf_file   = curr_file;
0586     
0587    otherwise,
0588     vb_disp('WARNING',['Invalid extention for curr_file (job_plot_' ...
0589                        'currentmap.m)']);
0590   end
0591 end
0592 
0593 if ~isempty(ix_trial),
0594   parms.ix_trial = ix_trial;
0595   parms.ave_mode = false;
0596 end
0597 
0598 if ~isempty(area_file),
0599   parms.area_file = area_file;
0600 end
0601 
0602 if ~isempty(act_file),
0603   parms.act_file = act_file;
0604 end
0605 
0606 job_plot_cmap_load_data(inst_id,parms);
0607 
0608 return;

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