Skip to content

Commit

Permalink
vfv: fix peek
Browse files Browse the repository at this point in the history
sl -> tuple(sl)
  • Loading branch information
gmazzamuto committed Feb 16, 2021
1 parent 16ad254 commit 330b7a2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions zetastitcher/fuse/virtual_fused_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class VirtualFusedVolume:
>>> vfv.peek[40, ..., 1000:1500, 1800:2400]
[
('0000_0000.tiff', [slice(40, 41, 1), slice(1000, 1500, 1), slice(1800, 2048, 1)]),
('0100_0000.tiff', [slice(40, 41, 1), slice(1000, 1500, 1), slice(0, 453, 1)]),
('0000_0000.tiff', (slice(40, 41, 1), slice(1000, 1500, 1), slice(1800, 2048, 1))),
('0100_0000.tiff', (slice(40, 41, 1), slice(1000, 1500, 1), slice(0, 453, 1))),
]
"""
def __init__(self, file_or_matrix):
Expand Down Expand Up @@ -200,9 +200,8 @@ def __init__(self, obj):

def __getitem__(self, item):
df, myitem, X_min, X_stop, steps, flip_axis = self.obj._compute_vars(item)
sl = myitem[:]

return [(index, sl) for index, _, sl in self.obj._my_gen(df, X_min, X_stop, steps, sl)]
return [(index, tuple(sl)) for index, _, sl in self.obj._my_gen(df, X_min, X_stop, steps, myitem[:])]

return WrapperClass(self)

Expand Down Expand Up @@ -234,9 +233,7 @@ def __getitem__(self, item):
)
t.start()

sl = myitem[:]

for index, Xs, sl in self._my_gen(df, X_min, X_stop, steps, sl):
for index, Xs, sl in self._my_gen(df, X_min, X_stop, steps, myitem[:]):
logger.info('loading {}\t{}'.format(index, sl))
with InputFile(os.path.join(self.path, index)) as f:
f.squeeze = False
Expand Down

0 comments on commit 330b7a2

Please sign in to comment.