Home > 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)

DESCRIPTION ^

 Plot spatio-temporal pattern of estimated current.

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

 [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).

 [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. 

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

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005