Authored by Francois Tadel

IO: Bug fix in Nicolet reader: Allow reading of multiple tsPackets

... ... @@ -23,7 +23,11 @@ classdef NicoletFile < handle
% the Nicolet .e file writer which sometimes renders the TSINFO structures
% unreadable on disk (verify with hex-edit). Therefore, this class only
% uses the first TSINFO structure found in the .e file.
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2013 Trustees of the University of Pennsylvania
%
... ... @@ -475,14 +479,15 @@ classdef NicoletFile < handle
if length(tsPackets) > 1
warning(['Multiple TSinfo packets detected; using first instance ' ...
' ac for all segments. See documentation for info.']);
elseif isempty(tsPackets)
warning(['No TSINFO found']);
end
if isempty(tsPackets)
warning('No TSINFO found');
else
tsPacket = tsPackets(1);
obj.tsInfo = struct();
elems = typecast(tsPacket.data(753:756),'uint32');
alloc = typecast(tsPacket.data(757:760),'uint32');
%alloc = typecast(tsPacket.data(757:760),'uint32');
offset = 761;
for i = 1:elems
... ...