Skip to content

Commit

Permalink
NUM_HEADER_BYTES = 1024
Browse files Browse the repository at this point in the history
  • Loading branch information
kouichi-c-nakamura committed Aug 9, 2019
1 parent 5069874 commit 436dc61
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions load_open_ephys_data.m
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,6 @@
end

elseif ~isempty(range_pts)

%TODO

if (version >= 0.1)
if version >= 0.2
Expand All @@ -288,7 +286,7 @@
'uint16',1,'recNum';...
'int16',[SAMPLES_PER_RECORD, 1],'block';...
'uint8',[1, 10],'marker'},...
'Offset',1024,'Repeat',Inf);
'Offset',NUM_HEADER_BYTES,'Repeat',Inf);

else

Expand All @@ -297,7 +295,7 @@
'uint16',1,'nsamples';...
'int16',[SAMPLES_PER_RECORD, 1],'block';...
'uint8',[1, 10],'marker'},...
'Offset',1024,'Repeat',Inf); %TODO not tested
'Offset',NUM_HEADER_BYTES,'Repeat',Inf); %TODO not tested

end
else
Expand All @@ -306,10 +304,10 @@
'int16',1,'nsamples';...
'int16',[SAMPLES_PER_RECORD, 1],'block';...
'uint8',[1, 10],'marker'},...
'Offset',1024,'Repeat',Inf); %TODO not tested
'Offset',NUM_HEADER_BYTES,'Repeat',Inf); %TODO not tested
end

tf = false(length(m.Data)*1024,1);
tf = false(length(m.Data)*SAMPLES_PER_RECORD,1);
tf(range_pts) = true;

Cblk = cell(length(m.Data),1);
Expand All @@ -327,7 +325,7 @@

if any(tf(SAMPLES_PER_RECORD*(i-1)+1:SAMPLES_PER_RECORD*i))

Cblk{i} = m.Data(i).block(tf(1024*(i-1)+1:SAMPLES_PER_RECORD*i));
Cblk{i} = m.Data(i).block(tf(SAMPLES_PER_RECORD*(i-1)+1:SAMPLES_PER_RECORD*i));
Cts{i} = double(m.Data(i).timestamp);
Cns{i} = double(m.Data(i).nsamples);

Expand Down Expand Up @@ -369,9 +367,9 @@
ns = info.nsamples(k);

if version >= 0.2
offset = 1024 + RECORD_SIZE * (k-1) + 12;
offset = NUM_HEADER_BYTES + RECORD_SIZE * (k-1) + 12;
else
offset = 1024 + RECORD_SIZE * (k-1) + 10;
offset = NUM_HEADER_BYTES + RECORD_SIZE * (k-1) + 10;
end

status = fseek(fid,offset,'bof');
Expand Down

0 comments on commit 436dc61

Please sign in to comment.