diff --git a/src/io/read_vol.m b/src/io/read_vol.m index d83f25a..5af6439 100644 --- a/src/io/read_vol.m +++ b/src/io/read_vol.m @@ -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 = [];