<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style><style type="text/css"></style><style type="text/css"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Dear fieldtrip users,
<div><br>
</div>
<div>I'm working with source estimations of EEG data. At the moment, I have estimated the sources at the individual level with individual MRIs. I've used ft_sourceinterpolate and ft_volumenormalise to transform the resulting estimation maps into a template
 for comparison, and I do this for every subject: </div>
<div><br>
</div>
<div>
<div> cfg             = [];</div>
<div>    cfg.parameter   = 'avg.pow';</div>
<div>    source  = ft_sourceinterpolate(cfg, source, mri);</div>
<div><br>
</div>
<div>    cfg = [];</div>
<div>    cfg.template = '\spm8\templates\T1.nii';</div>
<div>    cfg.parameter = 'all';</div>
<div>    cfg.nonlinear = 'yes';</div>
<div>    cfg.coordsys = 'spm';</div>
<div>    source = ft_volumenormalise(cfg, source); </div>
</div>
<div><br>
</div>
<div>Once I have the estimated sources for all the subjects, I use ft_sourcestatistics:</div>
<div><br>
</div>
<div>
<div>cfg             = [];</div>
<div>cfg.dim         = sourcePre_con{1}.dim;</div>
<div>cfg.method      = 'montecarlo';</div>
<div>cfg.statistic   = 'depsamplesT';</div>
<div>cfg.parameter   = 'avg.pow';</div>
<div>cfg.correctm    = 'cluster';</div>
<div>cfg.numrandomization = 'all';</div>
<div>cfg.alpha       = 0.05;</div>
<div>cfg.tail        = 0;</div>
<div>cfg.design(1,:) = [1:num 1:num];</div>
<div>cfg.design(2,:) = [ones(1,num) ones(1,num)*2];</div>
<div>cfg.uvar        = 1;</div>
<div>cfg.ivar        = 2; </div>
<div>stat = ft_sourcestatistics(cfg,sourcePost_con{:},  sourcePre_con{:});</div>
</div>
<div><br>
</div>
<div>And I get this error:</div>
<div><br>
</div>
<div>
<div><font color="#ff0000">Reference to non-existent field 'pos'.</font></div>
<div><font color="#ff0000"><br>
</font></div>
<div><font color="#ff0000">Error in statistics_wrapper>get_source_avg (line 643)</font></div>
<div><font color="#ff0000">  fprintf('only selecting voxels inside the brain for statistics (%.1f%%)\n', 100*length(varargin{1}.inside)/size(varargin{1}.pos,1));</font></div>
<div><font color="#ff0000"><br>
</font></div>
<div><font color="#ff0000">Error in statistics_wrapper (line 206)</font></div>
<div><font color="#ff0000">    [dat, cfg] = get_source_avg(cfg, varargin{:});</font></div>
<div><font color="#ff0000"><br>
</font></div>
<div><font color="#ff0000">Error in ft_sourcestatistics (line 107)</font></div>
<div><font color="#ff0000">    [stat, cfg] = statistics_wrapper(cfg, varargin{:});</font></div>
</div>
<div><font color="#ff0000"><br>
</font></div>
<div>I check the data structure and the structure of the sources at the individual level, before interpolating and normalising has the pos field, but after these steps, it's gone. How can I work around this error? Do I have to keep the pos field and transform
 it according to the template?</div>
<div><br>
</div>
<div>Thank you in advance for your help.</div>
<div><br>
</div>
<div>Best regards,</div>
<div><br>
</div>
<div>Laura Rueda</div>
</div>
</body>
</html>