Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CorpusCallosum/shape/subsegment_contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,8 +880,8 @@ def transform_to_acpc_standard(
norms_product = np.linalg.norm(ac_pc_vec) * np.linalg.norm(posterior_vector)
theta = np.arccos(dot_product / norms_product)

# Determine the sign of the angle using cross product
cross_product = np.cross(ac_pc_vec, posterior_vector)
# Determine the sign of the angle using the signed z-component of the 2D cross product.
cross_product = ac_pc_vec[0] * posterior_vector[1] - ac_pc_vec[1] * posterior_vector[0]
if cross_product < 0:
theta = -theta

Expand Down
4 changes: 2 additions & 2 deletions CorpusCallosum/utils/mapping_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def correct_nodding(ac_pt: Vector2d, pc_pt: Vector2d) -> AffineMatrix3x3:
norms_product = np.linalg.norm(ac_pc_vec) * np.linalg.norm(posterior_vector)
theta = np.arccos(dot_product / norms_product)

# Determine the sign of the angle using cross product
cross_product = np.cross(ac_pc_vec, posterior_vector)
# Determine the sign of the angle using the signed z-component of the 2D cross product.
cross_product = ac_pc_vec[0] * posterior_vector[1] - ac_pc_vec[1] * posterior_vector[0]
if cross_product < 0:
theta = -theta

Expand Down