From fafefbc36652b191ba694aa4a5f84306dc276656 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Al=C3=A1n=20Mu=C3=B1oz?= <alan.munoz@ed.ac.uk>
Date: Fri, 17 Mar 2023 10:34:25 +0000
Subject: [PATCH] fix(tiler): bak_ref_channel only used upon Nonetyp

---
 src/aliby/tile/tiler.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/aliby/tile/tiler.py b/src/aliby/tile/tiler.py
index ff90624b..c336c674 100644
--- a/src/aliby/tile/tiler.py
+++ b/src/aliby/tile/tiler.py
@@ -231,13 +231,14 @@ class Tiler(StepABC):
         self.image = image
         self._metadata = metadata
         self.channels = metadata.get(
-            "channels", list(range(metadata.get("size_c", 0)))
-        )
-        self.ref_channel = (
-            self.get_channel_index(parameters.ref_channel)
-            or self.backup_ref_channel
+            "channels",
+            list(range(metadata.get("size_c", 0))),
         )
 
+        self.ref_channel = self.get_channel_index(parameters.ref_channel)
+        if self.ref_channel is None:
+            self.ref_channel = self.backup_ref_channel
+
         self.ref_channel = self.get_channel_index(parameters.ref_channel)
         self.tile_locs = tile_locs
         try:
-- 
GitLab