Skip to content

Commit

Permalink
Fix reading Dragonfly non-OpenCell datasets with incomplete metadata (#…
Browse files Browse the repository at this point in the history
…268)

* fallback if the same MM version is not used with opencell

* fallback for no positions

* fix type error
  • Loading branch information
ziw-liu authored Feb 4, 2025
1 parent d37dea5 commit fe642a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions iohub/mmstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def _set_mm_meta(self, mm_meta: dict) -> None:
# acquisition script on the Dragonfly miroscope
elif (
mm_version == "2.0.1 20220920"
and self._mm_meta["Summary"]["Prefix"] == "raw_data"
and self._mm_meta["Summary"].get("Prefix", None) == "raw_data"
):
files = natsorted(self.root.glob("*.ome.tif"))
self.positions = len(files) # not all positions are saved
Expand All @@ -238,7 +238,7 @@ def _set_mm_meta(self, mm_meta: dict) -> None:
self.channel_names.append(ch)

else:
if self._mm_meta["Summary"]["Positions"] > 1:
if self._mm_meta["Summary"].get("Positions", 1) > 1:
self._stage_positions = []

for p in range(self._mm_meta["Summary"]["Positions"]):
Expand Down

0 comments on commit fe642a9

Please sign in to comment.