A class for scaling a model. More...
#include <ModelScaler.h>
Public Member Functions | |
ModelScaler () | |
Default constructor. | |
ModelScaler (const ModelScaler &aModelScaler) | |
Copy constructor. | |
virtual | ~ModelScaler () |
Destructor. | |
virtual Object * | copy () const |
Copy this scaling params and return a pointer to the copy. | |
ModelScaler & | operator= (const ModelScaler &aModelScaler) |
Assignment operator. | |
void | copyData (const ModelScaler &aModelScaler) |
Copy data members from one ModelScaler to another. | |
bool | processModel (SimTK::State &s, Model *aModel, const std::string &aPathToSubject="", double aFinalMass=-1.0) |
void | addMeasurement (Measurement *aMeasurement) |
add a measurement | |
void | addScale (Scale *aScale) |
add a scale factor to current scaleSet | |
bool | getApply () const |
void | setApply (bool aApply) |
MeasurementSet & | getMeasurementSet () |
void | setMeasurementSet (MeasurementSet &measurementSet) |
ScaleSet & | getScaleSet () |
void | setScaleSetFile (const std::string &aScaleSetFilename) |
const Array< double > & | getTimeRange () const |
void | setTimeRange (Array< double > timeRange) |
bool | getPreserveMassDist () const |
void | setPreserveMassDist (bool preserveMassDist) |
Array< std::string > & | getScalingOrder () |
void | setScalingOrder (Array< std::string > &scalingOrder) |
const std::string & | getMarkerFileName () const |
void | setMarkerFileName (const std::string &aMarkerFileName) |
const std::string & | getOutputJointFileName () const |
void | setOutputJointFileName (const std::string &outputJointFileName) |
const std::string & | getOutputMuscleFileName () const |
void | setOutputMuscleFileName (const std::string &aOutputMuscleFileName) |
const std::string & | getOutputModelFileName () const |
void | setOutputModelFileName (const std::string &aOutputModelFileName) |
const std::string & | getOutputScaleFileName () const |
void | setOutputScaleFileName (const std::string &aOutputScaleFileName) |
void | setPrintResultFiles (bool aToWrite) |
double | computeMeasurementScaleFactor (const SimTK::State &s, const Model &aModel, const MarkerData &aMarkerData, const Measurement &aMeasurement) const |
For measurement based scaling, we average the scale factors across the different marker pairs used. | |
Static Public Member Functions | |
static void | registerTypes () |
Register the types used by this class. | |
Protected Attributes | |
PropertyBool | _applyProp |
bool & | _apply |
PropertyStrArray | _scalingOrderProp |
Array< std::string > & | _scalingOrder |
PropertyObj | _measurementSetProp |
MeasurementSet & | _measurementSet |
PropertyObj | _scaleSetProp |
ScaleSet & | _scaleSet |
PropertyStr | _markerFileNameProp |
std::string & | _markerFileName |
PropertyDblArray | _timeRangeProp |
Array< double > & | _timeRange |
PropertyBool | _preserveMassDistProp |
bool & | _preserveMassDist |
PropertyStr | _outputJointFileNameProp |
std::string & | _outputJointFileName |
PropertyStr | _outputMuscleFileNameProp |
std::string & | _outputMuscleFileName |
PropertyStr | _outputModelFileNameProp |
std::string & | _outputModelFileName |
PropertyStr | _outputScaleFileNameProp |
std::string & | _outputScaleFileName |
bool | _printResultFiles |
A class for scaling a model.
The default method of scaling involves measuring distances between pairs of markers on the model and in a static pose to determine scale factors.
ModelScaler::ModelScaler | ( | ) |
Default constructor.
ModelScaler::ModelScaler | ( | const ModelScaler & | aModelScaler | ) |
Copy constructor.
aModelScaler | ModelScaler to be copied. |
ModelScaler::~ModelScaler | ( | ) | [virtual] |
Destructor.
void OpenSim::ModelScaler::addMeasurement | ( | Measurement * | aMeasurement | ) | [inline] |
add a measurement
void OpenSim::ModelScaler::addScale | ( | Scale * | aScale | ) | [inline] |
add a scale factor to current scaleSet
double ModelScaler::computeMeasurementScaleFactor | ( | const SimTK::State & | s, | |
const Model & | aModel, | |||
const MarkerData & | aMarkerData, | |||
const Measurement & | aMeasurement | |||
) | const |
For measurement based scaling, we average the scale factors across the different marker pairs used.
For each marker pair, the scale factor is computed by dividing the average distance between the pair in the experimental marker data by the distance between the pair on the model.
Object * ModelScaler::copy | ( | ) | const [virtual] |
Copy this scaling params and return a pointer to the copy.
The copy constructor for this class is used.
Reimplemented from OpenSim::Object.
void ModelScaler::copyData | ( | const ModelScaler & | aModelScaler | ) |
Copy data members from one ModelScaler to another.
aModelScaler | ModelScaler to be copied. |
bool OpenSim::ModelScaler::getApply | ( | ) | const [inline] |
const std::string& OpenSim::ModelScaler::getMarkerFileName | ( | ) | const [inline] |
MeasurementSet& OpenSim::ModelScaler::getMeasurementSet | ( | ) | [inline] |
const std::string& OpenSim::ModelScaler::getOutputJointFileName | ( | ) | const [inline] |
const std::string& OpenSim::ModelScaler::getOutputModelFileName | ( | ) | const [inline] |
const std::string& OpenSim::ModelScaler::getOutputMuscleFileName | ( | ) | const [inline] |
const std::string& OpenSim::ModelScaler::getOutputScaleFileName | ( | ) | const [inline] |
bool OpenSim::ModelScaler::getPreserveMassDist | ( | ) | const [inline] |
ScaleSet& OpenSim::ModelScaler::getScaleSet | ( | ) | [inline] |
Array<std::string>& OpenSim::ModelScaler::getScalingOrder | ( | ) | [inline] |
const Array<double>& OpenSim::ModelScaler::getTimeRange | ( | ) | const [inline] |
ModelScaler & ModelScaler::operator= | ( | const ModelScaler & | aModelScaler | ) |
bool OpenSim::ModelScaler::processModel | ( | SimTK::State & | s, | |
Model * | aModel, | |||
const std::string & | aPathToSubject = "" , |
|||
double | aFinalMass = -1.0 | |||
) |
void ModelScaler::registerTypes | ( | ) | [static] |
Register the types used by this class.
void OpenSim::ModelScaler::setApply | ( | bool | aApply | ) | [inline] |
void OpenSim::ModelScaler::setMarkerFileName | ( | const std::string & | aMarkerFileName | ) | [inline] |
void OpenSim::ModelScaler::setMeasurementSet | ( | MeasurementSet & | measurementSet | ) | [inline] |
void OpenSim::ModelScaler::setOutputJointFileName | ( | const std::string & | outputJointFileName | ) | [inline] |
void OpenSim::ModelScaler::setOutputModelFileName | ( | const std::string & | aOutputModelFileName | ) | [inline] |
void OpenSim::ModelScaler::setOutputMuscleFileName | ( | const std::string & | aOutputMuscleFileName | ) | [inline] |
void OpenSim::ModelScaler::setOutputScaleFileName | ( | const std::string & | aOutputScaleFileName | ) | [inline] |
void OpenSim::ModelScaler::setPreserveMassDist | ( | bool | preserveMassDist | ) | [inline] |
void OpenSim::ModelScaler::setPrintResultFiles | ( | bool | aToWrite | ) | [inline] |
void OpenSim::ModelScaler::setScaleSetFile | ( | const std::string & | aScaleSetFilename | ) | [inline] |
void OpenSim::ModelScaler::setScalingOrder | ( | Array< std::string > & | scalingOrder | ) | [inline] |
void OpenSim::ModelScaler::setTimeRange | ( | Array< double > | timeRange | ) | [inline] |
bool& OpenSim::ModelScaler::_apply [protected] |
PropertyBool OpenSim::ModelScaler::_applyProp [protected] |
std::string& OpenSim::ModelScaler::_markerFileName [protected] |
PropertyStr OpenSim::ModelScaler::_markerFileNameProp [protected] |
MeasurementSet& OpenSim::ModelScaler::_measurementSet [protected] |
PropertyObj OpenSim::ModelScaler::_measurementSetProp [protected] |
std::string& OpenSim::ModelScaler::_outputJointFileName [protected] |
std::string& OpenSim::ModelScaler::_outputModelFileName [protected] |
std::string& OpenSim::ModelScaler::_outputMuscleFileName [protected] |
std::string& OpenSim::ModelScaler::_outputScaleFileName [protected] |
bool& OpenSim::ModelScaler::_preserveMassDist [protected] |
bool OpenSim::ModelScaler::_printResultFiles [protected] |
ScaleSet& OpenSim::ModelScaler::_scaleSet [protected] |
PropertyObj OpenSim::ModelScaler::_scaleSetProp [protected] |
Array<std::string>& OpenSim::ModelScaler::_scalingOrder [protected] |
Array<double>& OpenSim::ModelScaler::_timeRange [protected] |
PropertyDblArray OpenSim::ModelScaler::_timeRangeProp [protected] |