Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support falcon datasets with latest micromanager #237

Merged
merged 13 commits into from
Nov 12, 2024
5 changes: 4 additions & 1 deletion iohub/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ def _get_position_coords(self):
raise ValueError("Stage positions not available.")
for idx, pos in enumerate(self.reader.stage_positions):
stage_pos = (
pos.get("XYStage") or pos.get("XY") or pos.get("XY Stage")
pos.get("XYStage")
or pos.get("XY")
or pos.get("XY Stage")
or pos.get(pos.get("DefaultXYStage"))
)
if stage_pos is None:
raise ValueError(
Expand Down
27 changes: 21 additions & 6 deletions iohub/mm_fov.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,34 @@ def hcs_position_labels(self):
labels = [
pos["Label"].split("-Pos") for pos in self.stage_positions
]

# remove underscore from FOV name, i.e. '000_000'
# collect all wells in row '0' so output is
# ('0', '1', '000000')
return [
("0", col, fov.replace("_", "")) for col, fov in labels
]
except Exception:
labels = [pos.get("Label") for pos in self.stage_positions]
raise ValueError(
"HCS position labels are in the format of "
"'A1-Site_0', 'H12-Site_1', or '1-Pos000_000' "
f"Got labels {labels}"
)
try:
# Look for "'Pos-1-000_000', 'Pos-2-000_001', ... "
# and split into ('1', '000_000'), ...
# New format following
# https://github.com/micro-manager/micro-manager/pull/1897
labels = [
pos["Label"].split("Pos-")[1].split("-")
for pos in self.stage_positions
]
return [
("0", col, fov.replace("_", "")) for col, fov in labels
]

except Exception:
labels = [pos.get("Label") for pos in self.stage_positions]
raise ValueError(
"HCS position labels are in the format of "
"'A1-Site_0', 'H12-Site_1', or '1-Pos000_000', "
f"or 'Pos-1-000_000'. Got labels {labels}"
)

@property
def zyx_scale(self) -> tuple[float, float, float]:
Expand Down
Loading