diff --git a/src/nd2/nd2file.py b/src/nd2/nd2file.py index cff2b33..8495415 100644 --- a/src/nd2/nd2file.py +++ b/src/nd2/nd2file.py @@ -365,8 +365,9 @@ def _dask_block(self, copy: bool, block_id: Tuple[int]) -> np.ndarray: f"Cannot get chunk {block_id} for single frame image." ) idx = 0 - data = self._get_frame(cast(int, idx))[(np.newaxis,) * ncoords] - return data.copy() if copy else data + data = self._get_frame(cast(int, idx)) + data = data.copy() if copy else data + return data[(np.newaxis,) * ncoords] finally: if was_closed: self.close() @@ -470,7 +471,7 @@ def _expand_coords(self, squeeze=True) -> dict: coords: Dict[str, Sized] = { AXIS.Y: np.arange(self.attributes.heightPx) * dy, - AXIS.X: np.arange(self.attributes.widthPx) * dx, + AXIS.X: np.arange(self.attributes.widthPx or 1) * dx, AXIS.CHANNEL: self._channel_names, AXIS.POSITION: ["XYPos:0"], # maybe overwritten below }