Skip to content

Commit

Permalink
revert hcs position label parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ieivanov committed Oct 25, 2023
1 parent b323a8f commit 0bd9127
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions iohub/reader_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def hcs_position_labels(self):
Returns
-------
list[tuple[str, str, str]]
FOV name paths, e.g. ('A', '1', '0') or ('0', '0', '1')
FOV name paths, e.g. ('A', '1', '0') or ('0', '1', '000000')
"""
if not self.stage_positions:
raise ValueError("Stage position metadata not available.")
Expand All @@ -133,15 +133,15 @@ def hcs_position_labels(self):
except Exception:
try:
# Look for "'1-Pos000_000', '2-Pos000_001', ... "
# and split into ('1', 'Pos000_000'), ...
# and split into ('1', '000_000'), ...
labels = [
pos["Label"].split("-Pos") for pos in self.stage_positions
]
# split '000_000' into ('000', '000')
# and remove leading zeros so output is ('0', '0', '0')
# remove underscore from FOV name, i.e. '000_000'
# collect all wells in row '0' so output is
# ('0', '1', '000000')
return [
(row, *[str(int(s)) for s in col_fov.split("_")])
for row, col_fov in labels
("0", col, fov.replace("_", "")) for col, fov in labels
]
except Exception:
labels = [pos.get("Label") for pos in self.stage_positions]
Expand Down

0 comments on commit 0bd9127

Please sign in to comment.