0001 function job_edit_act_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.editact{inst_id}.brainfile = brainfile;
0025
0026
0027 [Vinf,F,xx,inf_C,xxA] = vb_load_cortex(brainfile,'Inflate');
0028
0029 if ~isempty(vbmeg_inst.editact{inst_id}.xxP),
0030 if length(vbmeg_inst.editact{inst_id}.xxP{1})~=size(Vinf,1),
0031 warndlg(['Number of cortical vertices does not match with ' ...
0032 'that of the activity map.']);
0033 end
0034 end
0035
0036 V = vb_load_cortex(brainfile);
0037 vbmeg_inst.editact{inst_id}.V = V;
0038 vbmeg_inst.editact{inst_id}.Vinf = Vinf;
0039 vbmeg_inst.editact{inst_id}.F = F;
0040 vbmeg_inst.editact{inst_id}.inf_C = inf_C;
0041
0042
0043 load(brainfile,'Vtal','Vmni');
0044 if ~exist('Vtal','var'), Vtal = zeros(size(V)); end
0045 if ~exist('Vmni','var'), Vmni = zeros(size(V)); end
0046 vbmeg_inst.editact{inst_id}.Vtal = Vtal*1e3;
0047 vbmeg_inst.editact{inst_id}.Vmni = Vmni*1e3;
0048
0049
0050 [nextDD,nextIX] = vb_load_cortex_neighbour(brainfile);
0051 vbmeg_inst.editact{inst_id}.nextDD = nextDD;
0052 vbmeg_inst.editact{inst_id}.nextIX = nextIX;
0053
0054
0055 vbmeg_inst.editact{inst_id}.xxP = cell(30,1);
0056 for i=1:length(vbmeg_inst.editact{inst_id}.xxP)
0057 vbmeg_inst.editact{inst_id}.xxP{i} = zeros(size(V,1),1);
0058 end
0059
0060
0061
0062
0063
0064 job_edit_act_update_spatialpattern(inst_id);