From 76d3d36e237e3b818d45d4577447ecc6aefddeec Mon Sep 17 00:00:00 2001 From: clemsgrs Date: Thu, 1 Jan 2026 16:52:02 +0000 Subject: [PATCH] fix issue when only a subset of mask paths are provided --- hs2p/utils/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hs2p/utils/utils.py b/hs2p/utils/utils.py index 09aee77..23d49a7 100644 --- a/hs2p/utils/utils.py +++ b/hs2p/utils/utils.py @@ -116,9 +116,9 @@ def load_csv(cfg): elif "slide_path" in df.columns: wsi_paths = [Path(x) for x in df.slide_path.values.tolist()] if "mask_path" in df.columns: - mask_paths = [Path(x) for x in df.mask_path.values.tolist()] + mask_paths = [Path(x) if x is not None and not pd.isna(x) else None for x in df.mask_path.values.tolist()] elif "segmentation_mask_path" in df.columns: - mask_paths = [Path(x) for x in df.segmentation_mask_path.values.tolist()] + mask_paths = [Path(x) if x is not None and not pd.isna(x) else None for x in df.segmentation_mask_path.values.tolist()] else: mask_paths = [None for _ in wsi_paths] return wsi_paths, mask_paths