Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Abdomen kinematics #21

Merged
merged 35 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2f648b9
fix bug_ Muscle volumes assigns after if statement for each muscle gr…
Apr 25, 2024
09f66a7
New obliq wrapping ellipsoid
Apr 25, 2024
6accd5a
clean up
Apr 25, 2024
0cf2470
AbdomenPassiveReactions to AMMR
Apr 25, 2024
69e7b89
remove some layers ellipsoid from obliq wrappings to avoid more penet…
Apr 25, 2024
b56e225
Extra weak actuators between abdominal layers
Apr 25, 2024
07bf242
Merge branch 'ammr4-beta' into obliqe-wrap-ammr4
melund May 7, 2024
6f3f0fc
Merge commit '5912f14f6ba304f3c4852b93e09dedf8983d1fae' into obliqe-w…
melund Jun 6, 2024
02d4279
Obliq muscle string mesh increase
May 29, 2024
ab52926
New abdomen with new inter-levels between Layer1 to ribcage and Layer…
May 29, 2024
8adc29b
Modify the weights of new inter-layers
May 31, 2024
1b0fea9
Increase string mesh for OEC_7 and OIC_7
Jun 4, 2024
50ecce9
Hide ellipsoid and nodes in the abdomen region
Jun 4, 2024
9abd318
String mesh for all wrapping muscles that wrap on 2 or more ellipsoid…
Jun 4, 2024
e00e32d
Asymmetric node fixed
Apr 3, 2024
6e099cf
Muscle volumes assigns after if statement for each muscle group to ha…
Apr 3, 2024
3228e81
Fix test failures
Jun 7, 2024
d32d5cd
Clean up
Jun 17, 2024
6022952
Clean up and restructure of new segments
Jun 19, 2024
2efee5c
Refine box lifting posture for ab pressure test
Jun 19, 2024
a69f760
Fix error in pull request
Sep 3, 2024
e6d29bc
fix assymetric nodes used in constrains
Sep 3, 2024
b9775db
Same LayerMomentReactionsNonNegative and NonPositive strength to avoi…
Sep 3, 2024
27eb586
Weight in layer constraints updated
Sep 3, 2024
a95d1fc
Merge branch 'ammr4-beta' into AbdomenKinematics
Sep 3, 2024
27889ad
Change naming: Another mesh type for wrapping obliq on ellipsoids: EL…
Sep 4, 2024
53de6d7
Lumbar Ligament insertion improvement
Sep 4, 2024
089792e
Bug fixed: Scale was not exactly 1 at the normal AMMR models due to s…
Sep 4, 2024
3e9cf8b
Moment arm studies for all interverterbral joints, and also for all a…
Sep 4, 2024
ecfc385
Merge remote-tracking branch 'remotes/origin/ammr4-beta' into Abdomen…
Sep 5, 2024
88200ec
Fixed trunk scaling issue
melund Sep 5, 2024
f52fa9a
Pelvis interface morphing fixing points
Sep 12, 2024
b83bd63
Add relative points to TLEM1 for interface morphing of pelvis to fix …
Sep 12, 2024
cd8774b
Remove via nodes of erector spinae muscles on L4 which are close to p…
Sep 13, 2024
f5fa492
Define statement for removing via nodes on L3 and L4 in erector spinae
Sep 23, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ AnyKinEqSimpleDriver LToeGroundConstraint ={
AnyKinEqSimpleDriver CoMDriver = {
AnyKinCoM CoM = {
AnyFolder &Body = Main.Model.BodyModel;
AnyFolder &Environment = Main.Model.EnvironmentModel;
// AnyFolder &Environment = Main.Model.EnvironmentModel;
};
MeasureOrganizer = {0,2}; // Only the x and z directions
DriverPos = {0,0};
Expand Down
8 changes: 4 additions & 4 deletions Application/Examples/BoxLiftFromGround/Mannequin.any
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ Main.HumanModel.Mannequin = {
//This controls the rotation of the pelvis wrt. to the global reference frame
PelvisRotX=0;
PelvisRotY=0;
PelvisRotZ=-19;
PelvisRotZ=-25;

// These variables control the rotation of the thorax wrt the
// pelvis
PelvisThoraxExtension=-64;
PelvisThoraxExtension=-60;
PelvisThoraxLateralBending=0;
PelvisThoraxRotation=0;

Expand All @@ -27,7 +27,7 @@ Main.HumanModel.Mannequin = {
SternoClavicularProtraction=-23; //This value is not used for initial position
SternoClavicularElevation=11.5; //This value is not used for initial position

GlenohumeralFlexion =68;
GlenohumeralFlexion =75;
GlenohumeralAbduction = 5;
GlenohumeralExternalRotation = 0;

Expand All @@ -41,7 +41,7 @@ Main.HumanModel.Mannequin = {
HipAbduction = 12;
HipExternalRotation = 0.0;

KneeFlexion = 106;
KneeFlexion = 115;

AnklePlantarFlexion =30;
SubTalarEversion =0.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// Note, this will include a lot of studies (one per DOF) so it will
// affect perfomance when loading and switching between tabs/operations.

#define BM_ARM_CLAVICULA_ROTATION_RHYTHM OFF

#define EVALUATE_MOMENT_ARMS 1
#define EVALUATE_MOMENT_ARMS_NSTEP 10
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include "../libdef.any"
#include "../../../Tests/tools.any"

// This model shows how to enable the built-in studies to evaluate
// muscle moment arms. The studies are enabled by setting the switch:
// #define EVALUATE_MOMENT_ARMS
// The studies will appear in the `HumanModel.EvaluateMomentArms
// folder.
// Note, this will include a lot of studies (one per DOF) so it will
// affect perfomance when loading and switching between tabs/operations.

//#define AMMR_VERSION 4
#define BM_TRUNK_THORACIC_MODEL _THORACIC_MODEL_FLEXIBLE_

#define EVALUATE_MOMENT_ARMS_IVJs 1
#ifndef EVALUATE_MOMENT_ARMS_IVJs
#define EVALUATE_MOMENT_ARMS_IVJs 0
#endif

#if EVALUATE_MOMENT_ARMS_IVJs
#define BM_TRUNK_LUMBAR_RHYTHM OFF
#define BM_TRUNK_THORACIC_RHYTHM OFF
#define BM_TRUNK_CERVICAL_RHYTHM OFF
#endif


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


#define EVALUATE_MOMENT_ARMS 1
#define EVALUATE_MOMENT_ARMS_NSTEP 2


Main =
{

#include "BodyModelConfiguration.any"
#include "<ANYBODY_PATH_BODY>\HumanModel.any"

AnyOperation& RunApplication = Main.HumanModel.EvaluateMomentArms.Run_all_studies;

};
25 changes: 15 additions & 10 deletions Body/AAUHuman/Arm/EvaluateMomentArmsStudy.any
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,16 @@ AnyFolder Model = {
AnyKinMeasure& ElbowPronation= ...SideBodyInterfaceRef.ElbowPronation;
AnyKinMeasure& WristFlexion= ...SideBodyInterfaceRef.WristFlexion;
AnyKinMeasure& WristAbduction= ...SideBodyInterfaceRef.WristAbduction;
#if BM_ARM_CLAVICULA_ROTATION_RHYTHM == OFF
AnyKinMeasure& ACMedialRotation= ...SideBodyInterfaceRef.AcromioClavicular.MedialRotation;
#endif
};

AnyKinEqSimpleDriver ArmDriver= {
AnyKinMeasure& ref = .ArmMeasure;

#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] }
#define __MEASURE_INDEXER(X) { X[0],X[1],X[2],X[3],X[4],X[5],X[6],X[7],X[8],X[9] }
#else
#define __MEASURE_INDEXER(X) { X[2], X[3],X[4],X[5],X[6],X[7],X[8] }
#endif
Expand Down Expand Up @@ -80,6 +83,7 @@ AnyKinStudy Study = {
InitialConditions.SmallStepAssumptionOnOff = Off;

AnyFolder &Model = .Model;
AnyOutputFun AngularVelocity_output = {Val = ..Model.Drivers.AngularVelocity;};

AnyFolder MuscleStrengthCalculations = {
AnyFolder Abscissa = {
Expand Down Expand Up @@ -139,13 +143,14 @@ AnyOperationSequence Run =
MacroStr = { "classoperation " + CompleteNameOf(&..ModelViews.Views.SelectedView) + strquote("Set View") };
};
AnyOperation &Study = .Study.Kinematics;
// #ifdef ANYBODY_PATH_OUTPUT
// AnyOperationMacro Save =
// {
// MacroStr = {
// "classoperation " + CompleteNameOf(&.Study.Output) + strquote("Save data")
// + " --type=" + strquote("Deep") +" --file=" + strquote(
// ANYBODY_PATH_OUTPUT + .OutputFileName + ".anydata.h5")
// };
// #endif
#ifdef ANYBODY_PATH_OUTPUT
AnyOperationMacro Save =
{
MacroStr = {
"classoperation " + CompleteNameOf(&..Study.Output) + strquote("Save data")
+ " --type=" + strquote("Deep") +" --file=" + strquote(
ANYBODY_PATH_OUTPUT + ..OutputFileName + ".anydata.h5")
};
};
#endif
};
80 changes: 61 additions & 19 deletions Body/AAUHuman/Arm/MomentArmSequenceLeft.any
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
AnyVar ElbowPronation = DesignVar(0);
AnyVar WristFlexion = DesignVar(0);
AnyVar WristAbduction = DesignVar(0);
AnyVar ACMedialRotation = DesignVar(-0.1745329);
/////////////////////////////////////////

AnyFloat Mask = {1,0,0,0,0,0,0,0,0};
AnyFloat Mask = {1,0,0,0,0,0,0,0,0,0};
AnyVector DriverPos = {
RangeOfMotion[0], SCElevation, GHAbduction, GHFlexion,
GHExternalRotation ,ElbowFlexion, ElbowPronation,
WristFlexion ,WristAbduction }*pi/180;
WristFlexion ,WristAbduction, ACMedialRotation }*pi/180;
AnyString OutputFileName = "MomentArms_Arm_Left_SCProtraction";


Expand All @@ -44,13 +45,14 @@
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};
AnyFloat Mask = {0,1,0,0,0,0,0,0,0,0};
AnyVector DriverPos = {
SCProtraction, RangeOfMotion[0], GHAbduction, GHFlexion,
GHExternalRotation ,ElbowFlexion, ElbowPronation,
WristFlexion ,WristAbduction }*pi/180;
WristFlexion ,WristAbduction, ACMedialRotation }*pi/180;
AnyString OutputFileName = "MomentArms_Arm_Left_SCElevation";

// The following should not be changed
Expand All @@ -74,13 +76,14 @@
AnyVar ElbowPronation = DesignVar(0);
AnyVar WristFlexion = DesignVar(0);
AnyVar WristAbduction = DesignVar(0);
AnyVar ACMedialRotation = DesignVar(-0.1745329);
/////////////////////////////////////////

AnyFloat Mask = {0,0,1,0,0,0,0,0,0};
AnyFloat Mask = {0,0,1,0,0,0,0,0,0,0};
AnyVector DriverPos = {
SCProtraction, SCElevation, RangeOfMotion[0], GHFlexion,
GHExternalRotation ,ElbowFlexion, ElbowPronation,
WristFlexion ,WristAbduction }*pi/180;
WristFlexion ,WristAbduction, ACMedialRotation }*pi/180;
AnyString OutputFileName = "MomentArms_Arm_Left_GHAbduction";

// The following should not be changed
Expand All @@ -103,13 +106,14 @@
AnyVar ElbowPronation = DesignVar(0);
AnyVar WristFlexion = DesignVar(0);
AnyVar WristAbduction = DesignVar(0);
AnyVar ACMedialRotation = DesignVar(-0.1745329);
/////////////////////////////////////////

AnyFloat Mask = {0,0,0,1,0,0,0,0,0};
AnyFloat Mask = {0,0,0,1,0,0,0,0,0,0};
AnyVector DriverPos = {
SCProtraction, SCElevation, GHAbduction, RangeOfMotion[0],
GHExternalRotation ,ElbowFlexion, ElbowPronation,
WristFlexion ,WristAbduction }*pi/180;
WristFlexion ,WristAbduction, ACMedialRotation }*pi/180;
AnyString OutputFileName = "MomentArms_Arm_Left_GHFlexion";

// The following should not be changed
Expand All @@ -132,13 +136,14 @@
AnyVar ElbowPronation = DesignVar(0);
AnyVar WristFlexion = DesignVar(0);
AnyVar WristAbduction = DesignVar(0);
AnyVar ACMedialRotation = DesignVar(-0.1745329);
/////////////////////////////////////////

AnyFloat Mask = {0,0,0,0,1,0,0,0,0};
AnyFloat Mask = {0,0,0,0,1,0,0,0,0,0};
AnyVector DriverPos = {
SCProtraction, SCElevation, GHAbduction, GHFlexion,
RangeOfMotion[0] ,ElbowFlexion, ElbowPronation,
WristFlexion ,WristAbduction }*pi/180;
WristFlexion ,WristAbduction, ACMedialRotation }*pi/180;
AnyString OutputFileName = "MomentArms_Arm_Left_GHExternalRotation";

// The following should not be changed
Expand All @@ -161,13 +166,14 @@
AnyVar ElbowPronation = DesignVar(0);
AnyVar WristFlexion = DesignVar(0);
AnyVar WristAbduction = DesignVar(0);
AnyVar ACMedialRotation = DesignVar(-0.1745329);
/////////////////////////////////////////

AnyFloat Mask = {0,0,0,0,0,1,0,0,0};
AnyFloat Mask = {0,0,0,0,0,1,0,0,0,0};
AnyVector DriverPos = {
SCProtraction, SCElevation, GHAbduction, GHFlexion,
GHExternalRotation ,RangeOfMotion[0], ElbowPronation,
WristFlexion ,WristAbduction }*pi/180;
WristFlexion ,WristAbduction, ACMedialRotation }*pi/180;
AnyString OutputFileName = "MomentArms_Arm_Left_ElbowFlexion";

