diff --git a/.gitignore b/.gitignore index fb6835d..a903a4f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /.pytest_cache/ /ndbioimage/_version.py /ndbioimage/jars +/tests/files/* diff --git a/ndbioimage/__init__.py b/ndbioimage/__init__.py index aa86009..e0e0034 100755 --- a/ndbioimage/__init__.py +++ b/ndbioimage/__init__.py @@ -521,6 +521,8 @@ class Imread(np.lib.mixins.NDArrayOperatorsMixin, metaclass=ABCMeta): self.cache = DequeDict(16) self._frame_decorator = None 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() @@ -721,7 +723,7 @@ class Imread(np.lib.mixins.NDArrayOperatorsMixin, metaclass=ABCMeta): s.append(f'pixel size: {1000 * self.pxsize_um:.2f} nm') if self.zstack and self.deltaz_um: 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') if self.timeseries and self.timeinterval: s.append(f'time interval: {self.timeinterval:.3f} s') diff --git a/ndbioimage/readers/seqread.py b/ndbioimage/readers/seqread.py index 50f64e7..380fabd 100644 --- a/ndbioimage/readers/seqread.py +++ b/ndbioimage/readers/seqread.py @@ -41,7 +41,7 @@ class Reader(Imread, ABC): @staticmethod def _can_open(path): - return isinstance(path, Path) and path.suffix == "" + return isinstance(path, Path) and path.is_dir() @cached_property def ome(self): @@ -107,7 +107,7 @@ class Reader(Imread, ABC): return ome 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}" else: path = self.path diff --git a/pyproject.toml b/pyproject.toml index c7f638c..adf0a4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ndbioimage" -version = "2023.7.2" +version = "2023.7.3" description = "Bio image reading, metadata and some affine registration." authors = ["W. Pomp "] license = "GPLv3"