0001 function job_view_lf_load_cortex(inst_id,brainfile)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 global vbmeg_inst;
0014
0015
0016
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
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
0045
0046
0047
0048
0049
0050
0051
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
0058
0059
0060
0061 job_view_lf_update_cortexpattern(inst_id);