Home > vbmeg > 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')
0030     V = vbmeg_inst.plotcmap{inst_id}.V; 
0031 else
0032     V = vbmeg_inst.plotcmap{inst_id}.Vinf;
0033 end
0034 
0035 %
0036 % Vertex selection
0037 %
0038 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0039 p = (select3d)';
0040 if length(p)==0, return; end; 
0041 tmp = repmat(p,[size(V,1) 1]);
0042 [tmp ixp] = min(sum((tmp-V).^2,2));
0043 vbmeg_inst.plotcmap{inst_id}.ix_peak = ixp;
0044 
0045 h = msgbox('Please wait...');
0046 drawnow;
0047 % %
0048 % % Update cortical area list
0049 % %
0050 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0051 % if ~isempty(area_file),
0052 %   area_key      = vb_get_keyset_area(area_file);
0053 %   area_key_list = []; %cell(0,0);
0054 %   n = 1;
0055 %
0056 %   for i=1:length(area_key)
0057 %     tmp = vb_get_area(area_file,area_key{i});
0058 %     if ~isempty(find(tmp.Iextract==ixp)),
0059 %       area_key_list{n} = tmp.key;
0060 %       n = n+1;
0061 %     end
0062 %
0063 %     set(lb3,'String',area_key_list, 'Value', 1);
0064 %   end
0065 % end
0066 
0067 %
0068 % Update figure
0069 %
0070 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0071 job_plot_cmap_update_timecourse(inst_id); 
0072 job_plot_cmap_update_spatialpattern(inst_id);
0073 
0074 if ishandle(h)
0075     delete(h);
0076 end
0077

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