Skip to content

Commit

Permalink
allow angle change to take into consideration bad_sections
Browse files Browse the repository at this point in the history
  • Loading branch information
PolarBean authored Nov 16, 2024
1 parent be7b987 commit 162baae
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions DeepSlice/coord_post_processing/angle_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,16 @@ def propagate_angles(df, method, species):
:rtype: pandas.DataFrame
"""
# get the angles for each section in the dataset
DV_angle_list, ML_angle_list = calculate_angles(df)
if method == "weighted_mean":
depths = calculate_brain_center_depths(
df[["ox", "oy", "oz", "ux", "uy", "uz", "vx", "vy", "vz"]]
)
temp = df.copy()
if "bad_section" in temp:
temp = temp[~temp["bad_section"]]
DV_angle_list, ML_angle_list = calculate_angles(temp)


depths = calculate_brain_center_depths(
temp[["ox", "oy", "oz", "ux", "uy", "uz", "vx", "vy", "vz"]]
)

DV_angle, ML_angle = get_mean_angle(
DV_angle_list, ML_angle_list, method, depths, species
)
Expand Down

0 comments on commit 162baae

Please sign in to comment.