Commit 9f0071f1 authored by Mark Hymers's avatar Mark Hymers
Browse files

Fix import of channel comments



Signed-off-by: Mark Hymers's avatarMark Hymers <mark.hymers@ynic.york.ac.uk>
parent 96d0f103
......@@ -233,6 +233,9 @@ for iChan = 1:hdr.numberchannels
case {'ANALOG'}
try
comment = h5readatt(DataFile,['/config/channels/' hdr.channelname{iChan} ],'mode');
if iscell(comment)
comment = char(comment);
end
ChannelMat.Channel(iChan).Comment = comment;
catch
disp('');
......@@ -242,6 +245,9 @@ for iChan = 1:hdr.numberchannels
case {'DIGITAL'}
try
comment = h5readatt(DataFile,['/config/channels/' hdr.channelname{iChan} ],'mode');
if iscell(comment)
comment = char(comment);
end
ChannelMat.Channel(iChan).Comment = comment;
catch
disp('');
......@@ -254,7 +260,12 @@ for iChan = 1:hdr.numberchannels
%info = h5info(DataFile,'/geometry/eeg','TextEncoding','UTF-8');
points = h5read(DataFile,lower(['/geometry/eeg/' hdr.channelname{iChan} '/location'])) ./1000;
ChannelMat.Channel(iChan).Loc = points(:,1)';
ChannelMat.Channel(iChan).Comment = hdr.channelname{iChan};
comment = hdr.channelname{iChan}
if iscell(comment)
comment = char(comment);
end
ChannelMat.Channel(iChan).Comment = comment;
catch
disp('No EEG locations')
......@@ -267,7 +278,13 @@ for iChan = 1:hdr.numberchannels
try
ChannelMat.Channel(iChan).Loc = h5read(DataFile,['/config/channels/' hdr.channelname{iChan} '/position']) ./1000; %m
ChannelMat.Channel(iChan).Orient = h5read(DataFile,['/config/channels/' hdr.channelname{iChan} '/orientation']);
ChannelMat.Channel(iChan).Comment = h5read(DataFile,['/config/channels/' hdr.channelname{iChan} '/loop_shape']);
comment = h5read(DataFile,['/config/channels/' hdr.channelname{iChan} '/loop_shape']);
if iscell(comment)
comment = char(comment);
end
ChannelMat.Channel(iChan).Comment = comment;
catch
disp(['no orientation or location for ' hdr.channelname{iChan}])
ChannelMat.Channel(iChan).Loc = [];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment