Home > eeg > egis > meg_code > artifact_edit_meg.m

artifact_edit_meg

PURPOSE ^

SYNOPSIS ^

function mask = artifact_edit_meg(trialdata,meg_channels,eeg_channels,MEG_max,EEG_max,add_bad_chan);

DESCRIPTION ^

 applies amplitude criterion to MEG and EEG channels to artifact edit. 
 returning a mask with ones for good channels and 0 for bad channels

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function mask = artifact_edit_meg(trialdata,meg_channels,eeg_channels,MEG_max,EEG_max,add_bad_chan);
0002 %
0003 % applies amplitude criterion to MEG and EEG channels to artifact edit.
0004 % returning a mask with ones for good channels and 0 for bad channels
0005 %
0006 
0007 mask = ones(1,size(trialdata,2));
0008 
0009 max_trialdata = max(abs(trialdata));
0010 bad_meg = find(max_trialdata(meg_channels) > MEG_max);
0011 if ~isempty(eeg_channels)
0012     bad_eeg = find(max_trialdata(eeg_channels) > EEG_max);
0013     mask(eeg_channels(bad_eeg)) =ones(size(bad_eeg,2));
0014 end;
0015 
0016 mask(meg_channels(bad_meg)) = zeros(1,size(bad_meg,2));
0017 if ~isempty(add_bad_chan)
0018     mask(add_bad_chan) = zeros(1,size(add_bad_chan,2));
0019 end;
0020

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003