<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi all,</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I am using the template atlas for the brainetome atlas included with fieldtrip, and using it along with ft_virtualchannel to parcellate my source data(for eeg). My steps are below:</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<ol data-editing-info="{"orderedStyleType":3,"unorderedStyleType":1}" data-listchain="__List_Chain_202">
<li style="list-style-type: "1) ";"><span>import eeg, project electrodes onto default headmodel</span></li><li style="list-style-type: "2) ";"><span>create leadfield with 4mm resolution</span></li><li style="list-style-type: "3) ";"><span>compute average sources, save filters</span></li><li style="list-style-type: "4) ";">interpolate brainetome atlas onto computed leadfield using ft_sourceinterpolate</li><li style="list-style-type: "5) ";">compute trial by trial source data using ft_virutal channel with eeg data, source filters, and interpolated atlas.</li></ol>
<div>I believe I have everything working, but ft_virtualchannel shows that I am only segmenting ~15% of the total volume, with each roi ranging from .01 to .15% of total volume(246 rois total).</div>
<div><br>
</div>
<div>Does this seem correct, or did I make a mistake with interpolating the atlas onto my leadfield?</div>
<div><br>
</div>
<div>Thank you!</div>
<div><br>
</div>
<div>Best,</div>
<div>Michael Glassen</div>
<div><br>
</div>
<div>Source code below:</div>
<div><br>
</div>
<div>
<div class="rtcContent" style="padding:30px"><span class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal"><span><span class="ContentPasted0">headmodel = vol;</span></span></span>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">atlas = ft_read_atlas(atlasLoc);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">EEG = pop_loadset(eegLoc);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">% </span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">EEG = pop_basicfilter( EEG, 1:size(EEG.data,1) ,
</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'Boundary'</span><span class="ContentPasted0">,
</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'boundary'</span><span class="ContentPasted0">,
</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'Cutoff'</span><span class="ContentPasted0">, [ 1 100],
</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'Design'</span><span class="ContentPasted0">,
</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'butter'</span><span class="ContentPasted0">,
</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'Filter'</span><span class="ContentPasted0">,
</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'bandpass'</span><span class="ContentPasted0">,
</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'Order'</span><span class="ContentPasted0">, 2,
</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'RemoveDC'</span><span class="ContentPasted0">,
</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'on' </span>
<span class="ContentPasted0">);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">EEG = eeg_regepochs(EEG,</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'recurrence'</span><span class="ContentPasted0">,1,</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'limits'</span><span class="ContentPasted0">,[0
1],</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'rmbase'</span><span class="ContentPasted0">,NaN);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">EEG = pop_iclabel(EEG,</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'default'</span><span class="ContentPasted0">);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">EEG = pop_icflag(EEG, [NaN NaN;0.75 1;0.75 1;NaN NaN;NaN NaN;NaN NaN;NaN NaN]);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">EEG = pop_subcomp(EEG,[],0,0);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">header = eeglab2fieldtrip(EEG,</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'preprocessing'</span><span class="ContentPasted0">,</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'none'</span><span class="ContentPasted0">);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">header.hdr.chanunit = repmat({</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'uV'</span><span class="ContentPasted0">},[size(EEG.data,1),1]);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">%% Seperate EEG and EMG data</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">eegChans = {};</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(14, 0, 255);" class="ContentPasted0">for </span><span class="ContentPasted0">i = 1:size(EEG.data,1)</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> eegChans = [eegChans header.label{i}];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(14, 0, 255);" class="ContentPasted0">end</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">%</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">% emgChans = {};</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">% for i = 65:EEG.nbchan</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">% emgChans = [emgChans header.label{i}];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">% end</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg = [];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.channel = eegChans;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">eegData = ft_selectdata(cfg,header);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">% cfg = [];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">% cfg.channel = emgChans;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">% %</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">% emgData = ft_selectdata(cfg,header);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">tempElec = ft_read_sens(electrodePos);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">newElec = tempElec;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(14, 0, 255);" class="ContentPasted0">for </span><span class="ContentPasted0">i = 1:length(eegData.label)</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> checker = 0;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> </span><span style="color: rgb(14, 0, 255);" class="ContentPasted0">for
</span><span class="ContentPasted0">i2 = 1:length(tempElec.label)</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> </span><span style="color: rgb(14, 0, 255);" class="ContentPasted0">if
</span><span class="ContentPasted0">strcmpi(eegData.label{i},tempElec.label{i2})</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> checker = 1;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> newElec.chanpos(i,:) = tempElec.chanpos(i2,:);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> newElec.chantype{i} = tempElec.chantype{i2};</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> newElec.chanunit{i} = tempElec.chanunit{i2};</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> newElec.elecpos(i,:) = tempElec.elecpos(i2,:);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> newElec.label{i} = tempElec.label{i2};</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> </span><span style="color: rgb(14, 0, 255);" class="ContentPasted0">end</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> </span><span style="color: rgb(14, 0, 255);" class="ContentPasted0">end</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> </span><span style="color: rgb(14, 0, 255);" class="ContentPasted0">if
</span><span class="ContentPasted0">checker == 0</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> eegData.elec.label{i}</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> </span><span style="color: rgb(14, 0, 255);" class="ContentPasted0">end</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(14, 0, 255);" class="ContentPasted0">end</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">newElec.chanpos(length(eegData.label)+1:end,:) = [];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">newElec.chantype(length(eegData.label)+1:end) = [];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">newElec.chanunit(length(eegData.label)+1:end) = [];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">newElec.elecpos(length(eegData.label)+1:end,:) = [];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">newElec.label(length(eegData.label)+1:end) = [];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">eegData.elec = newElec;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">%% Project electrodes to scalp</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(14, 0, 255);" class="ContentPasted0">if </span><span class="ContentPasted0">strcmp(headmodel.type,
</span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'bemcp'</span><span class="ContentPasted0">)</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> scalp_index = 3;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(14, 0, 255);" class="ContentPasted0">elseif </span>
<span class="ContentPasted0">strcmp(headmodel.type, </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'dipoli'</span><span class="ContentPasted0">)</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0"> scalp_index = 1;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(14, 0, 255);" class="ContentPasted0">end</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg = [];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.method = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'project'</span><span class="ContentPasted0">;
</span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">% onto scalp surface</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.headshape = headmodel.bnd(scalp_index); </span>
<span style="color: rgb(0, 128, 19);" class="ContentPasted0">% scalp surface</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">eegData.elec = ft_electroderealign(cfg, eegData.elec);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg = [];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.headmodel = headmodel;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.elec = eegData.elec;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.grid.resolution = 4;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.grid.unit = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'mm'</span><span class="ContentPasted0">;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.channel = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'all'</span><span class="ContentPasted0">;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">grid = ft_prepare_leadfield(cfg);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg = [];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.covariance = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'yes'</span><span class="ContentPasted0">;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.covariancewindow = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'all'</span><span class="ContentPasted0">;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">timelock_allexp = ft_timelockanalysis(cfg, eegData);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg = [];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.covariance = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'yes'</span><span class="ContentPasted0">;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.covariancewindow = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'all'</span><span class="ContentPasted0">;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.keeptrials = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'yes'</span><span class="ContentPasted0">;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">timelock_allexp_all = ft_timelockanalysis(cfg, eegData);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">%General source localisation</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg = [];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.headmodel = vol;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.elec = timelock_allexp.elec;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.grid = grid;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.method = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'lcmv'</span><span class="ContentPasted0">;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.lcmv.fixedori = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'yes'</span><span class="ContentPasted0">; </span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">%Project onto largest
variance orientation</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.lcmv.keepfilter = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'yes'</span><span class="ContentPasted0">;
</span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">%Keep the beamformer weights</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.lcmv.lambda = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'5%'</span><span class="ContentPasted0">;
</span><span style="color: rgb(0, 128, 19);" class="ContentPasted0">%Regularise a little</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">source_allexp = ft_sourceanalysis(cfg, timelock_allexp);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg = [];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.method = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'nearest'</span><span class="ContentPasted0">;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.parameter = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'tissue'</span><span class="ContentPasted0">;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">grid2 = ft_sourceinterpolate(cfg,atlas,grid);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">grid2.tissue = fix(grid2.tissue);</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">grid2.tissuelabel = atlas.tissuelabel;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
</div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg = [];</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.parcellation = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'tissue'</span><span class="ContentPasted0">;</span></span></div>
<div class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal">
<span><span class="ContentPasted0">cfg.method = </span><span style="color: rgb(167, 9, 245);" class="ContentPasted0">'svd'</span><span class="ContentPasted0">;</span></span></div>
<span class="lineNode" style="font-size:10pt;font-family:Menlo, Monaco, Consolas, "Courier New", monospace;font-weight:normal"><span><span class="ContentPasted0">roiData = ft_virtualchannel(cfg,timelock_allexp_all,source_allexp,grid2);</span></span></span></div>
<br>
</div>
</div>
</body>
</html>