% This function is part of the NMSM Pipeline, see file for full license.
%
% This function takes the output of parseOsimxFile(filename) and produces
% a struct that can passed directly into writeOsimxFile() and replicate the
% input file.
%
% This function is most commonly used to add values to an existing .osimx
% file.
%
% (struct) -> (struct)
% Prints MuscleTendonPersonalization results in osimx file
function osimx = buildOsimxFromOsimxStruct(osimxStruct)
osimx = buildOsimxTemplate(osimxStruct.modelName, osimxStruct.model);
if isfield(osimxStruct, "muscles")
osimx = buildMtpOsimx(osimx, osimxStruct.muscles);
end
if isfield(osimxStruct, "groundContact")
osimx = buildGcpOsimx(osimx, osimxStruct.groundContact);
end
end