-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
small update to flexibly handle VEO/VEOG HEO/HEOG naming differences
- Loading branch information
Showing
1 changed file
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
||
|
||