Home > vbmeg > functions > job > job_edit_act_dir > job_edit_act_update_spatialpattern.m

job_edit_act_update_spatialpattern

PURPOSE ^

Update spatial pattern

SYNOPSIS ^

function job_edit_act_update_spatialpattern(inst_id)

DESCRIPTION ^

 Update spatial pattern

 --- Syntax
 job_edit_act_update_spatialpattern(inst_id)

 --- History
 ????-??-?? Taku Yoshioka
 2008-09-04 Taku Yoshioka
 2009-05-22 Taku Yoshioka
  Modify display of standard brain coordinates

 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_edit_act_update_spatialpattern(inst_id)
0002 % Update spatial pattern
0003 %
0004 % --- Syntax
0005 % job_edit_act_update_spatialpattern(inst_id)
0006 %
0007 % --- History
0008 % ????-??-?? Taku Yoshioka
0009 % 2008-09-04 Taku Yoshioka
0010 % 2009-05-22 Taku Yoshioka
0011 %  Modify display of standard brain coordinates
0012 %
0013 % Copyright (C) 2011, ATR All Rights Reserved.
0014 % License : New BSD License(see VBMEG_LICENSE.txt)
0015 
0016 global vbmeg_inst; 
0017 if isempty(vbmeg_inst.editact{inst_id}.V), return; end
0018 
0019 %
0020 % Global variables
0021 %
0022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0023 h_fig = vbmeg_inst.editact{inst_id}.h_fig; 
0024 h_space = vbmeg_inst.editact{inst_id}.h_space;
0025 h_cbar = vbmeg_inst.editact{inst_id}.h_cbar;
0026 V = vbmeg_inst.editact{inst_id}.V;
0027 F = vbmeg_inst.editact{inst_id}.F;
0028 plot_parm = vbmeg_inst.editact{inst_id}.plot_parm;
0029 ix = vbmeg_inst.editact{inst_id}.ix;
0030 ed4 = vbmeg_inst.editact{inst_id}.ed4;
0031 ed6 = vbmeg_inst.editact{inst_id}.ed6;
0032 cb1 = vbmeg_inst.editact{inst_id}.cb1;
0033 cb2 = vbmeg_inst.editact{inst_id}.cb2;
0034 Vtal = vbmeg_inst.editact{inst_id}.Vtal;
0035 model_type_fold_rb = vbmeg_inst.editact{inst_id}.model_type_fold_rb;
0036 model_type_inflate_rb = ...
0037     vbmeg_inst.editact{inst_id}.model_type_inflate_rb;
0038 xxP = vbmeg_inst.editact{inst_id}.xxP;
0039 if ~isempty(xxP), xxP = xxP{1}; end
0040 
0041 %
0042 % Preparation for cortical surface plot
0043 %
0044 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0045 set(h_fig,'Pointer','arrow');
0046 drawnow;
0047 
0048 % Original/Inflated model
0049 if get(model_type_fold_rb,'Value')==1,  
0050   V = vbmeg_inst.editact{inst_id}.V;
0051   inf_C = [];
0052 else
0053   V = vbmeg_inst.editact{inst_id}.Vinf;
0054   inf_C = vbmeg_inst.editact{inst_id}.inf_C;
0055 end
0056 
0057 % Get display parameters
0058 LRflag = [];
0059 if get(cb1,'Value')==get(cb1,'Max'), LRflag = 'L'; end
0060 if get(cb2,'Value')==get(cb2,'Max'), LRflag = [LRflag 'R']; end
0061 plot_parm.LRflag = LRflag;
0062 
0063 if isempty(xxP), isact = 0; else isact = 1; end
0064 plot_parm.isact = isact;
0065 
0066 %
0067 % Plot brain activities superimposed on the cortical surface model
0068 %
0069 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0070 set(h_fig,'CurrentAxes',h_space);
0071 cla; 
0072 job_edit_act_plotbrain(plot_parm,V,F,inf_C,xxP,min(xxP),max(xxP));
0073 v = caxis;
0074 set(ed6,'String',['[' num2str(v) ']']);
0075 axis tight;
0076 axis equal;
0077 set(h_space,'Box','on','XTick',[],'YTick',[],'ZTick',[]);
0078 reset(h_cbar);
0079 colorbar(h_cbar);
0080 
0081 % Add drag/zoom function
0082 vb_dragzoom(h_space, '3d');
0083 patches = get(h_space, 'Children');
0084 set(patches, 'ButtonDownFcn', {@inner_send_select_vertex, inst_id});
0085 
0086 % get view angle
0087 [a, e] = view(h_space);
0088 
0089 % set this value to get MATLAB to regcognize that the axes is 3D graphics.
0090 % (if not set, zoom function behave strange.)
0091 if a == 0 && e == 90
0092     view(h_space, [0, 89]);
0093 end
0094 
0095 % Selected vertex
0096 if ix~=0, 
0097   hold on;
0098   h = plot3(V(ix,1),V(ix,2),V(ix,3),'gx');
0099   set(h,'MarkerSize',plot_parm.ms,'EraseMode','xor',...
0100     'LineWidth',plot_parm.lw);
0101 
0102   % Update talairach coordinates
0103   job_edit_act_update_talcoord(inst_id);
0104   %str = ['(' num2str(ceil(Vtal(ix,1))) ',' ...
0105   %       num2str(ceil(Vtal(ix,2))) ',' ...
0106   %       num2str(ceil(Vtal(ix,3))) ')'];
0107   %set(ed4,'String',str);
0108 end
0109 
0110 
0111 function inner_send_select_vertex(src, evt, inst_id)
0112 global vbmeg_inst;
0113 fig = vbmeg_inst.editact{inst_id}.h_fig;
0114 % double click
0115 if strcmpi(get(fig, 'SelectionType'), 'open')
0116     job_edit_act_select_vertex(inst_id);
0117 end

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