Skip to content

Commit

Permalink
***** NPMK Version 5.5.2.0 :May 5, 2021 *****
Browse files Browse the repository at this point in the history
%
% 7.4.2.0: openNSx: May 5, 2021
%   - Fixed a bug related to NeuralSG file format (File Spec 2.1).
%
  • Loading branch information
kianabc committed May 6, 2021
1 parent 564fe69 commit 03ac334
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
8 changes: 7 additions & 1 deletion NPMK/Versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -502,4 +502,10 @@ NPMK Version 2.8.2.0: 5 May 2014
% 7.4.1.0: openNSx: April 20, 2021
% - Fixed a bug related to file opening.

LATEST:5.5.1.0
***** NPMK Version 5.5.2.0 :May 5, 2021 *****
%
% 7.4.2.0: openNSx: May 5, 2021
% - Fixed a bug related to NeuralSG file format (File Spec 2.1).
%

LATEST:5.5.2.0
14 changes: 12 additions & 2 deletions NPMK/openNSx.m
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@
% 7.4.1.0: April 20, 2021
% - Fixed a bug related to file opening.
%
% 7.4.2.0: May 5, 2021
% - Fixed a bug related to NeuralSG file format (File Spec 2.1).
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Defining the NSx data structure and sub-branches.
Expand All @@ -288,7 +291,7 @@
'FileExt', []);


NSx.MetaTags.openNSxver = '7.4.0.0';
NSx.MetaTags.openNSxver = '7.4.2.0';

%% Check for the latest version fo NPMK
NPMKverChecker
Expand Down Expand Up @@ -496,6 +499,7 @@

NSx.MetaTags.FileTypeID = fread(FID, [1,8] , 'uint8=>char');
if strcmpi(NSx.MetaTags.FileTypeID, 'NEURALSG')
timeStampBytes = 4;
NSx.MetaTags.FileSpec = '2.1';
NSx.MetaTags.SamplingLabel = fread(FID, [1,16] , 'uint8=>char');
NSx.MetaTags.TimeRes = 30000;
Expand Down Expand Up @@ -921,7 +925,13 @@
NSx.MetaTags.DataDurationSec(cellIDX) = NSx.MetaTags.DataPoints(cellIDX) / NSx.MetaTags.SamplingFreq;
NSx.MetaTags.Timestamp(cellIDX) = 0;
elseif strcmpi(ReadData, 'read')
NSx.Data = [zeros(NSx.MetaTags.ChannelCount, floor(NSx.MetaTags.Timestamp / skipFactor), precisionData) NSx.Data];
try
NSx.Data = [zeros(NSx.MetaTags.ChannelCount, floor(NSx.MetaTags.Timestamp / skipFactor), precisionData) NSx.Data];
catch
disp('There is not enough memory to read this file. Use openNSx(''nozeropad.'').');
disp('For more information please refer to our <a href = "https://support.blackrockmicro.com/portal/en/kb/articles/nozeropad-in-opennsx">knowledge base article</a> on this subject.');
return;
end
NSx.MetaTags.DataPoints = size(NSx.Data,2);
NSx.MetaTags.DataDurationSec = NSx.MetaTags.DataPoints / NSx.MetaTags.SamplingFreq;
NSx.MetaTags.Timestamp = 0;
Expand Down

0 comments on commit 03ac334

Please sign in to comment.