File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,8 @@ def create_zarr_structure(
187
187
mrf_path , mlf_path
188
188
)
189
189
# FIXME: hardcoded
190
- well_size = {"x" : 2560 , "y" : 2160 , "z" : 10 }
190
+ image_size = {"x" : 2560 , "y" : 2160 }
191
+ well_size_z = 10
191
192
192
193
# Extract pixel sizes
193
194
pixel_size_z = site_metadata ["pixel_size_z" ][0 ]
@@ -347,7 +348,8 @@ def create_zarr_structure(
347
348
# Prepare and write anndata table of FOV ROIs
348
349
FOV_ROIs_table = prepare_FOV_ROI_table (
349
350
site_metadata .loc [f"{ row + column } " ],
350
- well_size = well_size ,
351
+ image_size = image_size ,
352
+ well_size_z = well_size_z ,
351
353
)
352
354
group_tables = group_FOV .create_group ("tables/" ) # noqa: F841
353
355
write_elem (group_tables , "FOV_ROI_table" , FOV_ROIs_table )
Original file line number Diff line number Diff line change 10
10
11
11
def prepare_FOV_ROI_table (
12
12
df : pd .DataFrame ,
13
- well_size : Union [Dict , None ] = None ,
13
+ image_size : Union [Dict , None ] = None ,
14
+ well_size_z : int = None ,
14
15
) -> 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" )
17
21
18
22
# Reset reference values for coordinates
19
23
df ["x_micrometer" ] -= df ["x_micrometer" ].min ()
20
24
df ["y_micrometer" ] -= df ["y_micrometer" ].min ()
21
25
df ["z_micrometer" ] -= df ["z_micrometer" ].min ()
22
26
23
27
# 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" ]
27
31
28
32
# Remove unused column
29
33
df .drop ("bit_depth" , inplace = True , axis = 1 )
You can’t perform that action at this time.
0 commit comments