Skip to content

Commit

Permalink
feat: Neck_Moment_Arm_Studies (#29)
Browse files Browse the repository at this point in the history
* Moment arm studies for the neck joints include arm muscles as well.

* Ignored link failures to web.archive.org. Currently down due to hacking attacks (#1000)

---------

Co-authored-by: hs <[email protected]>
Co-authored-by: Morten Enemark Lund <[email protected]>
  • Loading branch information
3 people authored Oct 11, 2024
1 parent a650fd0 commit 517c8bd
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@


#define BM_LEG_MODEL OFF
#define BM_ARM_LEFT OFF
#define BM_ARM_RIGHT OFF
#define BM_ARM_LEFT ON
#define BM_ARM_RIGHT ON


#define EVALUATE_MOMENT_ARMS 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ AnyFolder EvaluateMomentArms=
#endif

#if BM_ARM_RIGHT & BM_ARM_MUSCLES_RIGHT
#ifndef EVALUATE_MOMENT_ARMS_IVJs
#include "../../Arm/MomentArmSequenceRight.any"
#endif
#endif

#if BM_ARM_LEFT & BM_ARM_MUSCLES_LEFT
#ifndef EVALUATE_MOMENT_ARMS_IVJs
#include "../../Arm/MomentArmSequenceLeft.any"
#endif
#endif
#if (BM_TRUNK_MUSCLES != OFF)
#ifdef EVALUATE_MOMENT_ARMS_IVJs
#include "../../Trunk/EvaluateMomentArmsSequence_IVJs.any"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_T1C7AxialRotation";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -842,6 +843,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C7C6AxialRotation";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -882,6 +884,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C6C5AxialRotation";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -922,6 +925,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C5C4AxialRotation";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -962,6 +966,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C4C3AxialRotation";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -1002,6 +1007,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C3C2AxialRotation";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -1042,6 +1048,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C2C1AxialRotation";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_T1C7Extension";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -842,6 +843,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C7C6Extension";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -882,6 +884,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C6C5Extension";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -922,6 +925,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C5C4Extension";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -962,6 +966,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C4C3Extension";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -1002,6 +1007,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C3C2Extension";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -1042,6 +1048,7 @@ Trunk = {
// AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
// AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
// #include "EvaluateMomentArmsStudy_IVJs.any"
// #include "IncludeArms_In_MomentArmStudy.any"
// AnyString OutputFileName = "MomentArms_Trunk_C2C1Extension";
// Model.Drivers = {
// AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -1082,6 +1089,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C1C0Extension";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_T1C7LateralBending";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -842,6 +843,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C7C6LateralBending";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -882,6 +884,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C6C5LateralBending";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -922,6 +925,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C5C4LateralBending";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -962,6 +966,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C4C3LateralBending";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down Expand Up @@ -1002,6 +1007,7 @@ Trunk = {
AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk;
AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk;
#include "EvaluateMomentArmsStudy_IVJs.any"
#include "IncludeArms_In_MomentArmStudy.any"
AnyString OutputFileName = "MomentArms_Trunk_C3C2LateralBending";
Model.Drivers = {
AnyKinEqSimpleDriver TrunkDriver= {
Expand Down
130 changes: 130 additions & 0 deletions Body/AAUHuman/Trunk/IncludeArms_In_MomentArmStudy.any
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
// Include Arms in study

Model = {
AnyFolder &RightBodyModelRef=....BodyModel.Right;
AnyFolder &RightBodyInterfaceRef = ....BodyModel.Interface.Right;
AnyFolder &LeftBodyModelRef=....BodyModel.Left;
AnyFolder &LeftBodyInterfaceRef = ....BodyModel.Interface.Left;

// Extra Model parts included in the moment arm study
AnyFolder &RightRef = RightBodyModelRef;
AnyFolder &RightArmMusRef = RightBodyModelRef.ShoulderArm.Mus;
AnyFolder &LeftRef = LeftBodyModelRef;
AnyFolder &LeftArmMusRef = LeftBodyModelRef.ShoulderArm.Mus;


Drivers = {
AnyFolder ArmDriver = {
// Change the following variables to adjust the moment arm study
AnyVar SCProtraction = DesignVar(-23);
AnyVar SCElevation = DesignVar(11.5);
AnyVar GHAbduction = DesignVar(10);
AnyVar GHFlexion = DesignVar(0);
AnyVar GHExternalRotation = DesignVar(0);
AnyVar ElbowFlexion = DesignVar(0);
AnyVar ElbowPronation = DesignVar(0);
AnyVar WristFlexion = DesignVar(0);
AnyVar WristAbduction = DesignVar(0);
AnyVar ACMedialRotation = DesignVar(-0.1745329);
/////////////////////////////////////////

// AnyFloat Mask = {0,1,0,0,0,0,0,0,0,0};
AnyVector DriverPos = {
SCProtraction, SCElevation, GHAbduction, GHFlexion,
GHExternalRotation ,ElbowFlexion, ElbowPronation,
WristFlexion ,WristAbduction, ACMedialRotation }*pi/180;

#if BM_ARM_RIGHT
AnyFolder RightArmDrivers = {
// AnyVar AngularVelocity = (..RangeOfMotion[1]-..RangeOfMotion[0])*pi/180;

AnyKinMeasureOrg ArmMeasure = {
#if BM_ARM_SHOULDER_RHYTHM == OFF
AnyKinMeasure& SCProtraction= ....RightBodyInterfaceRef.SternoClavicularProtraction;
AnyKinMeasure& SCElevation= ....RightBodyInterfaceRef.SternoClavicularElevation;
#endif
AnyKinMeasure& GHAbduction= ....RightBodyInterfaceRef.GlenohumeralAbduction;
AnyKinMeasure& GHFlexion= ....RightBodyInterfaceRef.GlenohumeralFlexion;
AnyKinMeasure& GHExternalRotation= ....RightBodyInterfaceRef.GlenohumeralExternalRotation;
AnyKinMeasure& ElbowFlexion= ....RightBodyInterfaceRef.ElbowFlexion;
AnyKinMeasure& ElbowPronation= ....RightBodyInterfaceRef.ElbowPronation;
AnyKinMeasure& WristFlexion= ....RightBodyInterfaceRef.WristFlexion;
AnyKinMeasure& WristAbduction= ....RightBodyInterfaceRef.WristAbduction;
#if BM_ARM_CLAVICULA_ROTATION_RHYTHM == OFF
AnyKinMeasure& ACMedialRotation= ....RightBodyInterfaceRef.AcromioClavicular.MedialRotation;
#endif
};



AnyKinEqSimpleDriver ArmDriver= {
AnyKinMeasure& ref = .ArmMeasure;

#if BM_ARM_SHOULDER_RHYTHM == OFF & BM_ARM_CLAVICULA_ROTATION_RHYTHM == OFF
#define __MEASURE_INDEXER(X) { X[0],X[1],X[2],X[3],X[4],X[5],X[6],X[7],X[8],X[9] }
#endif
#if BM_ARM_SHOULDER_RHYTHM == OFF
#define __MEASURE_INDEXER(X) { X[0],X[1],X[2],X[3],X[4],X[5],X[6],X[7],X[8] }
#endif
#if BM_ARM_SHOULDER_RHYTHM == ON
#define __MEASURE_INDEXER(X) { X[2], X[3],X[4],X[5],X[6],X[7],X[8] }
#endif

DriverPos = __MEASURE_INDEXER(..DriverPos);
// AnyFloat Mask = __MEASURE_INDEXER( ...Mask);

#undef __MEASURE_INDEXER

DriverVel = repmat(nDim,0);//Mask* (0)*pi/180/...Study.tEnd;
};

};// Right Arm Drivers
#endif
#if BM_ARM_LEFT
AnyFolder LeftArmDrivers = {
// AnyVar AngularVelocity = (..RangeOfMotion[1]-..RangeOfMotion[0])*pi/180;

AnyKinMeasureOrg ArmMeasure = {
#if BM_ARM_SHOULDER_RHYTHM == OFF
AnyKinMeasure& SCProtraction= ....LeftBodyInterfaceRef.SternoClavicularProtraction;
AnyKinMeasure& SCElevation= ....LeftBodyInterfaceRef.SternoClavicularElevation;
#endif
AnyKinMeasure& GHAbduction= ....LeftBodyInterfaceRef.GlenohumeralAbduction;
AnyKinMeasure& GHFlexion= ....LeftBodyInterfaceRef.GlenohumeralFlexion;
AnyKinMeasure& GHExternalRotation= ....LeftBodyInterfaceRef.GlenohumeralExternalRotation;
AnyKinMeasure& ElbowFlexion= ....LeftBodyInterfaceRef.ElbowFlexion;
AnyKinMeasure& ElbowPronation= ....LeftBodyInterfaceRef.ElbowPronation;
AnyKinMeasure& WristFlexion= ....LeftBodyInterfaceRef.WristFlexion;
AnyKinMeasure& WristAbduction= ....LeftBodyInterfaceRef.WristAbduction;
#if BM_ARM_CLAVICULA_ROTATION_RHYTHM == OFF
AnyKinMeasure& ACMedialRotation= ....LeftBodyInterfaceRef.AcromioClavicular.MedialRotation;
#endif
};

AnyKinEqSimpleDriver ArmDriver= {
AnyKinMeasure& ref = .ArmMeasure;

#if BM_ARM_SHOULDER_RHYTHM == OFF & BM_ARM_CLAVICULA_ROTATION_RHYTHM == OFF
#define __MEASURE_INDEXER(X) { X[0],X[1],X[2],X[3],X[4],X[5],X[6],X[7],X[8],X[9] }
#endif
#if BM_ARM_SHOULDER_RHYTHM == OFF
#define __MEASURE_INDEXER(X) { X[0],X[1],X[2],X[3],X[4],X[5],X[6],X[7],X[8] }
#endif
#if BM_ARM_SHOULDER_RHYTHM == ON
#define __MEASURE_INDEXER(X) { X[2], X[3],X[4],X[5],X[6],X[7],X[8] }
#endif

DriverPos = __MEASURE_INDEXER(..DriverPos);
// AnyFloat Mask = __MEASURE_INDEXER( ...Mask);

#undef __MEASURE_INDEXER

DriverVel = repmat(nDim,0);//Mask* (0)*pi/180/...Study.tEnd;
};

};// Left Arm Drivers
#endif
};
};
};

1 change: 1 addition & 0 deletions Docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ def tagged_commit():
"https://doi.org/10.1016/j.clinbiomech.2006.10.003", # clinbiomech.com prevents the linkcheck
"https://doi.org/10.1002/jor.25267", # wiley.com prevents the linkcheck
"https://doi.org/10.5281/zenodo.12592455", # AMMR 3.0.4 not released yet
"https://web.archive.org*", # web.archive.org is currently down due to hacking atacks
]

linkcheck_allowed_redirects = {
Expand Down

0 comments on commit 517c8bd

Please sign in to comment.