You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f"The markers defining the original_axis_global should be present in the static markers, got start: {original_axis_global.start.name} and end: {original_axis_global.end.name}"
If True, the longitudinal axis of the child segment is defined from the joint center markers to the distal markers.
829
+
If False, the longitudinal axis is defined from the distal markers to the joint center markers.
830
+
expected_rotation_axis_orientation: Axis
831
+
The expected orientation of the rotation axis (e.g., Axis.X, Axis.Y, or Axis.Z). This is used to make sure the computed axis is in the expected direction.
832
+
initialize_whole_trial_reconstruction: bool
833
+
If True, the whole trial is reconstructed using whole body inverse kinematics to initialize the segments' rt in the global reference frame.
834
+
animate_rt: bool
835
+
If True, it animates the segment rt reconstruction using pyorerun.
836
+
"""
804
837
805
838
super(Sara, self).__init__(
806
839
functional_trial=functional_trial,
@@ -821,7 +854,8 @@ def __init__(
821
854
defperform_algorithm(
822
855
rt_parent: RotoTransMatrixTimeSeries,
823
856
rt_child: RotoTransMatrixTimeSeries,
824
-
original_axis_global: np.ndarray|None=None,
857
+
original_axis_global: Point|None=None,
858
+
origin_positions_global: Points|None=None,
825
859
recursive_outlier_removal: bool=True,
826
860
) ->Tuple[
827
861
np.ndarray,
@@ -843,8 +877,12 @@ def perform_algorithm(
843
877
Homogeneous transformation matrices from the global frame to the parent segment.
844
878
rt_child : RotoTransMatrixTimeSeries
845
879
Homogeneous transformation matrices from the global frame to the child segment.
846
-
original_axis_global: np.ndarray | None
880
+
original_axis_global: Points | None
847
881
The original rotation axis direction. This axis is used to make sure the new axis is in a similar direction.
882
+
origin_positions_global: Points | None
883
+
The positions in the global reference frame used as a reference for the origin of the axis (3 x FunctionalTrialFrameCount).
884
+
The origin_positions_global points are projected onto the computed axis to determine the final origin of the axis; effectively
885
+
replacing the computed COR value.
848
886
recursive_outlier_removal : bool
849
887
If True, performs 95th percentile residual filtering and recomputes the axis of rotation.
850
888
@@ -867,6 +905,7 @@ def perform_algorithm(
867
905
rt_child : RotoTransMatrixTimeSeries
868
906
Homogeneous transformations of the child segment after outlier removal.
869
907
"""
908
+
870
909
nb_frames=len(rt_parent)
871
910
U, S, V, b_valid=get_svd(rt_parent, rt_child)
872
911
@@ -878,6 +917,7 @@ def perform_algorithm(
878
917
aor_child_local/=np.linalg.norm(aor_child_local)
879
918
880
919
# Compute pseudo-inverse solution
920
+
# cor = V[:, :5] @ np.diag(1.0 / S[:5]) @ U[:, :5].T @ b_valid # TODO: make a breaking PR for this change !!!
f"\nThere is a residual angle between the parent's and the child's AoR of : {np.nanmean(residuals)*180/np.pi} +- {np.nanstd(residuals)*180/np.pi} degrees."
1000
+
f"\nThere is a residual angle between the parent's and the child's AoR of : "
0 commit comments