Skip to content

Commit 162baae

Browse files
authored
allow angle change to take into consideration bad_sections
1 parent be7b987 commit 162baae

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Diff for: DeepSlice/coord_post_processing/angle_methods.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,16 @@ def propagate_angles(df, method, species):
105105
:rtype: pandas.DataFrame
106106
"""
107107
# get the angles for each section in the dataset
108-
DV_angle_list, ML_angle_list = calculate_angles(df)
109-
if method == "weighted_mean":
110-
depths = calculate_brain_center_depths(
111-
df[["ox", "oy", "oz", "ux", "uy", "uz", "vx", "vy", "vz"]]
112-
)
108+
temp = df.copy()
109+
if "bad_section" in temp:
110+
temp = temp[~temp["bad_section"]]
111+
DV_angle_list, ML_angle_list = calculate_angles(temp)
112+
113+
114+
depths = calculate_brain_center_depths(
115+
temp[["ox", "oy", "oz", "ux", "uy", "uz", "vx", "vy", "vz"]]
116+
)
117+
113118
DV_angle, ML_angle = get_mean_angle(
114119
DV_angle_list, ML_angle_list, method, depths, species
115120
)

0 commit comments

Comments
 (0)