Coordinates of muscle points with wrapping surfaces

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Simao Brito da Luz
Posts: 8
Joined: Tue Nov 27, 2012 7:10 pm

Coordinates of muscle points with wrapping surfaces

Post by Simao Brito da Luz » Tue Jun 06, 2017 12:00 am

Hi
Been trying to figure out how to determine the coordinates of muscle points whose trajectory changes due to wrapping surfaces.

Basically would like to know the coordinates of multiple points in the muscle path.
Is PathWrapPoint or getCurrentDisplayPath unavailable in OpenSim 3.3?
Cheers

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

Re: Coordinates of muscle points with wrapping surfaces

Post by Thomas Uchida » Tue Jun 06, 2017 1:42 am

A similar question was asked and answered on this Forum thread: viewtopicPhpbb.php?f=91&t=7723.

User avatar
Simao Brito da Luz
Posts: 8
Joined: Tue Nov 27, 2012 7:10 pm

Re: Coordinates of muscle points with wrapping surfaces

Post by Simao Brito da Luz » Tue Jun 06, 2017 6:48 pm

Thanks Tom
So basically the answer is no. Was this possible in previous OpenSim versions?
Cheers

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

Re: Coordinates of muscle points with wrapping surfaces

Post by Thomas Uchida » Tue Jun 06, 2017 10:58 pm

If you're seeking an answer to the question "Is PathWrapPoint or getCurrentDisplayPath unavailable in OpenSim 3.3?" [emphasis added], then I believe you are correct and the answer is "no". To clarify, if you're trying to extract points along a muscle's path, I believe the scripts (written in both 3.3 and 4.0) posted to topic 7723 (viewtopicPhpbb.php?f=91&t=7723) do that. Please provide more detail if that isn't what you're trying to do.

User avatar
Simao Brito da Luz
Posts: 8
Joined: Tue Nov 27, 2012 7:10 pm

Re: Coordinates of muscle points with wrapping surfaces

Post by Simao Brito da Luz » Tue Jun 06, 2017 11:06 pm

Thanks for your reply Tom
Sorry if i havent been clear.

I would like to determine the coordinates of multiple points along a path that intercepts a wrapping surface. Or the points along the "arc" that is created due to the interception between muscle path and a wrap object.

Cheers

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

Re: Coordinates of muscle points with wrapping surfaces

Post by Thomas Uchida » Tue Jun 06, 2017 11:34 pm

Thanks for clarifying. Not sure you can access the path points that lie on the surface of the wrap object in 3.3, but I think you can at least access the endpoints of the arc via getCurrentPath():

Code: Select all

import org.opensim.modeling.*

% Load model and create underlying computational system.
model = Model('arm26.osim');
state = model.initSystem();

% References to points defining muscle path.
BRA = model.getMuscles().get('BRA');
pathPointSet = BRA.getGeometryPath().getPathPointSet();
currentPath = BRA.getGeometryPath().getCurrentPath(state);

% Inspect pathPointSet.
for i = 0:pathPointSet.getSize()-1
    fprintf('pathPointSet[%d]: %s\n', i, ...
            char(pathPointSet.get(i).getLocation()));
end

% Inspect currentPath.
for i = 0:currentPath.getSize()-1
    fprintf('currentPath[%d]: %s\n', i, ...
            char(currentPath.get(i).getLocation()));
end
The following is displayed in the MATLAB Command Window:

Code: Select all

pathPointSet[0]: ~[0.0068,-0.1739,-0.0036]
pathPointSet[1]: ~[-0.0032,-0.0239,0.0009]
currentPath[0]: ~[0.0068,-0.1739,-0.0036]
currentPath[1]: ~[0.018729,-0.290559,-0.00910357]
currentPath[2]: ~[0.0135788,-0.304312,-0.0100326]
currentPath[3]: ~[-0.0032,-0.0239,0.0009]

User avatar
Simao Brito da Luz
Posts: 8
Joined: Tue Nov 27, 2012 7:10 pm

Re: Coordinates of muscle points with wrapping surfaces

Post by Simao Brito da Luz » Tue Jun 06, 2017 11:41 pm

Thats a start for sure
What about with older versions?
Cheers

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

Re: Coordinates of muscle points with wrapping surfaces

Post by Thomas Uchida » Wed Jun 07, 2017 11:55 am

What about with older versions?
MATLAB scripting wasn't introduced until 3.0. I believe functionality has strictly increased with newer versions.

User avatar
Simao Brito da Luz
Posts: 8
Joined: Tue Nov 27, 2012 7:10 pm

Re: Coordinates of muscle points with wrapping surfaces

Post by Simao Brito da Luz » Wed Jun 07, 2017 5:04 pm

Sure
I think I will try and replicate (in Matlab) a similar method OpenSim uses to recreate the wrapping points around cylinder:
https://github.com/opensim-org/opensim- ... r.cpp#L164
Is the above link the correct one?
Cheers

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

Re: Coordinates of muscle points with wrapping surfaces

Post by Thomas Uchida » Wed Jun 07, 2017 10:36 pm

Is the above link the correct one?
Yes, it looks like that's where the points are calculated.

POST REPLY