Skip to content

Commit

Permalink
add check for empty vol file
Browse files Browse the repository at this point in the history
  • Loading branch information
drombas committed Aug 30, 2024
1 parent b0d878e commit 2bd613a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/io/read_vol.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,20 @@
grid_type = fread(fid, 1, '*int32');
grid_offset = fread(fid, 1, '*int32');
spare = fread(fid, 1832, '*int8');


if isempty(version)
header = [];
segment = [];
bscan = [];
fundus = [];

if ~no_warning
warning('Unable to read the file, it may be empty.');
end

return;
end

if any([n_bscan n_ascan] > 10000) || any([n_bscan n_ascan] <= 0)
header = [];
segment = [];
Expand Down

0 comments on commit 2bd613a

Please sign in to comment.