From 43bd2ae49d056e3388d605167f8c8ee253cee45e Mon Sep 17 00:00:00 2001 From: dlegland Date: Thu, 22 Aug 2019 13:12:35 +0200 Subject: [PATCH] imStacks: cleanup image reading functions --- matImage/imStacks/imFileInfo.m | 1 - matImage/imStacks/metaImageInfo.m | 6 +++--- matImage/imStacks/vgiStackInfo.m | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/matImage/imStacks/imFileInfo.m b/matImage/imStacks/imFileInfo.m index cc7ce79..4ee923c 100644 --- a/matImage/imStacks/imFileInfo.m +++ b/matImage/imStacks/imFileInfo.m @@ -38,4 +38,3 @@ error(['Can not manage file ending by ' ext]); end - \ No newline at end of file diff --git a/matImage/imStacks/metaImageInfo.m b/matImage/imStacks/metaImageInfo.m index 52e21a0..1fc0c42 100644 --- a/matImage/imStacks/metaImageInfo.m +++ b/matImage/imStacks/metaImageInfo.m @@ -146,9 +146,9 @@ % extract each possible tag switch tag - % First, parse required tags + % First parse mandatory tags case 'NDims' - % number of dimensions. Used for initializing data structure + % number of dimensions. Used for initializing data structure. nd = parseInteger(string); info.NDims = nd; @@ -262,7 +262,7 @@ tline = fgetl(f); end -elseif ~isempty(strfind(string, ' ')) +elseif contains(string, ' ') % If filename contains spaces, it is parsed to extract indices C = textscan(string, '%s %d %d %d'); pattern = C{1}{1}; diff --git a/matImage/imStacks/vgiStackInfo.m b/matImage/imStacks/vgiStackInfo.m index ff0bc1f..7103b1c 100644 --- a/matImage/imStacks/vgiStackInfo.m +++ b/matImage/imStacks/vgiStackInfo.m @@ -95,7 +95,7 @@ elseif strcmpi(key, 'bitsperelement') info.bitDepth = str2double(value); if info.bitDepth ~= 16 - error('Only 16 bits per element are currently supported, not %d', bitDepth); + error('Only 16 bits per element are currently supported, not %d', info.bitDepth); end elseif strcmp(key, 'Name')