Skip to content

Commit

Permalink
small update to flexibly handle VEO/VEOG HEO/HEOG naming differences
Browse files Browse the repository at this point in the history
  • Loading branch information
sjburwell committed Apr 17, 2019
1 parent b4fd56b commit e5871b1
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions example_scripts/alcstress/stdize_chanlocs_32scalp_03PNS.m
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
elec_locations_file = 'curry_sphrad1_n35.ced';
locations_file = 'curry_sphrad1_n35.ced';
if exist(elec_locations_file, 'file'), %through this and pre-steps, we lose connection to "urchanlocs"
chanlocs = readlocs(elec_locations_file);
if ~isempty(strmatch('HEO',{EEG.chanlocs.labels},'exact')),
chanlocs(strmatch('HEOG',{chanlocs.labels},'exact')).labels = 'HEO';
end
if ~isempty(strmatch('VEO',{EEG.chanlocs.labels},'exact')),
chanlocs(strmatch('VEOG',{chanlocs.labels},'exact')).labels = 'VEO';
end
[junk, oridx] = ismember({EEG.chanlocs.labels}, {chanlocs.labels});
chanlocs = chanlocs(oridx);
[junk, sorti] = sort(oridx);
chanlocs = chanlocs(oridx(oridx>0));
[junk, sorti] = sort(oridx(oridx>0));
EEG.chanlocs = chanlocs(sorti);
EEG.data = EEG.data(sorti,:,:);
end

if ~isempty(strmatch('HEO',{EEG.chanlocs.labels},'exact')),
EEG.chanlocs(strmatch('HEO',{EEG.chanlocs.labels},'exact')).labels = 'HEOG';
end
if ~isempty(strmatch('VEO',{EEG.chanlocs.labels},'exact')),
EEG.chanlocs(strmatch('VEO',{EEG.chanlocs.labels},'exact')).labels = 'VEOG';
end

%% the HEO/VEO --> HEOG/VEOG code was added by SJB to account for instances where people define their ocular channels differently than in the curry_sphrad1_n35.ced file.


0 comments on commit e5871b1

Please sign in to comment.