Home > functions > job > job_view_leadfield_dir > job_view_lf_load_cortex.m

job_view_lf_load_cortex

PURPOSE ^

Load cortical surface model

SYNOPSIS ^

function job_view_lf_load_cortex(inst_id,brainfile)

DESCRIPTION ^

 Load cortical surface model

 --- Syntax
 function job_view_lf_load_cortex(inst_id,brainfile)

 --- History
 2009-01-27 Taku Yoshioka

 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_load_cortex(inst_id,brainfile)
0002 % Load cortical surface model
0003 %
0004 % --- Syntax
0005 % function job_view_lf_load_cortex(inst_id,brainfile)
0006 %
0007 % --- History
0008 % 2009-01-27 Taku Yoshioka
0009 %
0010 % Copyright (C) 2011, ATR All Rights Reserved.
0011 % License : New BSD License(see VBMEG_LICENSE.txt)
0012 
0013 global vbmeg_inst; 
0014 
0015 %
0016 % Load cortical surface model
0017 %
0018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0019 if ~exist(brainfile),
0020   warndlg(['File ' brainfile ' does not exist.']);
0021   return; 
0022 end
0023 
0024 vbmeg_inst.viewlf{inst_id}.brainfile = brainfile;
0025 
0026 % Cortical surface model
0027 [Vinf,F,xx,inf_C,xxA] = vb_load_cortex(brainfile,'Inflate');
0028 
0029 if ~isempty(vbmeg_inst.viewlf{inst_id}.basis_org), 
0030   if max(size(vbmeg_inst.viewlf{inst_id}.basis_org,2))>size(Vinf,1), 
0031     warndlg(['Index of dipole currents exceeds the number of ' ...
0032              'vertices.']);
0033     return;
0034   end
0035 end
0036   
0037 V = vb_load_cortex(brainfile);
0038 vbmeg_inst.viewlf{inst_id}.V = V;
0039 vbmeg_inst.viewlf{inst_id}.Vinf = Vinf;
0040 vbmeg_inst.viewlf{inst_id}.F = F;
0041 vbmeg_inst.viewlf{inst_id}.inf_C = inf_C;
0042 vbmeg_inst.viewlf{inst_id}.xxA = xxA;
0043 
0044 % Standard brain coordinate
0045 %load(brainfile,'Vtal','Vmni');
0046 %if ~exist('Vtal','var'), Vtal = zeros(size(V)); end
0047 %if ~exist('Vmni','var'), Vmni = zeros(size(V)); end
0048 %vbmeg_inst.plotcmap{inst_id}.Vtal = Vtal*1e3;
0049 %vbmeg_inst.plotcmap{inst_id}.Vmni = Vmni*1e3;
0050 
0051 % Load neighbour data for filter calculation
0052 [nextDD,nextIX] = vb_load_cortex_neighbour(brainfile); 
0053 vbmeg_inst.viewlf{inst_id}.nextDD = nextDD;
0054 vbmeg_inst.viewlf{inst_id}.nextIX = nextIX;
0055 
0056 %
0057 % Update plots
0058 %
0059 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0060 %job_plot_cmap_update_filterradius(inst_id);
0061 job_view_lf_update_cortexpattern(inst_id);

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