Skip to content

Commit e9a4774

Browse files
committed
Filter out non-tiff files from folder backproject inputs.
1 parent 6398786 commit e9a4774

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/ouroboros/pipeline/backproject_pipeline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ def _process(self,
7777
return (f"The straightened volume does not exist at {straightened_volume_path}.")
7878

7979
if Path(straightened_volume_path).is_dir():
80-
with tifffile.TiffFile(next(Path(straightened_volume_path).iterdir())) as tif:
80+
with tifffile.TiffFile(next(get_sorted_tif_files(straightened_volume_path))) as tif:
8181
is_compressed = bool(tif.pages[0].compression)
8282
# tiff format check to add
83-
FPShape = FrontProjStack(D=len(list(Path(straightened_volume_path).iterdir())),
83+
FPShape = FrontProjStack(D=len(get_sorted_tif_files(straightened_volume_path)),
8484
V=tif.pages[0].shape[0], U=tif.pages[0].shape[1])
8585
channels = 1 if len(tif.pages[0].shape) < 3 else tif.pages[0].shape[-1]
8686
else:
@@ -100,7 +100,7 @@ def _process(self,
100100
cannot_memmap = False
101101
try:
102102
if Path(straightened_volume_path).is_dir():
103-
_ = tifffile.memmap(next(Path(straightened_volume_path).iterdir()), mode="r")
103+
_ = tifffile.memmap(next(get_sorted_tif_files(straightened_volume_path)), mode="r")
104104
else:
105105
_ = tifffile.memmap(straightened_volume_path, mode="r")
106106
except: # noqa: E722

0 commit comments

Comments
 (0)