Skip to content

Commit

Permalink
Bunch of bug fixed described in Versions.txt.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kian Torab committed Sep 3, 2017
1 parent 50069bb commit 0a85655
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 15 deletions.
2 changes: 1 addition & 1 deletion NPMK/Dependent Functions/getFile.ini
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/Users/kianabc/Google Drive/Downloads/
/Users/kianabc/Documents/Sample Data/The Most Perfect Data in the WWWorld/sampleData/
15 changes: 3 additions & 12 deletions NPMK/Dependent Functions/parseCCF.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,10 @@
% 1.1.1.0: January 19, 2016 - Kian Torab
% - Added a progress bar.
%
<<<<<<< HEAD
% 1.1.2.0: October 20, 2016 - Saman Hagh-gooie
% - Fixed a invalid character bug.
%
=======
% 1.1.2.0: October 10, 2016 - Saman Hagh Gooie
% - Bug fixes with file loading
%
>>>>>>> origin/master
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if nargin ~= 0
Expand Down Expand Up @@ -73,13 +68,9 @@

children = struct( ...
'Name', allocCell, 'Attributes', allocCell, ...
'Data', allocCell, 'Children', allocCell);
<<<<<<< HEAD

counter = 0;
=======
counter=0; % added by SH 05.oct.2016
>>>>>>> origin/master
'Data', allocCell, 'Children', allocCell);

counter=0; % added by SH 05.oct.2016
for count = 1:numChildNodes
theChild = childNodes.item(count-1);
children(count) = makeStructFromNode(theChild);
Expand Down
17 changes: 16 additions & 1 deletion NPMK/NSx Utilities/openNSxHL.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
% 1.0.0.0:
% - Initial release.
%
% 1.1.0.0: June 16, 2017
% - Pads the data with zeros when the beginning timestamp is not 0.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Opening the file
Expand Down Expand Up @@ -85,7 +88,7 @@
elseif strcmpi(FileTypeID, 'NEURALCD')
dataHeaderBytes = 9;
BasicHeader = fread(FID, 306, '*uint8');
HeaderBytes = double(typecast(BasicHeader(3:6), 'uint32')) + dataHeaderBytes;
HeaderBytes = double(typecast(BasicHeader(3:6), 'uint32'));
else
disp('This version of NSxToXXX can only read File Specs 2.1, 2.2 and 2.3');
disp(['The selected file spec is ' NSx.MetaTags.FileSpec '.']);
Expand All @@ -94,10 +97,22 @@
return;
end

% Finding the number of channels
fseek(FID, 310, 'bof');
numofChannels = fread(FID, 1, '*uint32');

% Skipping to the point where the data is saved, skipping the header info
fseek(FID, HeaderBytes, 'bof');

% Finding the beginning timestamp so it can be padded with zeros in case
% it's not 0 already.
fseek(FID, 1, 'cof'); % Skipping to timestamp
begTimestamp = fread(FID, 1, '*uint32');
paddedZeros = zeros(numofChannels * begTimestamp * 2, 1);
fseek(FID, 4, 'cof'); % Skipping to data

% Reading the header-less data
disp(['Reading the data from file ' path fname '...']);
OUTPUT = fread(FID, inf, '*int16');
OUTPUT = [paddedZeros; OUTPUT];
fclose(FID);
17 changes: 17 additions & 0 deletions NPMK/Versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,20 @@ NPMK Version 2.8.2.0: 5 May 2014
% openNSx: 6.4.0.0: December 1, 2016
% - Fixed a serious bug related to loading paused files.
% - Fixed a bug where an empty data segment resulted in a cell structure.

***** NPMK Version 4.5.0.0 :September 1, 2017 *****

% openNEV 5.3.1.0: September 1, 2017
% - Fixed a bug with file path and whent this was passed to the function.

% openNSxHL 1.1.0.0: June 16, 2017
% - Pads the data with zeros when the beginning timestamp is not 0.

% openNSx 6.4.2.0: September 1, 2017
% - Fixed a bug related to reading data from sample that is not 1 and
% timestamp that used to get reset to 0.

% parseCCF 1.1.2.0: October 20, 2016
% - Fixed a invalid character bug.
% - Bug fixes with file loading

6 changes: 5 additions & 1 deletion NPMK/openNEV.m
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@
% - Added parsing of comment start time and comment committ time (time
% that a comment is entered.
%
% 5.3.1.0: September 1, 2017
% - Fixed a bug with file path and whent this was passed to the function.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Defining structures
Expand Down Expand Up @@ -259,7 +262,8 @@
(strcmpi(temp(3),'\') || ...
strcmpi(temp(1),'/') || ...
strcmpi(temp(2),'/') || ...
strcmpi(temp(1:2), '\\'))
strcmpi(temp(1:2), '\\') || ...
strcmpi(temp(end-3), '.'))
fileFullPath = varargin{i};
if exist(fileFullPath, 'file') ~= 2
disp('The file does not exist.');
Expand Down

0 comments on commit 0a85655

Please sign in to comment.