Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

From Nexus 2.2 and later releases, to simplify biomechanical modeling, additional MATLAB scripts are available in the Nexus SDK.

Classes that represent trajectories (read from Nexus or created as modeled markers), body segments, and angle outputs have been included to ease modeling of biomechanics based on Nexus data.

Sample functions include the following.

Code Block
titleCalculating the angles between two segments
% Calculate the angle between two segments.     
% Can choose euler, fixed or helical angle.
% Specify order of output angles for fixed and euler.

  LKneeAnglesEulerML = AngleBetween( LThigh, LShank, 'euler', 'yxz' );
  LKneeAnglesEulerML.Create( vicon );
  LKneeAnglesEulerML.Write( vicon );   
  LKneeAnglesFixedML = AngleBetween( LThigh, LShank, 'fixed' );
  LKneeAnglesFixedML.Create( vicon ); 
  LKneeAnglesFixedML.Write( vicon ); 
  LKneeAnglesHelicalML = AngleBetween( LThigh, LShank, 'helical' );
  LKneeAnglesHelicalML.Create( vicon );      
  LKneeAnglesHelicalML.Write( vicon )
Code Block
titleCreating modeled markers based on existing trajectory data
% Create a trajectory from the segment origin 
  LThighPosML = NexusTrajectory( 'Colin' ); 
  LThighPosML.SetPosition( LThigh.Position() );
  LThighPosML.Create( vicon );  
  LThighPosML.Write( vicon );  
Code Block
titleTranslating points in the coordinate system of existing segments
% Create a global trajectory that is offset by (100,0,0) in the
% segment coordinate system
  Offset = NexusTrajectory('Colin');
  Offset.SetPosition( [100;0;0] );
  TestTranslateML = LKNE + Offset*LThigh - LThigh.Position(); 
  TestTranslateML = LThigh.TranslatePointInSegment( LKNE, [100; 0; 0 ] );
  TestTranslateML.Create( vicon );
  TestTranslateML.Write( vicon );