Home > functions > job > job_edit_act_dir > job_edit_act_load_cortex.m

job_edit_act_load_cortex

PURPOSE ^

Load cortical surface model

SYNOPSIS ^

function job_edit_act_load_cortex(inst_id,brainfile)

DESCRIPTION ^

 Load cortical surface model

 --- Syntax
 function job_plot_cmap_load_cortex(inst_id,brainfile)

 --- History
 2008-09-01 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_edit_act_load_cortex(inst_id,brainfile)
0002 % Load cortical surface model
0003 %
0004 % --- Syntax
0005 % function job_plot_cmap_load_cortex(inst_id,brainfile)
0006 %
0007 % --- History
0008 % 2008-09-01 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.editact{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.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 % Standard brain coordinate
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 % Load neighbour data for filter calculation
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 % Activity map
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 % Update plot
0062 %
0063 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0064 job_edit_act_update_spatialpattern(inst_id);

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