From a6457ea497ab0f018744b67bde791f39241a753a Mon Sep 17 00:00:00 2001 From: Wim Pomp Date: Tue, 21 Nov 2023 16:08:57 +0100 Subject: [PATCH] - Slicing bugfix. --- README.md | 9 +++++---- ndbioimage/__init__.py | 3 +-- pyproject.toml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 24fc65c..6577c4f 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,12 @@ Exposes (bio) images as a numpy ndarray-like object, but without loading the whole image into memory, reading from the file only when needed. Some metadata is read -and stored in an ome structure. Additionally, it can automatically calculate an affine -transform that corrects for chromatic aberrations etc. and apply it on the fly to the image. +and stored in an [ome](https://genomebiology.biomedcentral.com/articles/10.1186/gb-2005-6-5-r47) structure. +Additionally, it can automatically calculate an affine transform that corrects for chromatic aberrations etc. and apply +it on the fly to the image. -Currently, supports imagej tif files, czi files, micromanager tif sequences and anything -bioformats can handle. +Currently, it supports imagej tif files, czi files, micromanager tif sequences and anything +[bioformats](https://www.openmicroscopy.org/bio-formats/) can handle. ## Installation diff --git a/ndbioimage/__init__.py b/ndbioimage/__init__.py index 3bfe301..24bac10 100755 --- a/ndbioimage/__init__.py +++ b/ndbioimage/__init__.py @@ -277,8 +277,7 @@ class Imread(np.lib.mixins.NDArrayOperatorsMixin, ABC): new_slice.append(s[e]) # TODO: check output dimensionality when requested shape in some dimension is 1 - if (all([isinstance(s, Number) for s in new_slice[:len(self.axes)]]) - and all([isinstance(s, Number) or s.size == 1 for s in new_slice[len(self.axes):]])): + if all([isinstance(s, Number) or a < 0 and s.size == 1 for s, a in zip(new_slice, axes_idx)]): return self.block(*new_slice).item() else: new = View(self) diff --git a/pyproject.toml b/pyproject.toml index b4970e2..2b0da3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ndbioimage" -version = "2023.11.0" +version = "2023.11.1" description = "Bio image reading, metadata and some affine registration." authors = ["W. Pomp "] license = "GPLv3"