Skip to content

Commit 084e47c

Browse files
committed
Remove obsolete functions
1 parent 62bf123 commit 084e47c

File tree

2 files changed

+0
-82
lines changed

2 files changed

+0
-82
lines changed

fractal_tasks_core/roi/_overlaps_common.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -62,35 +62,6 @@ def is_overlapping_2D(
6262
return overlap_x and overlap_y
6363

6464

65-
def is_overlapping_3D(
66-
box1: Sequence[float], box2: Sequence[float], tol: float = 1e-10
67-
) -> bool:
68-
"""
69-
Given two three-dimensional boxes, finds whether they overlap.
70-
71-
This is based on https://stackoverflow.com/a/70023212/19085332, and we
72-
additionally use a finite tolerance for floating-point comparisons.
73-
74-
Args:
75-
box1: The boundaries of the first box, written as
76-
`[x_min, y_min, z_min, x_max, y_max, z_max]`.
77-
box2: The boundaries of the second box, written as
78-
`[x_min, y_min, z_min, x_max, y_max, z_max]`.
79-
tol: Finite tolerance for floating-point comparisons.
80-
"""
81-
82-
overlap_x = is_overlapping_1D(
83-
[box1[0], box1[3]], [box2[0], box2[3]], tol=tol
84-
)
85-
overlap_y = is_overlapping_1D(
86-
[box1[1], box1[4]], [box2[1], box2[4]], tol=tol
87-
)
88-
overlap_z = is_overlapping_1D(
89-
[box1[2], box1[5]], [box2[2], box2[5]], tol=tol
90-
)
91-
return overlap_x and overlap_y and overlap_z
92-
93-
9465
def _is_overlapping_1D_int(
9566
line1: Sequence[int],
9667
line2: Sequence[int],

fractal_tasks_core/roi/v1_overlaps.py

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
from fractal_tasks_core.roi._overlaps_common import _is_overlapping_3D_int
2424
from fractal_tasks_core.roi._overlaps_common import is_overlapping_1D
2525
from fractal_tasks_core.roi._overlaps_common import is_overlapping_2D
26-
from fractal_tasks_core.roi._overlaps_common import is_overlapping_3D
2726

2827

2928
logger = logging.getLogger(__name__)
@@ -52,58 +51,6 @@ def get_overlapping_pair(
5251
return False
5352

5453

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-
10754
def apply_shift_in_one_direction(
10855
tmp_df_well: pd.DataFrame,
10956
line_1: Sequence[float],

0 commit comments

Comments
 (0)