Page MenuHomec4science

KINEMATICS_TOOL_main_file.m
No OneTemporary

File Metadata

Created
Mon, Nov 4, 05:37

KINEMATICS_TOOL_main_file.m

%{
--------------------------------------------------------------------------
GUI FOR RUNNING THE KINEMATICS TOOL
--------------------------------------------------------------------------
File Description :
This file is the main file for the kinematics toolbox GUI. In the GUI you
can build a motion and visualise it. There are 9 minimal coordinates,
you can build each one seperatly by defining the inital and final values,
setting the order of the polynomials with which they are built. You can
also impose the initial and final values of the higher order polynomials.
--------------------------------------------------------------------------
File Structure :
The GUI figure is created in KHandle. The pushbuttons are defined next,
followed by the initialisation script. All the GUI control structures are
contained in KGUIHandle. The main 3-D axis is called
KinemVisualisationAxes. There are 9+2 other axis for viewing the angle
evolutions. All the graphics are contained in a single strucure :
KPlotHandles.
--------------------------------------------------------------------------
Contents of the Interactive GUI structure :
PushButton Section
KGUIHandle.Close_Button
KGUIHandle.Save_Visualisation_Button
KGUIHandle.Build_Kinematics_Button
Static Elements
KGUIHandle.MinCord.Title
KGUIHandle.MinCord.X0Title
KGUIHandle.MinCord.XTTitle
Dynamic Elements
KGUIHandle.MinCord.M1Text
KGUIHandle.MinCord.M1ValueI
KGUIHandle.MinCord.M1ValueT
KGUIHandle.MinCord.M2Text
KGUIHandle.MinCord.M2ValueI
KGUIHandle.MinCord.M2ValueT
KGUIHandle.MinCord.M3Text
KGUIHandle.MinCord.M3ValueI
KGUIHandle.MinCord.M3ValueT
KGUIHandle.MinCord.M4Text
KGUIHandle.MinCord.M4ValueI
KGUIHandle.MinCord.M4ValueT
KGUIHandle.MinCord.M5Text
KGUIHandle.MinCord.M5ValueI
KGUIHandle.MinCord.M5ValueT
KGUIHandle.MinCord.M6Text
KGUIHandle.MinCord.M6ValueI
KGUIHandle.MinCord.M6ValueT
KGUIHandle.MinCord.M7Text
KGUIHandle.MinCord.M7ValueI
KGUIHandle.MinCord.M7ValueT
--------------------------------------------------------------------------
The graphical hierarchy is :
KHandle
-> KinemVisualisationAxes
-> KPlotHandles
-> JEAVisualisationAxes(1 - > 9)
-> JEAPlotHandles(1 -> 9)
--------------------------------------------------------------------------
%}
%--------------------------------------------------------------------------
% CREATE THE FIGURE
%--------------------------------------------------------------------------
KHandle = figure(...
'color', 'white',...
'units', 'normalized',...
'position', [0.1, 0.1, 0.4, 0.9],...
'toolbar', 'figure',...
'name', 'EPFL - LBO Upper Extremity Model: KINEMATICS TOOLBOX');
%--------------------------------------------------------------------------
% REBUILD THE MOTION (IF INITIAL CONFIGURATION HAS CHANGED)
% just a duplication of the whole MAIN_INITIALISATION_build_data_kinematics.
%--------------------------------------------------------------------------
KEDATA = KINEMATICS_TOOL_get_initial_values(REDATA, BLDATA);
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
% CREATE THE BUTTONS
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
% Push Button for Closing the GUI
KGUIHandle.Close_Button = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.95, 0.3, 0.05],...
'style', 'pushbutton',...
'string', '<html> <b>- CLOSE TOOL ---------------------------------------</b><br><p style="font-size: 90%;"> <i>Closes the tool and deletes all the local variables</i></p>',...
'fontsize', 14,...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Close Kinematics Tool'));
% Push Button to Build Motion (kinematics) Using the Initial and Final
% Values of the Minimal Coordinates (Method 1)
KGUIHandle.Build_Kinematics_Button_1 = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.9, 0.3, 0.05],...
'style', 'pushbutton',...
'string', '<html> <b>- BUILD MOTION (Option 1)----------------------</b><br><p style="font-size: 90%;"> <i>Builds the joint kinematics without measured data</i></p>',...
'fontsize', 14,...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Build Kinematics'));
% Push Button to Build Motion (kinematics) Using the Measured Kinematics (Method 2)
KGUIHandle.Build_Kinematics_Button_2 = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.85, 0.3, 0.05],...
'style', 'pushbutton',...
'string', '<html> <b>- BUILD MOTION (Option 2)----------------------</b><br><p style="font-size: 90%;"> <i>Reconstruct a measured motion</i></p>',...
'fontsize', 14,...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Build Kinematics 2'));
% Push Button to View the Motion
KGUIHandle.Build_Kinematics_Button = uicontrol(...
'units', 'normalized',...
'position', [0.7, 0.80, 0.3, 0.05],...
'style', 'pushbutton',...
'string', '<html> <b>- VIEW MOTION -------------------------------------</b><br><p style="font-size: 90%;"> <i>Launches a small GUI where the motion is visualised</i></p>',...
'fontsize', 14,...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('View Motion'));
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
% INTERACTIVE ELLEMENTS
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
KGUIHandle.MinCord.Title = uicontrol(...
'units', 'normalized',...
'position', [0, 0.98, 0.35, 0.02],...
'style', 'text',...
'string', 'Minimal Coordinates Initial and Final Conditions',...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold');
KGUIHandle.MinCord.X0Title = uicontrol(...
'units', 'normalized',...
'position', [0.1, 0.96, 0.125, 0.02],...
'style', 'text',...
'string', 'Initial Values',...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold');
KGUIHandle.MinCord.XTTitle = uicontrol(...
'units', 'normalized',...
'position', [0.225, 0.96, 0.125, 0.02],...
'style', 'text',...
'string', 'Final Values',...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold');
KGUIHandle.MinCord.DCTitle = uicontrol(...
'units', 'normalized',...
'position', [0.4, 0.98, 0.3, 0.02],...
'style', 'text',...
'string', 'Derivative Conditions (dX(t_0), dX(t_f), etc)',...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold');
%------------------------------------------
% First Coordinate
%------------------------------------------
KGUIHandle.MinCord.M1Text = uicontrol(...
'units', 'normalized',...
'position', [0.05, 0.91, 0.05, 0.04],...
'style', 'text',...
'string', 'M1',...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold');
KGUIHandle.MinCord.M1ValueI = uicontrol(...
'units', 'normalized',...
'position', [0.1, 0.93, 0.125, 0.03],...
'style', 'edit',...
'string', num2str(KEDATA.Initial_Minimal_Coordinate(1,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M1ValueT = uicontrol(...
'units', 'normalized',...
'position', [0.225, 0.93, 0.125, 0.03],...
'style', 'edit',...
'string', num2str(KEDATA.Final_Minimal_Coordinate(1,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M1DerivCondEdit = uicontrol(...
'units', 'normalized',...
'position', [0.45, 0.93, 0.25, 0.03],...
'style', 'edit',...
'string', '[0, 0, 0, 0, 0, 0, 0, 0]',...
'value', 2,...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
%------------------------------------------
% Second Coordinate
%------------------------------------------
KGUIHandle.MinCord.M2Text = uicontrol(...
'units', 'normalized',...
'position', [0.05, 0.88, 0.05, 0.04],...
'style', 'text',...
'string', 'M2',...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold');
KGUIHandle.MinCord.M2ValueI = uicontrol(...
'units', 'normalized',...
'position', [0.1, 0.90, 0.125, 0.03],...
'style', 'edit',...
'string', num2str(KEDATA.Initial_Minimal_Coordinate(2,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M2ValueT = uicontrol(...
'units', 'normalized',...
'position', [0.225, 0.90, 0.125, 0.03],...
'style', 'edit',...
'string', '-30',... %num2str(KEDATA.Final_Minimal_Coordinate(2,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M2DerivCondEdit = uicontrol(...
'units', 'normalized',...
'position', [0.45, 0.90, 0.25, 0.03],...
'style', 'edit',...
'string', '[0, 0, 0, 0, 0, 0, 0, 0]',...
'value', 2,...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
%------------------------------------------
% Third Coordinate
%------------------------------------------
KGUIHandle.MinCord.M3Text = uicontrol(...
'units', 'normalized',...
'position', [0.05, 0.85, 0.05, 0.04],...
'style', 'text',...
'string', 'M3',...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold');
KGUIHandle.MinCord.M3ValueI = uicontrol(...
'units', 'normalized',...
'position', [0.1, 0.87, 0.125, 0.03],...
'style', 'edit',...
'string', num2str(KEDATA.Initial_Minimal_Coordinate(3,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M3ValueT = uicontrol(...
'units', 'normalized',...
'position', [0.225, 0.87, 0.125, 0.03],...
'style', 'edit',...
'string', '91',... %num2str(KEDATA.Final_Minimal_Coordinate(3,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M3DerivCondEdit = uicontrol(...
'units', 'normalized',...
'position', [0.45, 0.87, 0.25, 0.03],...
'style', 'edit',...
'string', '[0, 0, 0, 0, 0, 0, 0, 0]',...
'value', 2,...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
%------------------------------------------
% Fourth Coordinate
%------------------------------------------
KGUIHandle.MinCord.M4Text = uicontrol(...
'units', 'normalized',...
'position', [0.05, 0.82, 0.05, 0.04],...
'style', 'text',...
'string', 'M4',...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold');
KGUIHandle.MinCord.M4ValueI = uicontrol(...
'units', 'normalized',...
'position', [0.1, 0.84, 0.125, 0.03],...
'style', 'edit',...
'string', num2str(KEDATA.Initial_Minimal_Coordinate(4,1)),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M4ValueT = uicontrol(...
'units', 'normalized',...
'position', [0.225, 0.84, 0.125, 0.03],...
'style', 'edit',...
'string', '0.58914',... %num2str(KEDATA.Final_Minimal_Coordinate(4,1)),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M4DerivCondEdit = uicontrol(...
'units', 'normalized',...
'position', [0.45, 0.84, 0.25, 0.03],...
'style', 'edit',...
'string', '[0, 0, 0, 0, 0, 0, 0, 0]',...
'value', 2,...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
%------------------------------------------
% Fifth Coordinate
%------------------------------------------
KGUIHandle.MinCord.M5Text = uicontrol(...
'units', 'normalized',...
'position', [0.05, 0.79, 0.05, 0.04],...
'style', 'text',...
'string', 'M5',...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold');
KGUIHandle.MinCord.M5ValueI = uicontrol(...
'units', 'normalized',...
'position', [0.1, 0.81, 0.125, 0.03],...
'style', 'edit',...
'string', '0',...%num2str(KEDATA.Initial_Minimal_Coordinate(5,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M5ValueT = uicontrol(...
'units', 'normalized',...
'position', [0.225, 0.81, 0.125, 0.03],...
'style', 'edit',...
'string', '0',...%num2str(KEDATA.Final_Minimal_Coordinate(5,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M5DerivCondEdit = uicontrol(...
'units', 'normalized',...
'position', [0.45, 0.81, 0.25, 0.03],...
'style', 'edit',...
'string', '[0, 0, 0, 0, 0, 0, 0, 0]',...
'value', 2,...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
%------------------------------------------
% Sixth Coordinate
%------------------------------------------
KGUIHandle.MinCord.M6Text = uicontrol(...
'units', 'normalized',...
'position', [0.05, 0.76, 0.05, 0.04],...
'style', 'text',...
'string', 'M6',...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold');
KGUIHandle.MinCord.M6ValueI = uicontrol(...
'units', 'normalized',...
'position', [0.1, 0.78, 0.125, 0.03],...
'style', 'edit',...
'string', '-1',... %num2str(KEDATA.Initial_Minimal_Coordinate(6,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M6ValueT = uicontrol(...
'units', 'normalized',...
'position', [0.225, 0.78, 0.125, 0.03],...
'style', 'edit',...
'string', '-140',... %num2str(KEDATA.Final_Minimal_Coordinate(6,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M6DerivCondEdit = uicontrol(...
'units', 'normalized',...
'position', [0.45, 0.78, 0.25, 0.03],...
'style', 'edit',...
'string', '[0, 0, 0, 0, 0, 0, 0, 0]',...
'value', 2,...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
%------------------------------------------
% Seventh Coordinate
%------------------------------------------
KGUIHandle.MinCord.M7Text = uicontrol(...
'units', 'normalized',...
'position', [0.05, 0.73, 0.05, 0.04],...
'style', 'text',...
'string', 'M7',...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold');
KGUIHandle.MinCord.M7ValueI = uicontrol(...
'units', 'normalized',...
'position', [0.1, 0.75, 0.125, 0.03],...
'style', 'edit',...
'string', '30',... %num2str(KEDATA.Initial_Minimal_Coordinate(7,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M7ValueT = uicontrol(...
'units', 'normalized',...
'position', [0.225, 0.75, 0.125, 0.03],...
'style', 'edit',...
'string', '30',... %num2str(KEDATA.Final_Minimal_Coordinate(7,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M7DerivCondEdit = uicontrol(...
'units', 'normalized',...
'position', [0.45, 0.75, 0.25, 0.03],...
'style', 'edit',...
'string', '[0, 0, 0, 0, 0, 0, 0, 0]',...
'value', 2,...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
%------------------------------------------
% Eighth Coordinate
%------------------------------------------
KGUIHandle.MinCord.M8Text = uicontrol(...
'units', 'normalized',...
'position', [0.05, 0.70, 0.05, 0.04],...
'style', 'text',...
'string', 'M8',...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold');
KGUIHandle.MinCord.M8ValueI = uicontrol(...
'units', 'normalized',...
'position', [0.1, 0.72, 0.125, 0.03],...
'style', 'edit',...
'string', '0',... %num2str(KEDATA.Initial_Minimal_Coordinate(8,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M8ValueT = uicontrol(...
'units', 'normalized',...
'position', [0.225, 0.72, 0.125, 0.03],...
'style', 'edit',...
'string', '0',... %num2str(KEDATA.Final_Minimal_Coordinate(8,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M8DerivCondEdit = uicontrol(...
'units', 'normalized',...
'position', [0.45, 0.72, 0.25, 0.03],...
'style', 'edit',...
'string', '[0, 0, 0, 0, 0, 0, 0, 0]',...
'value', 2,...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
%------------------------------------------
% Ninth Coordinate
%------------------------------------------
KGUIHandle.MinCord.M9Text = uicontrol(...
'units', 'normalized',...
'position', [0.05, 0.67, 0.05, 0.04],...
'style', 'text',...
'string', 'M9',...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold');
KGUIHandle.MinCord.M9ValueI = uicontrol(...
'units', 'normalized',...
'position', [0.1, 0.69, 0.125, 0.03],...
'style', 'edit',...
'string', '0',... %num2str(KEDATA.Initial_Minimal_Coordinate(9,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M9ValueT = uicontrol(...
'units', 'normalized',...
'position', [0.225, 0.69, 0.125, 0.03],...
'style', 'edit',...
'string', '0',... %num2str(KEDATA.Final_Minimal_Coordinate(9,1)*180/pi),...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
KGUIHandle.MinCord.M9DerivCondEdit = uicontrol(...
'units', 'normalized',...
'position', [0.45, 0.69, 0.25, 0.03],...
'style', 'edit',...
'string', '[0, 0, 0, 0, 0, 0, 0, 0]',...
'value', 2,...
'fontsize', 14,...
'backgroundcolor', 'white',...
'fontweight', 'bold',...
'callback', KINEMATICS_TOOL_script_generator('Update UIcontrols'));
% Legend for all values
KGUIHandle.MinCord.Legend(1,1) = uicontrol(...
'units', 'normalized',...
'position', [0.71, 0.78, 0.3, 0.02],...
'style', 'text',...
'HorizontalAlignment','left',...
'string', ['M1 : Clavicula Axial Rotation [DEG]'],...
'fontsize', 14,...
'backgroundcolor', 'white');
KGUIHandle.MinCord.Legend(2,1) = uicontrol(...
'units', 'normalized',...
'position', [0.71, 0.76, 0.3, 0.02],...
'style', 'text',...
'HorizontalAlignment','left',...
'string', ['M2 : AI parametric coordinate 1 [DEG]'],...
'fontsize', 14,...
'backgroundcolor', 'white');
KGUIHandle.MinCord.Legend(3,1) = uicontrol(...
'units', 'normalized',...
'position', [0.71, 0.74, 0.3, 0.02],...
'style', 'text',...
'HorizontalAlignment','left',...
'string', ['M3 : AI parametric coordinate 2 [DEG]'],...
'fontsize', 14,...
'backgroundcolor', 'white');
KGUIHandle.MinCord.Legend(4,1) = uicontrol(...
'units', 'normalized',...
'position', [0.71, 0.72, 0.3, 0.02],...
'style', 'text',...
'HorizontalAlignment','left',...
'string', ['M4 : TS intersection coordinate [%]'],...
'fontsize', 14,...
'backgroundcolor', 'white');
% Legend for all values
KGUIHandle.MinCord.Legend(5,1) = uicontrol(...
'units', 'normalized',...
'position', [0.71, 0.70, 0.30, 0.02],...
'style', 'text',...
'HorizontalAlignment','left',...
'string', ['M5 : Humerus Axial Rotation [DEG]'],...
'fontsize', 14,...
'backgroundcolor', 'white');
% Legend for all values
KGUIHandle.MinCord.Legend(6,1) = uicontrol(...
'units', 'normalized',...
'position', [0.71, 0.68, 0.3, 0.02],...
'style', 'text',...
'HorizontalAlignment','left',...
'string', ['M6 : Humerus abduction angle [DEG]'],...
'fontsize', 14,...
'backgroundcolor', 'white');
% Legend for all values
KGUIHandle.MinCord.Legend(7,1) = uicontrol(...
'units', 'normalized',...
'position', [0.71, 0.66, 0.3, 0.02],...
'style', 'text',...
'HorizontalAlignment','left',...
'string', ['M7 : Humerus Elevation Plane [DEG]'],...
'fontsize', 14,...
'backgroundcolor', 'white');
% Legend for all values
KGUIHandle.MinCord.Legend(8,1) = uicontrol(...
'units', 'normalized',...
'position', [0.71, 0.64, 0.30, 0.02],...
'style', 'text',...
'HorizontalAlignment','left',...
'string', ['M8 : Ulna Flexion/Extension [DEG]'],...
'fontsize', 14,...
'backgroundcolor', 'white');
KGUIHandle.MinCord.Legend(9,1) = uicontrol(...
'units', 'normalized',...
'position', [0.71, 0.62, 0.30, 0.02],...
'style', 'text',...
'HorizontalAlignment','left',...
'string', ['M9 : Radius Prnation/Supination [DEG]'],...
'fontsize', 14,...
'backgroundcolor', 'white');
% Legend for all values
KGUIHandle.MinCord.NbPointsTxt = uicontrol(...
'units', 'normalized',...
'position', [0.05, 0.65, 0.15, 0.02],...
'style', 'text',...
'string', 'Number Of Points:',...
'fontsize', 14,...
'fontweight', 'bold',...
'backgroundcolor', 'white');
% Legend for all values
KGUIHandle.MinCord.NbPointsEdit = uicontrol(...
'units', 'normalized',...
'position', [0.2, 0.65, 0.1, 0.02],...
'style', 'edit',...
'string', '100',...%num2str(KEDATA.NbPoints),...
'fontsize', 14,...
'backgroundcolor', 'white');
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
% CREATE THE MENU
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
KGUIHandle.Polynomial_Order_Menu.MainList = uimenu(...
KHandle,...
'label', 'Set Polynimal Order');
% Interactive part of menu
KGUIHandle.Polynomial_Order_Menu.Options = zeros(10,5);
KNAMES = {...
'Coordinate 1',...
'Coordinate 2',...
'Coordinate 3',...
'Coordinate 4',...
'Coordinate 5',...
'Coordinate 6',...
'Coordinate 7',...
'Coordinate 8',...
'Coordinate 9',...
'All Coordinates'};
% Create the Entire List
for i = 1:10
KGUIHandle.Polynomial_Order_Menu.Options(i,1) = uimenu(KGUIHandle.Polynomial_Order_Menu.MainList,...
'label', KNAMES{1,i});
for j = 1:4
if j == 2
% Different callback for all coordinates
if i == 10
KGUIHandle.Polynomial_Order_Menu.Options(i,j+1) = uimenu(KGUIHandle.Polynomial_Order_Menu.Options(i,1),...
'label', ['Order ', num2str(2*j+1)],...
'UserData', i,...
'Checked', 'on',...
'Callback', KINEMATICS_TOOL_script_generator('Menu Functions II', i, j));
else
KGUIHandle.Polynomial_Order_Menu.Options(i,j+1) = uimenu(KGUIHandle.Polynomial_Order_Menu.Options(i,1),...
'label', ['Order ', num2str(2*j+1)],...
'UserData', i,...
'Checked', 'on',...
'Callback', KINEMATICS_TOOL_script_generator('Menu Functions I', i, j));
end
else
% Different callback for all coordinates
if i == 10
KGUIHandle.Polynomial_Order_Menu.Options(i,j+1) = uimenu(KGUIHandle.Polynomial_Order_Menu.Options(i,1),...
'label', ['Order ', num2str(2*j+1)],...
'UserData', i,...
'Checked', 'off',...
'Callback', KINEMATICS_TOOL_script_generator('Menu Functions II', i, j));
else
KGUIHandle.Polynomial_Order_Menu.Options(i,j+1) = uimenu(KGUIHandle.Polynomial_Order_Menu.Options(i,1),...
'label', ['Order ', num2str(2*j+1)],...
'UserData', i,...
'Checked', 'off',...
'Callback', KINEMATICS_TOOL_script_generator('Menu Functions I', i, j));
end
end
end
end
% Create a Help Menu
KGUIHandle.HelpMenu(1,1) = uimenu(KHandle,...
'label', 'GUI HELP');
KGUIHandle.HelpMenu(2,1) = uimenu(KGUIHandle.HelpMenu(1,1),...
'label', 'About?',...
'callback', KINEMATICS_TOOL_script_generator('Help'));
%--------------------------------------------------------------------------
% CREATE VISUALISATION AXES
%--------------------------------------------------------------------------
% Central Axis
KIVisualisationAxis.Central = axes(...
'units', 'normalized',...
'position', [0.25, 0, 0.5, 0.49],...
'xtick', [],...
'ytick', []);
% Clavicula Axial Rotation
KIVisualisationAxis.Coord(1,1) = axes(...
'units', 'normalized',...
'position', [0.5, 0.50, 0.2, 0.1],...
'xtick', [],...
'ytick', [],...
'box', 'on');
% Clavicula Depression (-) / Elevation (+)
KIVisualisationAxis.Coord(2,1) = axes(...
'units', 'normalized',...
'position', [0.79, 0.38, 0.2, 0.1],...
'xtick', [],...
'ytick', [],...
'box', 'on');
% Clavicula Retraction (-) / Protraction (+)
KIVisualisationAxis.Coord(3,1) = axes(...
'units', 'normalized',...
'position', [0.79, 0.50, 0.2, 0.1],...
'xtick', [],...
'ytick', [],...
'box', 'on');
% Ulna Extension (-) / Flexion (+)
KIVisualisationAxis.Coord(10,1) = axes(...
'units', 'normalized',...
'position', [0.79, 0.25, 0.2, 0.1],...
'xtick', [],...
'ytick', [],...
'box', 'on');
% Radius Supination (-) / Pronation (+)
KIVisualisationAxis.Coord(11,1) = axes(...
'units', 'normalized',...
'position', [0.79, 0.12, 0.2, 0.1],...
'xtick', [],...
'ytick', [],...
'box', 'on');
% Scapula External Tilt(-)/ Internal Tilt (+)
KIVisualisationAxis.Coord(4,1) = axes(...
'units', 'normalized',...
'position', [0.01, 0.38, 0.2, 0.1],...
'xtick', [],...
'ytick', [],...
'box', 'on');
% Scapula Depression (-) / Elevation (+)
KIVisualisationAxis.Coord(5,1) = axes(...
'units', 'normalized',...
'position', [0.01, 0.50, 0.2, 0.1],...
'xtick', [],...
'ytick', [],...
'box', 'on');
% Scapula Retraction (-) / Protraction (+)
KIVisualisationAxis.Coord(6,1) = axes(...
'units', 'normalized',...
'position', [0.25, 0.50, 0.2, 0.1],...
'xtick', [],...
'ytick', [],...
'box', 'on');
% Humerus Axial Rotation
KIVisualisationAxis.Coord(7,1) = axes(...
'units', 'normalized',...
'position', [0.01, 0.26, 0.2, 0.1],...
'xtick', [],...
'ytick', [],...
'box', 'on');
% Humerus Adduction (-) / Abduction (+)
KIVisualisationAxis.Coord(8,1) = axes(...
'units', 'normalized',...
'position', [0.01, 0.01, 0.2, 0.1],...
'xtick', [],...
'ytick', [],...
'box', 'on');
% Humerus Elevation Plan: Posterior (-) / Anterior (+)
KIVisualisationAxis.Coord(9,1) = axes(...
'units', 'normalized',...
'position', [0.01, 0.13, 0.2, 0.1],...
'xtick', [],...
'ytick', [],...
'box', 'on');
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
% INITIALISATION CODE
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
% Set the current axes
set(KHandle, 'currentaxes', KIVisualisationAxis.Central);
% Get the current file path
Cpath = pwd;
% Differentiate for non unix systems
if isunix
Cpath = [Cpath, '/LOGOS/JointsFigure.png'];
else
Cpath = [Cpath, '\LOGOS\JointsFigure.png'];
end
% Load the image of the joints
Image = imread(Cpath);
image(Image)
set(gca, 'xtick', [], 'ytick', []);
% Fill the axes around the main axis with the evolution of each angle
% relative to the abducion angle.
MvtList = {...
'Clavicula Axial Rotation',...
'Clavicula Depression (-) / Elevation (+)',...
'Clavicula Retraction (-) / Protraction (+)',...
'Scapula External Tilt(-)/ Internal Tilt (+)',...
'Scapula Depression (-) / Elevation (+)',...
'Scapula Retraction (-) / Protraction (+)',...
'Humerus Axial Rotation',...
'Humerus Adduction (-) / Abduction (+)',...
'Humerus Elevation: Posterior (-) / Anterior (+)',...%plan
'Ulna Extension (-) / Flexion (+)',...
'Radius Supination (-) / Pronation (+)'};
for AngleId = 1:11
set(KHandle, 'currentaxes', KIVisualisationAxis.Coord(AngleId,1));
plot(KEDATA.Joint_Angle_Evolution(8,:)'*180/pi, KEDATA.Joint_Angle_Evolution(AngleId,:)'*180/pi, 'color', 'red', 'linewidth', 2);
set(gca,...
'xtick', [],...
'ytick', [],...
'XDir', 'reverse',...
'box', 'on',...
'buttondownfcn', KINEMATICS_TOOL_script_generator('Clicked On', AngleId));
title(MvtList{1,AngleId},...
'fontsize', 9, ...
'fontweight', 'bold', ...
'fontname', 'sansserif');
xlim([min(KEDATA.Joint_Angle_Evolution(8,:)'*180/pi), max(KEDATA.Joint_Angle_Evolution(8,:)'*180/pi)]);
end

Event Timeline