diff --git a/elf/io/image_stack_wrapper.py b/elf/io/image_stack_wrapper.py index 84f7c55..385d65b 100644 --- a/elf/io/image_stack_wrapper.py +++ b/elf/io/image_stack_wrapper.py @@ -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 @@ -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 diff --git a/elf/io/mrc_wrapper.py b/elf/io/mrc_wrapper.py index 0a060e1..215166f 100755 --- a/elf/io/mrc_wrapper.py +++ b/elf/io/mrc_wrapper.py @@ -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):