|
23 | 23 | from fractal_tasks_core.roi._overlaps_common import _is_overlapping_3D_int |
24 | 24 | from fractal_tasks_core.roi._overlaps_common import is_overlapping_1D |
25 | 25 | from fractal_tasks_core.roi._overlaps_common import is_overlapping_2D |
26 | | -from fractal_tasks_core.roi._overlaps_common import is_overlapping_3D |
27 | 26 |
|
28 | 27 |
|
29 | 28 | logger = logging.getLogger(__name__) |
@@ -52,58 +51,6 @@ def get_overlapping_pair( |
52 | 51 | return False |
53 | 52 |
|
54 | 53 |
|
55 | | -def get_overlapping_pairs_3D( |
56 | | - tmp_df: pd.DataFrame, |
57 | | - full_res_pxl_sizes_zyx: Sequence[float], |
58 | | -): |
59 | | - """ |
60 | | - Finds the indices for the all overlapping FOVs pair, in three dimensions. |
61 | | -
|
62 | | - Note: the returned indices are positional indices, starting from 0. |
63 | | -
|
64 | | - Args: |
65 | | - tmp_df: Dataframe with columns `{x,y,z}_micrometer` and |
66 | | - `len_{x,y,z}_micrometer`. |
67 | | - full_res_pxl_sizes_zyx: TBD |
68 | | - """ |
69 | | - |
70 | | - tol = 1e-10 |
71 | | - if tol > min(full_res_pxl_sizes_zyx) / 1e3: |
72 | | - raise ValueError(f"{tol=} but {full_res_pxl_sizes_zyx=}") |
73 | | - |
74 | | - new_tmp_df = tmp_df.copy() |
75 | | - |
76 | | - new_tmp_df["x_micrometer_max"] = ( |
77 | | - new_tmp_df["x_micrometer"] + new_tmp_df["len_x_micrometer"] |
78 | | - ) |
79 | | - new_tmp_df["y_micrometer_max"] = ( |
80 | | - new_tmp_df["y_micrometer"] + new_tmp_df["len_y_micrometer"] |
81 | | - ) |
82 | | - new_tmp_df["z_micrometer_max"] = ( |
83 | | - new_tmp_df["z_micrometer"] + new_tmp_df["len_z_micrometer"] |
84 | | - ) |
85 | | - # Remove columns which are not necessary for overlap checks |
86 | | - list_columns = [ |
87 | | - "len_x_micrometer", |
88 | | - "len_y_micrometer", |
89 | | - "len_z_micrometer", |
90 | | - "label", |
91 | | - ] |
92 | | - new_tmp_df.drop(labels=list_columns, axis=1, inplace=True) |
93 | | - |
94 | | - # Loop over all pairs, and construct list of overlapping ones |
95 | | - num_lines = len(new_tmp_df.index) |
96 | | - overlapping_list = [] |
97 | | - for pos_ind_1 in range(num_lines): |
98 | | - for pos_ind_2 in range(pos_ind_1): |
99 | | - bbox_1 = new_tmp_df.iloc[pos_ind_1].to_numpy() |
100 | | - bbox_2 = new_tmp_df.iloc[pos_ind_2].to_numpy() |
101 | | - overlap = is_overlapping_3D(bbox_1, bbox_2, tol=tol) |
102 | | - if overlap: |
103 | | - overlapping_list.append((pos_ind_1, pos_ind_2)) |
104 | | - return overlapping_list |
105 | | - |
106 | | - |
107 | 54 | def apply_shift_in_one_direction( |
108 | 55 | tmp_df_well: pd.DataFrame, |
109 | 56 | line_1: Sequence[float], |
|
0 commit comments