<div dir="ltr">Hello all,<div><br></div><div>We are having some problems defining atlas-based ROIs using ft_sourcestatistics on two source structures obtained via ft_sourceanalysis (whose grid is later changed according to a precalculated MNI-warped grid).</div>
<div><br></div><div>It seems like the function "statistics_wrapper" has changed between "fieldtrip-20130822" and "fieldtrip-20131007": line 136 now calls "volumelookup" and not "ft_volumelookup", so we get the following error:</div>
<div><br></div><div><div>      ??? Undefined function or method 'volumelookup' for input</div><div>      arguments of type 'struct'.</div><div><br></div><div>      Error in ==> statistics_wrapper at 136</div>
<div>              tmp = volumelookup(tmpcfg, varargin{1});</div></div><div><br></div><div>Using the older fieldtrip vesion we get this error:</div><div><div>    ??? Subscript indices must either be real positive integers or</div>
<div>    logicals.</div><div><br></div><div>      Error in ==> statistics_wrapper at 213</div><div>            tmp(i,:) = mean(dat(roi,:), 1);</div><div><br></div><div>      Error in ==> ft_sourcestatistics at 107</div>
<div>          [stat, cfg] = statistics_wrapper(cfg, varargin{:});</div></div><div><br></div><div>So it seems like we didn't define the ROIs correctly, however we are not sure why.</div><div><br></div><div>Any suggestions would be greatly appreciated!</div>
<div>The relevant pieceof code is attached.</div><div><br></div><div>Thank you all,</div><div>Aia and Roey</div><div><br></div><div><br></div><div><br></div><div>Relevant code</div><div><div>============</div><div><div>% Convert sources units to mm, to fit the atlas's units</div>
<div>sourceCondition1 = ft_convert_units(sourceCondition1, 'mm');</div><div>sourceCondition2 = ft_convert_units(sourceCondition2, '</div></div><div>design = [ ones(1,length(sourceCondition1.trial)),   2*ones(1,length(sourceCondition2.trial)) ];</div>
<div><br></div><div>cfg = [];</div><div>cfg.dim = sourceCondition1.dim; </div><div>cfg.method = 'montecarlo';</div><div>cfg.statistic = 'indepsamplesT';</div><div>cfg.parameter = 'pow';</div><div>cfg.correctm = 'cluster';</div>
<div>cfg.numrandomization = 1000;</div><div>cfg.alpha = 0.01;</div><div>cfg.tail = 0;</div><div>cfg.design(1,:) = design;</div></div><div>cfg.ivar = 1;<br></div><div><br></div><div><div>% Load the Atlas</div><div>templateDir = which('ft_defaults'); % use a known function (ft_defaults) to find FieldTrip's directory</div>
<div>backslashIndices = find(templateDir=='\');</div><div>templateDir(backslashIndices(end)+1:end) = [];      clear backslashIndices;</div><div>cfg.atlas = [templateDir, 'template\atlas\aal\ROI_MNI_V4.nii'];</div>
<div><br></div><div><br></div></div><div><div>cfg.roi = AAL_names; % This is a cell array of the atlas's ROIs: "Precentral_L", "Precentral_R", etc/</div></div><div><br></div><div><div>cfg.avgoverroi   = 'yes';</div>
<div>cfg.hemisphere   = 'both';</div><div>cfg.inputcoord   = 'mni';</div></div><div><br></div><div><div>stat = ft_sourcestatistics(cfg, sourceCondition1, sourceCondition2);</div></div><div><br></div></div>