// The following should not be changed
Expand All @@ -190,13 +196,14 @@
AnyVar ElbowFlexion = DesignVar(0);
AnyVar WristFlexion = DesignVar(0);
AnyVar WristAbduction = DesignVar(0);
AnyVar ACMedialRotation = DesignVar(-0.1745329);
/////////////////////////////////////////

AnyFloat Mask = {0,0,0,0,0,0,1,0,0};
AnyFloat Mask = {0,0,0,0,0,0,1,0,0,0};
AnyVector DriverPos = {
SCProtraction, SCElevation, GHAbduction, GHFlexion,
GHExternalRotation, ElbowFlexion, RangeOfMotion[0],
WristFlexion ,WristAbduction }*pi/180;
WristFlexion ,WristAbduction, ACMedialRotation }*pi/180;
AnyString OutputFileName = "MomentArms_Arm_Left_ElbowPronation";

// The following should not be changed
Expand All @@ -207,7 +214,6 @@

};


AnyFolder WristFlexion ={

// Change the following variables to adjust the moment arm study
Expand All @@ -220,13 +226,14 @@
AnyVar ElbowFlexion = DesignVar(0);
AnyVar ElbowPronation = DesignVar(0);
AnyVar WristAbduction = DesignVar(0);
AnyVar ACMedialRotation = DesignVar(-0.1745329);
/////////////////////////////////////////

AnyFloat Mask = {0,0,0,0,0,0,0,1,0};
AnyFloat Mask = {0,0,0,0,0,0,0,1,0,0};
AnyVector DriverPos = {
SCProtraction, SCElevation, GHAbduction, GHFlexion,
GHExternalRotation, ElbowFlexion, ElbowPronation,
RangeOfMotion[0] ,WristAbduction }*pi/180;
RangeOfMotion[0] ,WristAbduction, ACMedialRotation }*pi/180;
AnyString OutputFileName = "MomentArms_Arm_Left_WristFlexion";

