Skip to content

Commit

Permalink
fixing loading from txt file
Browse files Browse the repository at this point in the history
  • Loading branch information
npeschke committed Sep 15, 2021
1 parent c5782e6 commit 79a0107
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cellfinder_core/tools/IO.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ def read_with_dask(path):
:return:
"""

filenames = glob.glob(os.path.join(path, "*.tif"))
if path.endswith(".txt"):
with open(path, "r") as f:
filenames = [line.rstrip() for line in f.readlines()]

else:
filenames = glob.glob(os.path.join(path, "*.tif"))

shape, dtype = get_tiff_meta(filenames[0])
lazy_arrays = [lazy_imread(fn) for fn in get_sorted_file_paths(filenames)]
Expand Down

0 comments on commit 79a0107

Please sign in to comment.