Home > functions > job > job_plot_currentmap_dir > job_plot_cmap_selvertex.m

job_plot_cmap_selvertex

PURPOSE ^

Find nearest vertex from the selected point on GUI.

SYNOPSIS ^

function job_plot_cmap_selvertex(inst_id)

DESCRIPTION ^

 Find nearest vertex from the selected point on GUI.
 
 [syntax]
 job_plot_cmap_selvertex(inst_id)

 [history]
 2008-09-02 Taku Yoshioka
 2011-02-16 taku-y
  [enhancement] Show area list including selected vertex. 

 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_plot_cmap_selvertex(inst_id)
0002 % Find nearest vertex from the selected point on GUI.
0003 %
0004 % [syntax]
0005 % job_plot_cmap_selvertex(inst_id)
0006 %
0007 % [history]
0008 % 2008-09-02 Taku Yoshioka
0009 % 2011-02-16 taku-y
0010 %  [enhancement] Show area list including selected vertex.
0011 %
0012 % Copyright (C) 2011, ATR All Rights Reserved.
0013 % License : New BSD License(see VBMEG_LICENSE.txt)
0014 
0015 global vbmeg_inst; 
0016 
0017 %
0018 % Global variables
0019 %
0020 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0021 rb        = vbmeg_inst.plotcmap{inst_id}.model_type_original_rb;
0022 lb3       = vbmeg_inst.plotcmap{inst_id}.lb3;
0023 area_file = vbmeg_inst.plotcmap{inst_id}.area_file;
0024 
0025 %
0026 % Cortical surface model displayed
0027 %
0028 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0029 if get(rb,'Value'), V = vbmeg_inst.plotcmap{inst_id}.V; 
0030 else V = vbmeg_inst.plotcmap{inst_id}.Vinf; end
0031 
0032 %
0033 % Vertex selection
0034 %
0035 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0036 k = waitforbuttonpress;
0037 if k~=0, return; end;
0038 p = (select3d)';
0039 if length(p)==0, return; end; 
0040 tmp = repmat(p,[size(V,1) 1]);
0041 [tmp ixp] = min(sum((tmp-V).^2,2));
0042 vbmeg_inst.plotcmap{inst_id}.ix_peak = ixp;
0043 
0044 %
0045 % Update cortical area list
0046 %
0047 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0048 if ~isempty(area_file),
0049   area_key      = vb_get_keyset_area(area_file);
0050   area_key_list = []; %cell(0,0);
0051   n = 1;
0052   
0053   for i=1:length(area_key)
0054     tmp = vb_get_area(area_file,area_key{i});
0055     if ~isempty(find(tmp.Iextract==ixp)),
0056       area_key_list{n} = tmp.key;
0057       n = n+1;
0058     end
0059     
0060     set(lb3,'String',area_key_list);
0061   end
0062 end
0063 
0064 %
0065 % Update figure
0066 %
0067 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0068 job_plot_cmap_update_timecourse(inst_id); 
0069 job_plot_cmap_update_spatialpattern(inst_id);

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