1+ % -------------------------------------------------------------------------%
2+ % Copyright (c) 2019 Modenese L. %
3+ % Author: Luca Modenese %
4+ % email: l.modenese@imperial.ac.uk %
5+ % ----------------------------------------------------------------------- %
6+ % Load Library
7+ import org .opensim .modeling .* ;
8+
9+ % verification
10+ osimModel_name = ' ../_test_data/MFD_tests/testModel.osim' ;
11+ IK_mot_file = ' ../_test_data/MFD_tests/testKinematics_file.mot' ;
12+ results_directory = ' ../_test_data/MFD_tests' ;
13+ bodyOfInterest_name = ' MovingBody' ;
14+ bodyExpressResultsIn_name = [];
15+ effective_attachm = ' false' ;
16+ print_attachm = ' true' ;
17+ vis_on = ' true' ;
18+ N_frame_test = 5 ;
19+
20+ % validated_results_folder = '../_test_data/MFD_tests/validated_res';
21+
22+ res_anatAttach_local = getMuscleForceDirection(osimModel_name ,...
23+ IK_mot_file ,...
24+ results_directory ,...
25+ bodyOfInterest_name ,...
26+ bodyExpressResultsIn_name ,...
27+ effective_attachm ,...
28+ print_attachm ,...
29+ vis_on ,...
30+ N_frame_test );
31+
32+ % res_effectAttach_local = getMuscleForceDirection(osimModel_name,...
33+ % IK_mot_file,...
34+ % results_directory,...
35+ % bodyOfInterest_name,...
36+ % bodyExpressResultsIn_name,...
37+ % 'true',...
38+ % print_attachm,...
39+ % vis_on,...
40+ % []);
41+ %
42+ % res_effectAttach_ground = getMuscleForceDirection(osimModel_name,...
43+ % IK_mot_file,...
44+ % results_directory,...
45+ % bodyOfInterest_name,...
46+ % 'ground',...
47+ % 'true',...
48+ % print_attachm,...
49+ % vis_on,...
50+ % []);
51+ %
52+ % res_anatAttach_ground = getMuscleForceDirection(osimModel_name,...
53+ % IK_mot_file,...
54+ % results_directory,...
55+ % bodyOfInterest_name,...
56+ % 'ground',...
57+ % 'false',...
58+ % print_attachm,...
59+ % vis_on,...
60+ % []);
61+
62+
63+ % res_anatAttach_local
64+ % res_anatAttach_ground
65+ % res_effectAttach_ground
66+ % res_effectAttach_local
67+ %
68+ % res_anatAttach_local_val = sto2Mat(fullfile(validated_results_folder,'LOCAL_ANATOM_MuscleForceDirection_vectors.sto'));
69+ %
70+ % res_anatAttach_ground.rowheaders
71+ % res_effectAttach_ground
72+ % res_effectAttach_local
73+ % --------------------------------------------------------------------------
74+ % %% test 1: simple arm26 model
75+ % osimModel_name = '../_test_data/Arm26/arm26.osim';
76+ % IK_mot_file = '../_test_data/Arm26/elbow_flexion.mot';
77+ % results_directory = '../_test_data/Arm26';
78+ % bodyOfInterest_name = 'r_humerus';
79+ % bodyExpressResultsIn_name = [];
80+ % effective_attachm = 'true';
81+ % print_attachm = 'true';
82+ % vis_on = 'true';
83+ % N_frame_test = 5;
84+ %
85+ % muscleLinesOfActionStruct = getMuscleForceDirection(osimModel_name,...
86+ % IK_mot_file,...
87+ % results_directory,...
88+ % bodyOfInterest_name,...
89+ % bodyExpressResultsIn_name,...
90+ % effective_attachm,...
91+ % print_attachm,...
92+ % vis_on,...
93+ % N_frame_test);
94+ %
95+ %
96+ % --------------------------------------------------------------------------
97+ %% test 2: gait2392 model
98+ osimModel_name = ' ../_test_data/gait2392/subject01.osim' ;
99+ IK_mot_file = ' ../_test_data/gait2392/subject01_walk1_ik.mot' ;
100+ results_directory = ' ../_test_data/gait2392' ;
101+ bodyOfInterest_name = ' femur_r' ;
102+ bodyExpressResultsIn_name = [];
103+ effective_attachm = ' true' ;
104+ print_attachm = ' true' ;
105+ vis_on = ' true' ;
106+ N_frame_test = 5 ;
107+
108+ muscleLinesOfActionStruct = getMuscleForceDirection(osimModel_name ,...
109+ IK_mot_file ,...
110+ results_directory ,...
111+ bodyOfInterest_name ,...
112+ bodyExpressResultsIn_name ,...
113+ effective_attachm ,...
114+ print_attachm ,...
115+ vis_on ,...
116+ N_frame_test );
0 commit comments