- fix seqread bug

This commit is contained in:
Wim Pomp
2023-07-20 10:22:55 +02:00
parent dbe80c495b
commit 0bd22d766a
4 changed files with 7 additions and 4 deletions

1
.gitignore vendored
View File

@@ -7,3 +7,4 @@
/.pytest_cache/ /.pytest_cache/
/ndbioimage/_version.py /ndbioimage/_version.py
/ndbioimage/jars /ndbioimage/jars
/tests/files/*

View File

@@ -521,6 +521,8 @@ class Imread(np.lib.mixins.NDArrayOperatorsMixin, metaclass=ABCMeta):
self.cache = DequeDict(16) self.cache = DequeDict(16)
self._frame_decorator = None self._frame_decorator = None
self.frameoffset = 0, 0 # how far apart the centers of frame and sensor are self.frameoffset = 0, 0 # how far apart the centers of frame and sensor are
self.flags = dict(C_CONTIGUOUS=False, F_CONTIGUOUS=False, OWNDATA=False, WRITEABLE=False,
ALIGNED=False, WRITEBACKIFCOPY=False, UPDATEIFCOPY=False)
self.open() self.open()
@@ -721,7 +723,7 @@ class Imread(np.lib.mixins.NDArrayOperatorsMixin, metaclass=ABCMeta):
s.append(f'pixel size: {1000 * self.pxsize_um:.2f} nm') s.append(f'pixel size: {1000 * self.pxsize_um:.2f} nm')
if self.zstack and self.deltaz_um: if self.zstack and self.deltaz_um:
s.append(f'z-interval: {1000 * self.deltaz_um:.2f} nm') s.append(f'z-interval: {1000 * self.deltaz_um:.2f} nm')
if self.exposuretime_s: if self.exposuretime_s and not all(e is None for e in self.exposuretime_s):
s.append(f'exposuretime: {self.exposuretime_s[0]:.2f} s') s.append(f'exposuretime: {self.exposuretime_s[0]:.2f} s')
if self.timeseries and self.timeinterval: if self.timeseries and self.timeinterval:
s.append(f'time interval: {self.timeinterval:.3f} s') s.append(f'time interval: {self.timeinterval:.3f} s')

View File

@@ -41,7 +41,7 @@ class Reader(Imread, ABC):
@staticmethod @staticmethod
def _can_open(path): def _can_open(path):
return isinstance(path, Path) and path.suffix == "" return isinstance(path, Path) and path.is_dir()
@cached_property @cached_property
def ome(self): def ome(self):
@@ -107,7 +107,7 @@ class Reader(Imread, ABC):
return ome return ome
def open(self): def open(self):
if not self.path.name.startswith("Pos"): if re.match(r'(?:\d+\-)?Pos.*', self.path.name) is None:
path = self.path / f"Pos{self.series}" path = self.path / f"Pos{self.series}"
else: else:
path = self.path path = self.path

View File

@@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "ndbioimage" name = "ndbioimage"
version = "2023.7.2" version = "2023.7.3"
description = "Bio image reading, metadata and some affine registration." description = "Bio image reading, metadata and some affine registration."
authors = ["W. Pomp <w.pomp@nki.nl>"] authors = ["W. Pomp <w.pomp@nki.nl>"]
license = "GPLv3" license = "GPLv3"