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