[b87f69]: / MATLAB / matlab_tool_v4.0 / TEST_plugin.m

Download this file

116 lines (109 with data), 4.4 kB

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