From f4237490cd40a6abc2f61e8834fbd4500ec90f31 Mon Sep 17 00:00:00 2001 From: William Patton Date: Tue, 15 Oct 2024 09:45:15 -0700 Subject: [PATCH] fix bug in `to_ndarray` causing memory problems full array was being requested in memory to check shape --- funlib/persistence/arrays/array.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/funlib/persistence/arrays/array.py b/funlib/persistence/arrays/array.py index 9f0a73f..122fb35 100644 --- a/funlib/persistence/arrays/array.py +++ b/funlib/persistence/arrays/array.py @@ -339,7 +339,7 @@ def to_ndarray(self, roi, fill_value=0): shape = roi.shape / self.voxel_size data = np.zeros( - self[self.roi].shape[: self.channel_dims] + shape, dtype=self.data.dtype + self.shape[: self.channel_dims] + shape, dtype=self.data.dtype ) if fill_value != 0: data[:] = fill_value