Model Processors are used to adapt the generic MMM Reference Model to a set of parameters that specify the appearance of the proband. Details on how a custom model processor can be implemented are given here: ModelProcessorFactory.
The Winter Model Processor
The ModelProcessorWinter class can be used to scale a generic MMM Reference Model (given with a standard height of 1 m) to a proband specific height. Scaling is performed according to Winter's biomechanic definitions (see models). The setup can be given via an XML config file.
Setup of the Winter Model Processor
An exempary usage of the model processor by Winter is given below.
#include <MMM/Model/ModelProcessorWinter.h>
std::string modelProcessorType("Winter");
ModelProcessorFactoryPtr modelFactory = ModelProcessorFactory::fromName(modelProcessorType, NULL);
if (!modelFactory)
{
cout << "Could not create model processing factory of type " << modelProcessorType << endl;
cout << "Setting up model processor... Failed..." << endl;
return;
}
ModelProcessorPtr modelProcessor = modelFactory->createModelProcessor();
std::string modelProcessorFile("../data/ModelProcessor_Winter_1.79.xml");
if (!modelProcessor->setupFile(modelProcessorFile))
{
cout << "Error while configuring model processor '" << modelProcessorType << "' from file " << modelProcessorFile << endl;
cout << "Setting up model processor... Failed..." << endl;
}
cout << "Setting up model processor... OK..." << endl;
Usage of the Winter Model Processor
The model processor can be used as follows:
std::string modelFile("../data/Model/Winter/Winter.xml");
ModelReaderXMLPtr r(new ModelReaderXML());
ModelPtr mmmOrigModel = r->loadModel(modelFile);
ModelProcessorWinterPtr mpWinter = std::dynamic_pointer_cast<ModelProcessorWinter>(modelProcessor);
mpWinter->setup(1.79f, 75.0f);
ModelPtr mmmModel = modelProcessor->convertModel(mmmOrigModel);
Configuration file of the Winter Model Processor
An exemplary configuration file is shown here:
<ModelProcessorConfig type='Winter'>
<height>1.79</height>
<mass>75</mass>
</ModelProcessorConfig>
Specifying custom segment lengths with the Winter Model Processor
The segment lengths can be set by hand in order to be able to increase the accuracy by adding subject specific data. The given segment will be scaled to the provided value.
<ModelProcessorConfig type='Winter'>
<height>1.79</height>
<mass>75</mass>
<SegmentLength name='LAsegment_joint' unit='m'>0.8</SegmentLength>
<SegmentLength name='RAsegment_joint' unit='m'>0.8</SegmentLength>
</ModelProcessorConfig>