Skip to content

Commit 00e011a

Browse files
committed
Remove num_z_replicas argument from convert_ROI_table_to_indices (ref #112 #113)
1 parent 32fbf55 commit 00e011a

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

fractal/tasks/lib_regions_of_interest.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ def convert_ROI_table_to_indices(
8484
ROI: ad.AnnData,
8585
level: int = 0,
8686
coarsening_xy: int = 2,
87-
num_z_replicas: int = 1,
8887
) -> List[List]:
88+
8989
list_indices = []
9090

91-
for FOV in ROI.obs_names:
91+
for FOV in sorted(ROI.obs_names):
9292

9393
# Extract data from anndata table
9494
x_micrometer = ROI[FOV, "x_micrometer"].X[0, 0]
@@ -119,20 +119,7 @@ def convert_ROI_table_to_indices(
119119
# FIXME: to be checked/tested
120120
indices = list(map(math.floor, indices))
121121

122-
# Default behavior
123-
if num_z_replicas == 1:
124-
list_indices.append(indices)
125-
# Create 3D stack of 2D ROIs
126-
else:
127-
# Check that this ROI is 2D, i.e. it has z indices [0:1]
128-
if start_z != 0 or end_z != 1:
129-
raise Exception(
130-
f"ERROR: num_z_replicas={num_z_replicas}, "
131-
f"but [start_z,end_z]={[start_z,end_z]}"
132-
)
133-
# Loop over Z planes
134-
for z_start in range(num_z_replicas):
135-
indices[0:2] = [z_start, z_start + 1]
136-
list_indices.append(indices[:])
122+
# Append ROI indices to to list
123+
list_indices.append(indices)
137124

138125
return list_indices

0 commit comments

Comments
 (0)