⇤ ← Revision 1 as of 2009-03-16 19:01:00
Size: 2253
Comment:
|
Size: 2215
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
This Matlab script will interpolate data to a standard sensor array (e.g. created using FindAvgSensors.m) | This Matlab script will interpolate data to a standard sensor array |
This Matlab script will interpolate data to a standard sensor array maxfilter -f %s -o %s -trans %s -v -frame head -origin 0 0 45 -force -ctc /neuro/databases/ctc/ct_sparse.fif -cal /neuro/databases/sss/sss_cal.dat
% For files specified in cell array "files{}", apply maxfilter with -trans % option in order to interpolate data to sensor array specified in "trans_file" % originall file names will be appended by "_t", or by whatever is specified in "t_ext" % for each transed file, a log-file with maxfilter output will be created ("*.log") % OH, March 2009
addpath /opt/mne/matlab/toolbox/; % fiff read/write tools
if exist('files')~=1, % you can pre-specify a list of files here
- files = {'/fullpath/file4subj1.fif', ...
- '/fullpath/file4subj2.fif', ... '/fullpath/file4subj3.fif'};
end;
if exist('t_ext')~=1, % suffix for filenames of transed files
- t_ext = '_t';
end;
if ~exist(trans_file, 'file'),
- fprintf(1, 'Cannot proceed without trans_file %s\n', trans_file); return;
end; trans_data = fiff_read_evoked( trans_file ); % read fiff-file with standard sensor geometry
nr_files = length(files);
for ff = 1:nr_files, % for each input file, apply maxfilter -trans, then reinsert digitiser points
- in_file = files{ff}; [thispath, thisfile,thisext,thisversn] = fileparts(in_file); out_file = fullfile(thispath, [thisfile t_ext thisext]); log_file = fullfile(thispath, [thisfile t_ext '.log']); % maxfilter -trans... eval(sprintf('!/neuro/bin/util/maxfilter -f %s -o %s -trans %s -v -frame head -origin 0 0 45 -force -ctc /neuro/databases/ctc/ct_sparse.fif -cal /neuro/databases/sss/sss_cal.dat | tee %s', in_file, out_file, trans_file, log_file)); % reinsert digitiser points... data = fiff_read_evoked( out_file ); % read invidual data file with data interpolated to standard sensor geometry data.info.dig = trans_data.info.dig; % insert digitised points from standard geometry to interpolated data set fiff_write_evoked( out_file, data ); % write interpolated data back to fiff-file
end;