From fcf878b679cb15b2dcca2129d1209204584a5de7 Mon Sep 17 00:00:00 2001 From: alessandrofelder Date: Wed, 15 May 2024 13:46:44 +0100 Subject: [PATCH] be permissive around tiff axes - just log --- brainglobe_utils/IO/image/load.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/brainglobe_utils/IO/image/load.py b/brainglobe_utils/IO/image/load.py index 9c11e8d..99ecbee 100644 --- a/brainglobe_utils/IO/image/load.py +++ b/brainglobe_utils/IO/image/load.py @@ -777,10 +777,12 @@ def read_z_stack(path): ) axes = tiff.series[0].axes.lower() - if set(axes) != {"x", "y", "z"} or axes[0] != "z": - raise ValueError( - f"Attempted to load {path} but didn't find a zyx or " - f"zxy stack. Found {axes} axes" + if set(axes) != {"x", "y", "z"}: + # log that metadata does not specify expected axes + logging.debug( + f"Axis metadata is {axes}, " + "which is not the expected set of x,y,z in any order. " + "Assume z,y,x" ) return tifffile.imread(path)