Skip to content

Commit d5ed1c5

Browse files
committed
Modify ambiguous naming of well_size (ref #113)
1 parent 12e267e commit d5ed1c5

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

fractal/tasks/create_zarr_structure.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ def create_zarr_structure(
187187
mrf_path, mlf_path
188188
)
189189
# FIXME: hardcoded
190-
well_size = {"x": 2560, "y": 2160, "z": 10}
190+
image_size = {"x": 2560, "y": 2160}
191+
well_size_z = 10
191192

192193
# Extract pixel sizes
193194
pixel_size_z = site_metadata["pixel_size_z"][0]
@@ -347,7 +348,8 @@ def create_zarr_structure(
347348
# Prepare and write anndata table of FOV ROIs
348349
FOV_ROIs_table = prepare_FOV_ROI_table(
349350
site_metadata.loc[f"{row+column}"],
350-
well_size=well_size,
351+
image_size=image_size,
352+
well_size_z=well_size_z,
351353
)
352354
group_tables = group_FOV.create_group("tables/") # noqa: F841
353355
write_elem(group_tables, "FOV_ROI_table", FOV_ROIs_table)

fractal/tasks/lib_regions_of_interest.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,24 @@
1010

1111
def prepare_FOV_ROI_table(
1212
df: pd.DataFrame,
13-
well_size: Union[Dict, None] = None,
13+
image_size: Union[Dict, None] = None,
14+
well_size_z: int = None,
1415
) -> ad.AnnData:
15-
if well_size is None:
16-
raise Exception("Missing well_size arg in prepare_ROIs_table")
16+
17+
if image_size is None:
18+
raise Exception("Missing image_size arg in prepare_ROIs_table")
19+
if well_size_z is None:
20+
raise Exception("Missing well_size_z arg in prepare_ROIs_table")
1721

1822
# Reset reference values for coordinates
1923
df["x_micrometer"] -= df["x_micrometer"].min()
2024
df["y_micrometer"] -= df["y_micrometer"].min()
2125
df["z_micrometer"] -= df["z_micrometer"].min()
2226

2327
# Obtain box size in physical units
24-
df["len_x_micrometer"] = well_size["x"] * df["pixel_size_x"]
25-
df["len_y_micrometer"] = well_size["y"] * df["pixel_size_y"]
26-
df["len_z_micrometer"] = well_size["z"] * df["pixel_size_z"]
28+
df["len_x_micrometer"] = image_size["x"] * df["pixel_size_x"]
29+
df["len_y_micrometer"] = image_size["y"] * df["pixel_size_y"]
30+
df["len_z_micrometer"] = well_size_z * df["pixel_size_z"]
2731

2832
# Remove unused column
2933
df.drop("bit_depth", inplace=True, axis=1)

0 commit comments

Comments
 (0)