Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch for error in openNEV (line 550) #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
26 changes: 13 additions & 13 deletions NPMK/NPMKverChecker.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ function NPMKverChecker()
%

%% Check for the latest version fo NPMK
try
FIDv = fopen('Versions.txt');
verFile = fscanf(FIDv, '%s');
fclose(FIDv);
latestVersion = verFile(findstr('LATEST', verFile)+7:findstr('LATEST', verFile)+13);
gitHubPage = urlread('https://github.com/BlackrockMicrosystems/NPMK/releases/latest');
newVersionAvailable = findstr(latestVersion, gitHubPage);
if isempty(newVersionAvailable)
disp('A new version of NPMK may be available.');
disp('Please visit https://github.com/BlackrockMicrosystems/NPMK/releases/latest to get the latest version.');
end
catch
end
%try
% FIDv = fopen('Versions.txt');
% verFile = fscanf(FIDv, '%s');
% fclose(FIDv);
% latestVersion = verFile(findstr('LATEST', verFile)+7:findstr('LATEST', verFile)+13);
% gitHubPage = urlread('https://github.com/BlackrockMicrosystems/NPMK/releases/latest');
% newVersionAvailable = findstr(latestVersion, gitHubPage);
% if isempty(newVersionAvailable)
% disp('A new version of NPMK may be available.');
% disp('Please visit https://github.com/BlackrockMicrosystems/NPMK/releases/latest to get the latest version.');
% end
% catch
%end
4 changes: 3 additions & 1 deletion NPMK/openNEV.m
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,9 @@
return;
end
end
NEV.MetaTags.ChannelID = [NEV.ElectrodesInfo.ElectrodeID];
if ~isempty(NEV.ElectrodesInfo)
NEV.MetaTags.ChannelID = [NEV.ElectrodesInfo.ElectrodeID];
end
clear ExtendedHeader PacketID ii;

%% Recording after ExtendedHeader file position and calculating Data Length
Expand Down
12 changes: 9 additions & 3 deletions NPMK/openNSx.m
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,10 @@
% the data read.
% DEBUG: This is not needed since the same length of data is to be
% read.
EndPacket = EndPacket / skipFactor;
% AB20171130 in any case StartPacket should also be adjusted for
% consistency
%EndPacket = EndPacket / skipFactor;
%StartPacket = (StartPacket-1)/skipFactor + 1;

% Finding which data segment the StartPacket is falling in-between
segmentCounters = [];
Expand Down Expand Up @@ -750,7 +753,10 @@
end

DataLength = EndPacket - StartPacket + 1;


% AB20171130 adjusting DataLength for skipfactor
DataLength = floor(DataLength/skipFactor);

% from now StartPacket and EndPacket are in terms of Samples and are zero-based
clear TimeScale

Expand All @@ -774,7 +780,7 @@
NSx.MetaTags.Timestamp(1) = NSx.MetaTags.Timestamp(1) + startTimeStampShift;
else
fseek(FID, f.BOData(1), 'bof');
% Skip the file to the beginning of the time requsted, if not 0
% Skip the file to the beginning of the time requested, if not 0
fseek(FID, (StartPacket - 1) * 2 * ChannelCount, 'cof');
% Skip the file to the first channel to read
fseek(FID, (find(NSx.MetaTags.ChannelID == min(userRequestedChannels))-1) * 2, 'cof');
Expand Down