Skip to content

Commit e281df8

Browse files
committed
changed name and outputs
1 parent fe5c456 commit e281df8

1 file changed

Lines changed: 23 additions & 12 deletions

File tree

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
% 29 Nov 2018: created based on functions for other purposes and added to
3333
% MFD Matlab toolbox.
3434
% ------------------------------------------------------------------------%
35-
function MFDStruct = muscleForceDirection_plugin(osimModel_name,...
35+
function [MFD, MFDSumStruct] = getMuscleForceDirection(osimModel_name,...
3636
IK_mot_file,...
3737
bodyOfInterest_name,...
3838
bodyExpressResultsIn_name,...
@@ -127,6 +127,7 @@
127127
if strcmp(visualise, 'true')
128128
osimModel.updVisualizer().show(state_new);
129129
end
130+
130131
% counter for muscles to be kept at each frame
131132
n_keep = 1;
132133

@@ -185,6 +186,7 @@
185186

186187
% first body outside the body of interest
187188
bodyFrom = osimModel.getBodySet.get(mus_bodyset_list{dist_attach+1});
189+
188190
% vector in bodyFrom ref system
189191
p = Vec3(mus_pointset_mat(dist_attach+1, 1),...
190192
mus_pointset_mat(dist_attach+1, 2),...
@@ -252,8 +254,8 @@
252254
% selected body where the attachment is located outwards. The body in whose
253255
% reference system the vector is expressed is always reported as the final
254256
% part of the column header of each muscle.
255-
MFD_vectors.colheaders = colheaders_MFD_vec;
256-
MFD_vectors.data = mus_info_mat(:, :, 3);
257+
MFD.vectors.colheaders = colheaders_MFD_vec;
258+
MFD.vectors.data = mus_info_mat(:, :, 3);
257259

258260
%---------------------------------------
259261
% MuscleForceDirection_attachments.sto |
@@ -262,12 +264,21 @@
262264
% attachments. If the user choice is to express the anatomical muscle
263265
% attachments in the local reference system, the file will contain the
264266
% first and last muscle points specified for that muscle in the original model file.
265-
MFD_attachments.colheaders = colheaders_MFD_attach;
266-
if strcmp(effective_attachm, 'true')
267-
MFD_attachments.data = mus_info_mat(:, :, 1);
268-
else
269-
MFD_attachments.data = mus_info_mat(:, :, 2);
270-
end
267+
268+
MFD.anatom_attach.colheaders = colheaders_MFD_attach;
269+
MFD.anatom_attach.data = mus_info_mat(:, :, 1);
270+
271+
MFD.effect_attach.colheaders = colheaders_MFD_attach;
272+
MFD.effect_attach.data = mus_info_mat(:, :, 2);
273+
274+
MFD.transp_mom.colheaders = colheaders_MFD_vec;
275+
MFD.transp_mom.data = mus_info_mat(:, :, 4);
276+
%
277+
% if strcmp(effective_attachm, 'true')
278+
%
279+
% else
280+
%
281+
% end
271282

272283
%--------------------------
273284
% Advanced MATLAB summary |
@@ -278,9 +289,9 @@
278289
colheaders = {'bone_attach_X', 'bone_attach_Y', 'bone_attach_Z', 'effect_attach_X', 'effect_attach_Y', 'effect_attach_Z', ...
279290
'act_line_X', 'act_line_Y', 'act_line_Z', 'trans_mom_X', 'trans_mom_Y', 'trans_mom_Z'};
280291
% this is an advanced summary for Matlab use
281-
MFDStruct.colheaders = colheaders;
282-
MFDStruct.rowheaders = rowheaders;
283-
MFDStruct.data = mus_info_mat;
292+
MFDSumStruct.colheaders = colheaders;
293+
MFDSumStruct.rowheaders = rowheaders;
294+
MFDSumStruct.data = mus_info_mat;
284295

285296
% to free the memory
286297
osimModel.disownAllComponents();

0 commit comments

Comments
 (0)