Skip to content

Commit

Permalink
- read the correct metadata for series > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Wim Pomp committed Mar 18, 2024
1 parent 110cb6d commit 5345e38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions ndbioimage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ def __init__(self, path, dtype=None, axes=None):
self.open()
# extract some metadata from ome
instrument = self.ome.instruments[0] if self.ome.instruments else None
image = self.ome.images[0]
image = self.ome.images[self.series]
pixels = image.pixels
self.shape = pixels.size_y, pixels.size_x, pixels.size_c, pixels.size_z, pixels.size_t
self.dtype = pixels.type.value if dtype is None else dtype
Expand All @@ -1003,8 +1003,8 @@ def __init__(self, path, dtype=None, axes=None):
self.deltaz_um = None if self.deltaz is None else self.deltaz.to(self.ureg.um).m
else:
self.deltaz = self.deltaz_um = None
if self.ome.images[0].objective_settings:
self.objective = find(instrument.objectives, id=self.ome.images[0].objective_settings.id)
if self.ome.images[self.series].objective_settings:
self.objective = find(instrument.objectives, id=self.ome.images[self.series].objective_settings.id)
else:
self.objective = None
try:
Expand Down Expand Up @@ -1107,7 +1107,7 @@ def __init__(self, path, dtype=None, axes=None):
p = re.compile(r'(\d+):(\d+)$')
try:
self.track, self.detector = zip(*[[int(i) for i in p.findall(find(
self.ome.images[0].pixels.channels, id=f'Channel:{c}').detector_settings.id)[0]]
self.ome.images[self.series].pixels.channels, id=f'Channel:{c}').detector_settings.id)[0]]
for c in range(self.shape['c'])])
except Exception:
pass
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ndbioimage"
version = "2024.3.3"
version = "2024.3.4"
description = "Bio image reading, metadata and some affine registration."
authors = ["W. Pomp <w.pomp@nki.nl>"]
license = "GPLv3"
Expand Down

0 comments on commit 5345e38

Please sign in to comment.