Skip to content

Commit 0d3adee

Browse files
committed
Expand check to tiff stacks
1 parent a1b09ef commit 0d3adee

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

python/ouroboros/pipeline/backproject_pipeline.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,13 @@ def _process(self, input_data: any) -> tuple[any, None] | tuple[None, any]:
9898

9999
cannot_memmap = False
100100
try:
101-
_ = tifffile.memmap(straightened_volume_path, mode="r")
101+
if Path(straightened_volume_path).is_dir():
102+
_ = tifffile.memmap(next(Path(straightened_volume_path).iterdir()), mode="r")
103+
else:
104+
_ = tifffile.memmap(straightened_volume_path, mode="r")
102105
except: # noqa: E722
103106
# Check here is because memmap needs certain types of dataoffsets, which aren't always there
104-
# separate to compression.
107+
# separate to compression.
105108
cannot_memmap = True
106109

107110
if is_compressed or cannot_memmap:

0 commit comments

Comments
 (0)