Skip to content

Commit

Permalink
Merge pull request #69 from BlackrockNeurotech/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
dkluger authored Jun 13, 2024
2 parents d392687 + c53dc85 commit fd55c16
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions NPMK/openNEV.m
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,9 @@
NEV.MetaTags = struct('Subject', [], 'Experimenter', [], 'DateTime', [],...
'SampleRes',[],'Comment',[],'FileTypeID',[],'Flags',[], 'openNEVver', [], ...
'DateTimeRaw', [], 'FileSpec', [], 'PacketBytes', [], 'HeaderOffset', [], ...
'DataDuration', [], 'DataDurationSec', [], 'PacketCount', [], ...
'TimeRes', [], 'Application', [], 'Filename', [], 'FilePath', []);
'PacketCount', [], 'TimeRes', [], 'Application', [], 'Filename', [], 'FilePath', []);
% 'DataDuration', [], 'DataDurationSec', [],

NEV.Data = struct('SerialDigitalIO', [], 'Spikes', [], 'Comments', [], 'VideoSync', [], ...
'Tracking', [], 'TrackingEvents', [], 'PatientTrigger', [], 'Reconfig', []);
NEV.Data.Spikes = struct('TimeStamp', [],'Electrode', [],...
Expand Down Expand Up @@ -473,11 +474,12 @@
Trackers.fBasicHeader = ftell(FID); %#ok<NASGU>

% Calculating the length of the data
currentLocation = ftell(FID);
fseek(FID, -Trackers.countPacketBytes, 'eof');
NEV.MetaTags.DataDuration = fread(FID, 1, 'uint32=>double');
NEV.MetaTags.DataDurationSec = double(NEV.MetaTags.DataDuration) / double(NEV.MetaTags.SampleRes);
fseek(FID, currentLocation, 'bof');
% removing the dataduration fields until further notice - DK
% currentLocation = ftell(FID);
% fseek(FID, -Trackers.countPacketBytes, 'eof');
% NEV.MetaTags.DataDuration = fread(FID, 1, 'uint32=>double');
% NEV.MetaTags.DataDurationSec = double(NEV.MetaTags.DataDuration) / double(NEV.MetaTags.SampleRes);
% fseek(FID, currentLocation, 'bof');

%% Reading ExtendedHeader information
for ii=1:Trackers.countExtHeader
Expand Down Expand Up @@ -957,7 +959,7 @@
disp( '*** FILE INFO **************************');
disp(['File Name = ' NEV.MetaTags.Filename]);
disp(['Filespec = ' NEV.MetaTags.FileSpec]);
disp(['Data Duration (min) = ' num2str(round(NEV.MetaTags.DataDuration/NEV.MetaTags.SampleRes/60))]);
% disp(['Data Duration (min) = ' num2str(round(NEV.MetaTags.DataDuration/NEV.MetaTags.SampleRes/60))]);
disp(['Packet Counts = ' num2str(Trackers.countDataPacket)]);
disp(' ');
disp( '*** BASIC HEADER ***********************');
Expand Down

0 comments on commit fd55c16

Please sign in to comment.