From e6535658b12faa9f50305f7bc821f2d83b449369 Mon Sep 17 00:00:00 2001
From: Andrey  ARISTOV <andrey.aristov@pasteur.fr>
Date: Tue, 30 Apr 2024 15:33:59 +0200
Subject: [PATCH] remove extra file read

---
 combine.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/combine.py b/combine.py
index 3f588c8..4ac5f93 100644
--- a/combine.py
+++ b/combine.py
@@ -7,8 +7,8 @@ import nd2
 def combine(BF_2D_path:str, TRITC_3D_path:str, out_zarr_path:str):
     bd2d = nd2.ND2File(BF_2D_path).to_dask()
     print('Opened BF:', bd2d)
-    fd3d = nd2.ND2File(TRITC_3D_path).to_dask()
-    z_axis = nd2.ND2File(TRITC_3D_path).sizes.index("Z")
+    fd3d = (nd2_handle := nd2.ND2File(TRITC_3D_path)).to_dask()
+    z_axis = nd2_handle.sizes.index("Z")
     print('Opened TRITC:', fd3d)
     fd2d = fd3d.max(axis=z_axis)
     c_axis = fd2d.ndim - 2
-- 
GitLab