function sensorshift = spm_cfg_eeg_inv_sensorshift % configuration file for tinkering with channel loations % THis is to add deterministic or random displacements to % simulate coregistration error. GRB %_______________________________________________________________________ % Copyright (C) 2013 Wellcome Trust Centre for Neuroimaging % Gareth Barnes % $Id: spm_cfg_eeg_inv_sensorshift.m 6618 2015-12-01 16:25:38Z spm $ D = cfg_files; D.tag = 'D'; D.name = 'M/EEG datasets'; D.filter = 'mat'; D.num = [1 Inf]; D.help = {'Select the M/EEG mat files.'}; val = cfg_entry; val.tag = 'val'; val.name = 'Inversion index'; val.strtype = 'n'; val.help = {'Index of the cell in D.inv where the results will be stored.'}; val.val = {1}; movewhat = cfg_menu; movewhat.tag = 'movewhat'; movewhat.name = 'Move all sensors together or sensors independently ?'; movewhat.help = {'Look at systematic errors in all sensor positioning or independent errors in individual sensors'}; movewhat.labels = {'all','independent'}; movewhat.values = {'all','independent'}; movewhat.val = {'independent'}; meanshift = cfg_entry; meanshift.tag = 'meanshift'; meanshift.name = 'Displacement in x,y z in mm'; meanshift.strtype = 'r'; meanshift.num = [1 3]; meanshift.val = {[0 0 0]}; meanshift.help = {'The mean displacement (in meg space) of the headmodel in mm'}; meanangshift = cfg_entry; meanangshift.tag = 'meanangshift'; meanangshift.name = 'The mean rotation (in meg space) in degrees'; meanangshift.strtype = 'r'; meanangshift.num = [1 3]; meanangshift.val = {[0 0 0]}; meanangshift.help = {'The mean rotation (in meg space) of the headmodel in degrees'}; sdshift = cfg_entry; sdshift.tag = 'sdshift'; sdshift.name = 'Standard deviation in x,y z in mm'; sdshift.strtype = 'r'; sdshift.num = [1 3]; sdshift.val = {[0 0 0]}; sdshift.help = {'The standard deviation (mm) of the random displacement to be added to all fiducials'}; sdangshift = cfg_entry; sdangshift.tag = 'sdangshift'; sdangshift.name = 'Standard deviation of rotation in degrees'; sdangshift.strtype = 'r'; sdangshift.num = [1 3]; sdangshift.val = {[0 0 0]}; sdangshift.help = {'The standard deviation (degrees) of the random rotation of the fiducials'}; outprefix= cfg_entry; outprefix.tag = 'outprefix'; outprefix.name = 'output prefix'; outprefix.strtype = 's'; outprefix.help = {'Prefix for new file with displaced sensors'}; outprefix.val = {'sens1'};% % pperror = cfg_entry; % pperror.tag = 'pperror'; % pperror.name = 'Per point per dimension standard deviation of error (mm)'; % pperror.strtype = 'r'; % pperror.num = [1 1]; % pperror.val = {[0]}; % pperror.help = {'The standard deviation of the error (mm) on each fiducial in each dimension'}; sensorshift = cfg_exbranch; sensorshift.tag = 'sensorshift'; sensorshift.name = 'Add sensor error'; sensorshift.val = {D, val,movewhat, meanshift, sdshift,meanangshift,sdangshift,outprefix}; sensorshift.help = {'To simulate the effects of uncertainty on sensor position'}; sensorshift.prog = @specify_sensorshift; sensorshift.vout = @vout_specify_sensorshift; sensorshift.modality = {'MEG'}; function out = specify_sensorshift(job) out.D = {}; %- Loop over input datasets %-------------------------------------------------------------------------- for i = 1:numel(job.D) D0 = spm_eeg_load(job.D{i}); if ~isfield(D0,'inv') val = 1; elseif numel(D0.inv)