207 lines (140 with data), 4.7 kB
#class_template OptimizeAnthropometricsOnOff (PelvisWidthOnOff,ThighLengthOnOff,ShankLengthOnOff,FootLengthOnOff,FootWidthOnOff,FootHeightOnOff,VarusValgusOnOff,HeadHeightOnOff,TrunkHeightOnOff ,UpperArmLengthOnOff,LowerArmLengthOnOff ,Model1, Model2 ){
#if Model1 == 1
AnyFolder &ref= Main.Studies.ParameterIdentification ;
ref={
AnyFolder &Lengths=Main.Studies.KinematicStudyForParameterIdentification.HumanModel.Anthropometrics.SegmentDimensions;
#if PelvisWidthOnOff=="On"
AnyDesVar PelvisWidth = {
Val = .Lengths.PelvisWidth;
};
#endif
#if ThighLengthOnOff =="On"
AnyDesVar ThighLengths = {
Val =.Lengths.Right.ThighLength;
};
#endif
#if ShankLengthOnOff =="On"
AnyDesVar ShankLengths = {
Val = .Lengths.Right.ShankLength;
};
#endif
#if FootLengthOnOff =="On"
AnyDesVar FootLengths = {
Val = .Lengths.Right.FootLength;
};
#endif
#if FootWidthOnOff =="On"
AnyDesVar FootWidth = {
Val = .Lengths.Right.FootWidth;
};
#endif
#if FootHeightOnOff =="On"
AnyDesVar FootHeight = {
Val = .Lengths.Right.FootHeight;
};
#endif
#if VarusValgusOnOff =="On"
AnyDesVar VarusValgusRight = {
Val = Main.Studies.KinematicStudyForParameterIdentification.HumanModel.BodyModel.Right.Leg.Seg.Thigh.KneeJoint.AxisRot;
};
AnyDesVar VarusValgusLeft = {
Val = Main.Studies.KinematicStudyForParameterIdentification.HumanModel.BodyModel.Left.Leg.Seg.Thigh.KneeJoint.AxisRot;
};
//This ensures the legs varus valgus is the same for left and right side
AnyDesMeasure VarusValgusEquality = {
Val = .VarusValgusRight.Val-.VarusValgusLeft.Val ;
Type= EqualToZero;
};
#endif
#if HeadHeightOnOff =="On"
AnyDesVar HeadHeight = {
Val = .Lengths.HeadHeight;
};
#endif
#if TrunkHeightOnOff =="On"
AnyDesVar TrunkHeight = {
Val = .Lengths.TrunkHeight;
};
#endif
#if UpperArmLengthOnOff=="On"
AnyDesVar UpperArmLength = {
Val = .Lengths.Right.UpperArmLength ;
};
#endif
#if LowerArmLengthOnOff =="On"
AnyDesVar LowerArmLength = {
Val = .Lengths.Right.LowerArmLength ;
};
#endif
};
#endif
#if Model2 == 1
AnyFolder &ref2= Main.Studies.LoadParametersOptimizationResults ;
ref2={
AnyFolder &Lengths=Main.Studies.HumanModel.Anthropometrics.SegmentDimensions;
#if PelvisWidthOnOff=="On"
AnyDesVar PelvisWidth = {
Val = .Lengths.PelvisWidth;
};
#endif
#if ThighLengthOnOff =="On"
AnyDesVar ThighLengths = {
Val =.Lengths.Right.ThighLength;
};
#endif
#if ShankLengthOnOff =="On"
AnyDesVar ShankLengths = {
Val = .Lengths.Right.ShankLength;
};
#endif
#if FootLengthOnOff =="On"
AnyDesVar FootLengths = {
Val = .Lengths.Right.FootLength;
};
#endif
#if FootWidthOnOff =="On"
AnyDesVar FootWidth = {
Val = .Lengths.Right.FootWidth;
};
#endif
#if FootHeightOnOff =="On"
AnyDesVar FootHeight = {
Val = .Lengths.Right.FootHeight;
};
#endif
#if HeadHeightOnOff =="On"
AnyDesVar HeadHeight = {
Val = .Lengths.HeadHeight;
};
#endif
#if TrunkHeightOnOff =="On"
AnyDesVar TrunkHeight = {
Val = .Lengths.TrunkHeight;
};
#endif
#if UpperArmLengthOnOff=="On"
AnyDesVar UpperArmLength = {
Val = .Lengths.Right.UpperArmLength ;
};
#endif
#if LowerArmLengthOnOff =="On"
AnyDesVar LowerArmLength = {
Val = .Lengths.Right.LowerArmLength ;
};
#endif
#if VarusValgusOnOff =="On"
AnyDesVar VarusValgusRight = {
Val = Main.Studies.HumanModel.BodyModel.Right.Leg.Seg.Thigh.KneeJoint.AxisRot;
};
AnyDesVar VarusValgusLeft = {
Val = Main.Studies.HumanModel.BodyModel.Left.Leg.Seg.Thigh.KneeJoint.AxisRot;
};
//This ensures the legs varus valgus is the same for left and right side
AnyDesMeasure VarusValgusEquality = {
Val = .VarusValgusRight.Val-.VarusValgusLeft.Val ;
Type= EqualToZero;
};
#endif
};
#endif
}; // End of InsertSegmentClass