Skip to content
Snippets Groups Projects

Load bigtiff

1 file
+ 5
1
Compare changes
  • Side-by-side
  • Inline
+ 5
1
@@ -66,10 +66,14 @@ class DataLoader:
@@ -66,10 +66,14 @@ class DataLoader:
If 'self.virtual_stack' is True, returns a numpy.memmap object.
If 'self.virtual_stack' is True, returns a numpy.memmap object.
"""
"""
 
# Get the number of TIFF series (some BigTIFF have multiple series)
 
with tifffile.TiffFile(path) as tif:
 
series = len(tif.series)
 
if self.virtual_stack:
if self.virtual_stack:
vol = tifffile.memmap(path)
vol = tifffile.memmap(path)
else:
else:
vol = tifffile.imread(path)
vol = tifffile.imread(path, key=range(series) if series>1 else None)
log.info("Loaded shape: %s", vol.shape)
log.info("Loaded shape: %s", vol.shape)
Loading