Scaling tool: GUI vs MATLAB API
Posted: Fri May 06, 2022 9:10 am
Hi all,
I run into an issue scaling a model. After setting up the ScaleTool in the GUI and saving it as an .xml, I want to run this same scaling setup via the MATLAB API, using a different static trial for each participant. However, the scaling results are different from the GUI (and inappropriate). Does anyone know why the same scaling setup can give a different result when ran in the GUI vs MATLAB?
The MATLAB code I use is.
Many thanks for any help.
Jasper
I run into an issue scaling a model. After setting up the ScaleTool in the GUI and saving it as an .xml, I want to run this same scaling setup via the MATLAB API, using a different static trial for each participant. However, the scaling results are different from the GUI (and inappropriate). Does anyone know why the same scaling setup can give a different result when ran in the GUI vs MATLAB?
The MATLAB code I use is.
Code: Select all
% Load the generic scaling setup file
scaleTool = ScaleTool('setupScaling.xml');
% Set up model and (static) marker files
scaleTool.getGenericModelMaker().setModelFileName([folders.models genericModel]);
scaleTool.getModelScaler().setMarkerFileName([folders.data participant '_Static_markers.trc']);
scaleTool.getModelScaler().setOutputModelFileName([folders.models participant '_scaled.osim']);
scaleTool.getMarkerPlacer().setStaticPoseFileName([folders.data participant '_Static_markers.trc']);
scaleTool.getMarkerPlacer().setOutputModelFileName([folders.models participant '_scaled.osim']);
% Set participant mass
scaleTool.setSubjectMass(participantMass);
% Run scaling
scaleTool.run();
Jasper