load("sourceplot_variables.mat")

% load template
templatefile = [ftpath '/template/anatomy/single_subj_T1.nii'];
template_mri = ft_read_mri(templatefile);
template_mri.coordsys = 'spm';

% run interpolation
cfg = [];
cfg.interpmethod = 'sphere_avg';
cfg.parameter = 'stat';
cfg.sphereradius = 20; 
cfg.downsample    = 1; 
src = ft_sourceinterpolate(cfg, Func, template_mri);

% plot
cfg              = [];
cfg.method       = 'ortho';
cfg.funparameter = 'stat';
cfg.opacitymap    = 'vup';
ft_sourceplot(cfg,src);