// The following should not be changed
Expand All @@ -249,13 +256,14 @@
AnyVar ElbowFlexion = DesignVar(0);
AnyVar ElbowPronation = DesignVar(0);
AnyVar WristFlexion = DesignVar(0);
AnyVar ACMedialRotation = DesignVar(-0.1745329);
/////////////////////////////////////////

AnyFloat Mask = {0,0,0,0,0,0,0,0,1};
AnyFloat Mask = {0,0,0,0,0,0,0,0,1,0};
AnyVector DriverPos = {
SCProtraction, SCElevation, GHAbduction, GHFlexion,
GHExternalRotation, ElbowFlexion, ElbowPronation,
WristFlexion, RangeOfMotion[0] }*pi/180;
WristFlexion, RangeOfMotion[0], ACMedialRotation }*pi/180;
AnyString OutputFileName = "MomentArms_Arm_Left_WristAbduction";

// The following should not be changed
Expand All @@ -266,6 +274,36 @@

};

AnyFolder ACMedialRotation={

// Change the following variables to adjust the moment arm study
AnyVector RangeOfMotion = DesignVar({-0.1745329-20, -0.1745329+10});
AnyVar SCProtraction = DesignVar(-23);
AnyVar SCElevation = DesignVar(11.5);
AnyVar GHAbduction = DesignVar(0);
AnyVar GHFlexion = DesignVar(0);
AnyVar GHExternalRotation = DesignVar(0);
AnyVar ElbowFlexion = DesignVar(0);
AnyVar ElbowPronation = DesignVar(0);
AnyVar WristFlexion = DesignVar(0);
AnyVar WristAbduction = DesignVar(0);
/////////////////////////////////////////

AnyFloat Mask = {0,0,0,0,0,0,0,0,0,1};
AnyVector DriverPos = {
SCProtraction, SCElevation, GHAbduction, GHFlexion,
GHExternalRotation, ElbowFlexion, ElbowPronation,
WristFlexion ,WristAbduction, RangeOfMotion[0] }*pi/180;
AnyString OutputFileName = "MomentArms_Arm_Left_ACMedialRotation";

// The following should not be changed
AnyFolder &SideBodyModelRef=....BodyModel.Left;
AnyFolder &SideBodyInterfaceRef = ....BodyModel.Interface.Left;
AnyFolder &SideTrunkMusRef = ....BodyModel.Trunk.Muscles.Left;
#include "EvaluateMomentArmsStudy.any"

};

};//Arm
};//Left

Expand All @@ -279,7 +317,11 @@
AnyOperation &GHAbductionLeft = .Left.Arm.GHFlexion.Run;
AnyOperation &GHExternalRotationLeft = .Left.Arm.GHExternalRotation.Run;
AnyOperation &ElbowFlexionLeft = .Left.Arm.ElbowFlexion.Run;
AnyOperation &ElbowPronationLeft = .Left.Arm.ElbowPronation.Run;
AnyOperation &WristFlexionLeft = .Left.Arm.WristFlexion.Run;
AnyOperation &WristAbductionLeft = .Left.Arm.WristAbduction.Run;
#if BM_ARM_CLAVICULA_ROTATION_RHYTHM == OFF
AnyOperation &ACMedialRotationLeft = .Left.Arm.ACMedialRotation.Run;
#endif
};

Loading
Loading