@@ -84,11 +84,11 @@ def convert_ROI_table_to_indices(
84
84
ROI : ad .AnnData ,
85
85
level : int = 0 ,
86
86
coarsening_xy : int = 2 ,
87
- num_z_replicas : int = 1 ,
88
87
) -> List [List ]:
88
+
89
89
list_indices = []
90
90
91
- for FOV in ROI .obs_names :
91
+ for FOV in sorted ( ROI .obs_names ) :
92
92
93
93
# Extract data from anndata table
94
94
x_micrometer = ROI [FOV , "x_micrometer" ].X [0 , 0 ]
@@ -119,20 +119,7 @@ def convert_ROI_table_to_indices(
119
119
# FIXME: to be checked/tested
120
120
indices = list (map (math .floor , indices ))
121
121
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 )
137
124
138
125
return list_indices
0 commit comments