diff --git a/NPMK/Dependent Functions/getFile.ini b/NPMK/Dependent Functions/getFile.ini index db9c8d7..05c421f 100644 --- a/NPMK/Dependent Functions/getFile.ini +++ b/NPMK/Dependent Functions/getFile.ini @@ -1 +1 @@ -/Users/kianabc/Google Drive/Downloads/ \ No newline at end of file +/Users/kianabc/Documents/Sample Data/The Most Perfect Data in the WWWorld/sampleData/ \ No newline at end of file diff --git a/NPMK/Dependent Functions/parseCCF.m b/NPMK/Dependent Functions/parseCCF.m index 9caf9b4..c5531f0 100644 --- a/NPMK/Dependent Functions/parseCCF.m +++ b/NPMK/Dependent Functions/parseCCF.m @@ -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 @@ -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); diff --git a/NPMK/NSx Utilities/openNSxHL.m b/NPMK/NSx Utilities/openNSxHL.m index e82aa51..6f7ab2f 100644 --- a/NPMK/NSx Utilities/openNSxHL.m +++ b/NPMK/NSx Utilities/openNSxHL.m @@ -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 @@ -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 '.']); @@ -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); \ No newline at end of file diff --git a/NPMK/Versions.txt b/NPMK/Versions.txt index 7726fda..680b4b3 100644 --- a/NPMK/Versions.txt +++ b/NPMK/Versions.txt @@ -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 + diff --git a/NPMK/openNEV.m b/NPMK/openNEV.m index cd96661..76c7468 100644 --- a/NPMK/openNEV.m +++ b/NPMK/openNEV.m @@ -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 @@ -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.');