Skip to content

Commit

Permalink
Update to io files (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
constantinpape authored Mar 23, 2024
1 parent 10b2846 commit 340772a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions elf/io/image_stack_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def _load_roi_from_slices(self, roi):
def _load_and_write_image(z):
z_abs = z + z0
im = self._read_image(z_abs)
assert im.shape == self.im_shape
assert im.shape == self.im_shape, f"{im.shape}, {self.im_shape}"
data[z] = im[im_roi]

# load the slices and write them into the output data
Expand Down Expand Up @@ -209,7 +209,8 @@ def is_tif_slices(files):
if ext.lower() not in TifStackDataset.tif_exts:
return False
try:
tifffile.memmap(f0, mode="r")
for ff in files:
tifffile.memmap(ff, mode="r")
except ValueError:
return False
return True
Expand Down
2 changes: 1 addition & 1 deletion elf/io/mrc_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def shape(self):
return self._data.shape

def __getitem__(self, key):
return self._data[key]
return self._data[key].copy()

@property
def size(self):
Expand Down

0 comments on commit 340772a

Please sign in to comment.