Home > functions > job > job_view_leadfield_dir > job_view_lf_update_cortexpattern.m

job_view_lf_update_cortexpattern

PURPOSE ^

Update brain activity map

SYNOPSIS ^

function job_view_lf_update_cortexpattern(inst_id)

DESCRIPTION ^

 Update brain activity map

 [syntax]
 job_view_lf_update_cortexpattern(inst_id)

 [history]
 2009-01-27 Taku Yoshioka
 2010-08-26 Taku Yoshioka
  Replace function (vb_plot_cortex->vb_plot_cortex)

 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 job_view_lf_update_cortexpattern(inst_id)
0002 % Update brain activity map
0003 %
0004 % [syntax]
0005 % job_view_lf_update_cortexpattern(inst_id)
0006 %
0007 % [history]
0008 % 2009-01-27 Taku Yoshioka
0009 % 2010-08-26 Taku Yoshioka
0010 %  Replace function (vb_plot_cortex->vb_plot_cortex)
0011 %
0012 % Copyright (C) 2011, ATR All Rights Reserved.
0013 % License : New BSD License(see VBMEG_LICENSE.txt)
0014 
0015 global vbmeg_inst; 
0016 if isempty(vbmeg_inst.viewlf{inst_id}.V), return; end
0017 
0018 %
0019 % Global variables
0020 %
0021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0022 h_fig = vbmeg_inst.viewlf{inst_id}.h_fig; 
0023 h_cortex = vbmeg_inst.viewlf{inst_id}.h_cortex;
0024 plot_parm = vbmeg_inst.viewlf{inst_id}.plot_parm;
0025 Jmin_plot = vbmeg_inst.viewlf{inst_id}.Jmin_plot;
0026 Jmax_plot = vbmeg_inst.viewlf{inst_id}.Jmax_plot;
0027 ix_selected_vertex = vbmeg_inst.viewlf{inst_id}.ix_selected_vertex;
0028 cb1 = vbmeg_inst.viewlf{inst_id}.cb1; % 'left_brain'
0029 cb2 = vbmeg_inst.viewlf{inst_id}.cb2; % 'right_brain'
0030 cb3 = vbmeg_inst.viewlf{inst_id}.cb3; % 'fix_cortex_colorbar'
0031 rb1 = vbmeg_inst.viewlf{inst_id}.rb1; % 'model_type_original_rb'
0032 basis_org = vbmeg_inst.viewlf{inst_id}.basis_org_smoothed;
0033 F = vbmeg_inst.viewlf{inst_id}.F;
0034 %h_cbar_cortex = vbmeg_inst.viewlf{inst_id}.h_cbar_cortex;
0035 %nextDD = vbmeg_inst.viewlf{inst_id}.nextDD;
0036 %nextIX = vbmeg_inst.viewlf{inst_id}.nextIX;
0037 
0038 %
0039 % Preparation for cortical surface plot
0040 %
0041 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0042 set(h_fig,'Pointer','arrow');
0043 
0044 % Original/Inflated model
0045 if get(rb1,'Value')==1,
0046   V = vbmeg_inst.viewlf{inst_id}.V;
0047   inf_C = [];
0048 else
0049   V = vbmeg_inst.viewlf{inst_id}.Vinf;
0050   inf_C = vbmeg_inst.viewlf{inst_id}.inf_C;
0051 end
0052 
0053 % Leadfield map (norm)
0054 if isempty(basis_org), 
0055   isact = 0;
0056   J = [];
0057 else
0058   isact = 1;
0059   J = sum(sqrt(basis_org.^2),1)';
0060 end
0061 
0062 % Scaling
0063 if get(cb3,'Value') ~= get(cb3,'Max'), 
0064   Jmax_plot = max(abs(J));
0065   Jmin_plot = -1*Jmax_plot;
0066   vbmeg_inst.viewlf{inst_id}.Jmax_plot = Jmax_plot;
0067   vbmeg_inst.viewlf{inst_id}.Jmin_plot = Jmin_plot;
0068 end
0069 
0070 % Display parameters
0071 LRflag = [];
0072 if get(cb1,'Value')==get(cb1,'Max'), LRflag = 'L'; end
0073 if get(cb2,'Value')==get(cb2,'Max'), LRflag = [LRflag 'R']; end;
0074 if isempty(LRflag), 
0075   set(cb1,'Value',get(cb1,'Max')); 
0076   LRflag = 'L';
0077 end
0078 plot_parm.LRflag = LRflag; 
0079 plot_parm.isact = isact;
0080 
0081 %
0082 % Plot brain activities superimposed on the cortical surface model
0083 %
0084 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0085 set(h_fig,'CurrentAxes',h_cortex);
0086 cla; 
0087 %vb_plot_cortex(plot_parm,V,F,inf_C,J,Jmin_plot,Jmax_plot,[]);
0088 vb_plot_cortex(plot_parm,V,F,inf_C,J,Jmin_plot,Jmax_plot);
0089 axis off;
0090 axis tight;
0091 axis equal;
0092 if ~isempty(J), 
0093   colormap(jet);
0094   %reset(h_cbar_cortex);
0095   %colorbar(h_cbar_cortex);
0096   colorbar;
0097 end
0098 
0099 % Plot indicator for selected Vertex
0100 plot3(V(ix_selected_vertex,1),V(ix_selected_vertex,2),...
0101       V(ix_selected_vertex,3),'gx','MarkerSize',15,'LineWidth',3);
0102 
0103 % Update standard brain coordinate
0104 %job_plot_cmap_update_talcoord(inst_id);
0105 
0106 set(h_fig,'Pointer','arrow');
0107 
0108 job_view_lf_push_rotate_button(inst_id);
0109 %job_view_lf_change_colorbar(inst_id);

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