Page 1 of 1

Getting muscle path information in Matlab

Posted: Mon Jun 24, 2013 10:13 am
by dennisa
Hi All,

I am trying to get muscle path information out of a model via Matlab. I am able to get the path point set with something like:

aMuscleGeometry = aMuscle.getGeometryPath();
aPathPointSet = aMuscleGeometry.getPathPointSet();

and then can get information, e.g. body name and location, for muscle "n":

Body = aPathPointSet.get(n).getBodyName
Location = ArrayDouble.getValuesFromVec3(aPathPointSet.get(n).getLocation())

However, what I'd really like to get is the "current" muscle path, including wrapping points if present. I've tried using "getCurrentPath", i.e.:

CurrentPath = aMuscleGeometry.getCurrentPath(state);

This seems to work, but I can't figure out how to get actual path point information (body or location) at this point.
"CurrentPath.get(n).getLocation()" returns an error.

Unfortunately I'm not well versed in java. I suspect there's something very basic that I'm missing, but I haven't been able to figure out what. Thoughts?

Thanks,
Dennis

Re: Getting muscle path information in Matlab

Posted: Mon Jun 24, 2013 10:49 am
by aymanh
Hi Dennis,

You should be looking at the Doxygen documentation for available methods that you can call (in Matlab pressing TAB should show possible completions. In the case of GeometryPath you'd need to call something like

Code: Select all

currentPath = aMuscleGeometry.getCurrentPath(state);
currentPath.getitem(i).getLocation()
Hope this helps,
-Ayman

Re: Getting muscle path information in Matlab

Posted: Mon Jun 24, 2013 10:58 am
by dennisa
Yes, this works, many thanks Ayman!

I knew I was missing something simple, and I had not picked up on the "Tab" trick either. That will certainly be helpful!

-Dennis