Skip to content

Commit

Permalink
Fix x & y switch in ROI tables
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Eglinger <jan.eglinger@fmi.ch>
  • Loading branch information
jluethi and imagejan committed Nov 8, 2023
1 parent 692f88c commit 1461e91
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/faim_hcs/MontageUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ def montage_grid_image_YX(data):
fov_rois.append(
(
_stage_label(d[1]),
pos_y * step_y * d[1]["spatial-calibration-y"],
pos_x * step_x * d[1]["spatial-calibration-x"],
pos_y * step_y * d[1]["spatial-calibration-y"],
0.0,
step_y * d[1]["spatial-calibration-y"],
step_x * d[1]["spatial-calibration-x"],
step_y * d[1]["spatial-calibration-y"],
1.0,
)
)
Expand Down Expand Up @@ -159,11 +159,11 @@ def sort_key(d):
fov_rois.append(
(
_stage_label(d[1]),
pos_y * d[1]["spatial-calibration-y"],
pos_x * d[1]["spatial-calibration-x"],
pos_y * d[1]["spatial-calibration-y"],
0.0,
d[0].shape[0] * d[1]["spatial-calibration-y"],
d[0].shape[1] * d[1]["spatial-calibration-x"],
d[0].shape[0] * d[1]["spatial-calibration-y"],
1.0,
)
)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_MetaSeriesUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_get_well_image_CYX_well_E07(files, roi_columns):

assert list(roi_tables["FOV_ROI_table"].columns) == roi_columns
assert len(roi_tables["FOV_ROI_table"]) == 2
target_values = [0.0, 699.8016, 0.0, 699.8016, 699.8016, 1.0]
target_values = [699.8016, 0.0, 0.0, 699.8016, 699.8016, 1.0]
assert (
roi_tables["FOV_ROI_table"].loc["Site 2"].values.flatten().tolist()
== target_values
Expand Down Expand Up @@ -142,7 +142,7 @@ def test_get_well_image_ZCYX(files):

assert list(roi_tables["FOV_ROI_table"].columns) == roi_columns
assert len(roi_tables["FOV_ROI_table"]) == 2
target_values = [0.0, 699.8016, 0.0, 699.8016, 699.8016, z_len[well]]
target_values = [699.8016, 0.0, 0.0, 699.8016, 699.8016, z_len[well]]
assert (
roi_tables["FOV_ROI_table"].loc["Site 2"].values.flatten().tolist()
== target_values
Expand Down
4 changes: 2 additions & 2 deletions tests/test_Zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ def test_write_cyx_image_to_well(self):
assert list(df_fov.columns) == roi_columns
assert len(df_fov) == 2
target_values = [
0.0,
699.8015747070312,
0.0,
0.0,
699.8015747070312,
699.8015747070312,
1.0,
Expand Down Expand Up @@ -416,9 +416,9 @@ def test_write_czyx_image_to_well(self):
assert list(df_fov.columns) == roi_columns
assert len(df_fov) == 2
target_values = [
0.0,
699.8015747070312,
0.0,
0.0,
699.8015747070312,
699.8015747070312,
45.18000030517578,
Expand Down

0 comments on commit 1461e91

Please sign in to comment.