Page 1 of 1
Scale_Setup.xml and Scale_MarkerSet.xml
Posted: Fri Apr 10, 2015 2:55 am
by sgl
Hello,
I intend to scale my model using .xml files as described in the various tutorials. I would like to create those .xml files using Matlab as I understand it quite well. However, I do not find an Matlab Script for the Scale_MarkerSet.xml file. Does anybody know about it ?
Thank you !
Alice
Re: Scale_Setup.xml and Scale_MarkerSet.xml
Posted: Fri Apr 17, 2015 3:36 am
by manifik
Hello,
These files should be created only as .xml files. You can change them even in note pad. It's not possible to make .xml files for IK, ID, RRA or CMC with MatLab or C++. But trust me xml is really simple you should't have any problems with it!
Re: Scale_Setup.xml and Scale_MarkerSet.xml
Posted: Tue Apr 21, 2015 3:35 am
by uktrinler1986
Hello Alice,
I do not know how to create a .xml file from scratch but what you can do is upload an existing .xml file and change the parameters which you would like to include or change, e.g. the time steps or the subjects characteristics, with the "set" function. I have started to do that for the IK tool:
ikTool = InverseKinematicsTool('C:\Users\Kathinka\Desktop\MATLAB TO OPENSIM\Setup_IK.xml');
ikTool.setStartTime(Time(1,2));
ikTool.setEndTime(Time(1,3));
ikTool.setMarkerDataFileName();
Then you simply output the results (I think "print" is the command
https://simtk.org/api_docs/opensim/api_ ... 2fd8415cf5 ). If you have more than one participant just loop it that should work,
Best
Ursula
Re: Scale_Setup.xml and Scale_MarkerSet.xml
Posted: Wed Apr 22, 2015 3:11 am
by sgl
Hello Emile and Ursula,
Thank you both for your answers. I had already used notepad to change some information in the xml file, as for instance the markers used to scale, the two trc files and the subject name. However I hoped I could output an xml file for any project and any subject, by giving Matlab some simple input information: using a Matlab script that would ask you for a file with your markers, the markers used for scaling, the subject's caracteristics, and it's trc files.
That way, you should'nt have to change the xml file itself for each project and each subject, but only select the files containing the required infomration
Thank you a lot for your answer Ursula, I did not know about the 'set' function. However you use the function InverseKinematicsTool; is this a Matlab routine given by OpenSim in the toolbox 'Matlab' in the OpenSim install directory ?
Best,
Alice
Re: Scale_Setup.xml and Scale_MarkerSet.xml
Posted: Wed Apr 22, 2015 3:29 am
by uktrinler1986
Hi Alice
I am not sure if I understand your question correctly. These functions are defined in the API of OpenSim (
https://simtk.org/api_docs/opensim/api_ ... tated.html). There you can find all commands you can use with MATLAB after you have configurised MATLAB with OpenSim using the configureOpenSim.m file provided in the OpenSim 3.2\Scripts\Matlab folder.
I hope this answers your question!
Best
Ursula
Re: Scale_Setup.xml and Scale_MarkerSet.xml
Posted: Tue May 12, 2015 5:09 am
by sgl
Hi Ursula,
I actually have a problem using the configureOpensim.m file. It returns muliple errors I did not manage to solve, and this is why I tried to do it on my own... Did you have any poblems using this matlab file ?
Thank you again for your help,
Alice
Re: Scale_Setup.xml and Scale_MarkerSet.xml
Posted: Tue May 12, 2015 5:17 am
by stefanlambrecht
You need to open/run Matlab with administrator privileges (if I am not mistaken there is a step-by-step guide on the OpenSim website with regard to this:
http://simtk-confluence.stanford.edu:80 ... ith+Matlab).
Re: Scale_Setup.xml and Scale_MarkerSet.xml
Posted: Tue May 12, 2015 5:46 am
by sgl
Hello Stefan,
Thanks a lot for your help. I had already done this before but I think the problem was that I had 2 OpenSim versions. I now erased the oldest one and with only one OpenSim installaion it worked perfectly.
Thank you,
Alice