diff --git a/ShoulderCase/@Humerus/Humerus.m b/ShoulderCase/@Humerus/Humerus.m index 026f3d4..fd807cc 100644 --- a/ShoulderCase/@Humerus/Humerus.m +++ b/ShoulderCase/@Humerus/Humerus.m @@ -1,99 +1,102 @@ classdef Humerus < handle %HUMERUS Properties and methods associated to the humerus % Detailed explanation goes here % Author: Alexandre Terrier, EPFL-LBO % Creation date: 2018-07-01 % Revision date: 2019-06-29 % % TO DO: % Local coordinate system properties landmarks % 5 3D points center % Center of the humeral head (sphere fit on 5 points radius % Radius of the humeral head (sphere fit on 5 points jointRadius % Radius of cuvature of the articular surface (todo) SHSAngle % Scapulo-humeral subluxation angle SHSPA % Scapulo-humeral subluxation angle in the postero-anterior direction (posterior is negative, as for glenoid version) SHSIS % Scapulo-humeral subluxation angle in the infero-superior direction SHSAmpl % Scapulo-humeral subluxation (center ofset / radius) SHSOrient % Scapulo-humral subluxation orientation (0 degree is posterior) GHSAmpl % Gleno-humeral subluxation (center ofset / radius) GHSOrient % Gleno-humral subluxation orientation (0 degree is posterior) subluxationIndex3D shoulder end methods (Access = ?Shoulder) % Only Shoulder is allowed to construct Humerus function obj = Humerus(shoulder) %HUMERUS Construct an instance of this class % Detailed explanation goes here obj.landmarks = []; obj.center = []; obj.radius = []; obj.jointRadius = []; obj.SHSAngle = []; obj.SHSPA = []; obj.SHSIS = []; obj.SHSAmpl = []; obj.SHSOrient = []; obj.GHSAmpl = []; obj.GHSOrient = []; obj.shoulder = shoulder; end end methods function output = loadData(obj) % Call methods that can be run after the ShoulderCase object has % been instanciated. SCase = obj.shoulder.SCase; if exist(... fullfile(SCase.dataSlicerPath, "HH_landmarks_"+obj.shoulder.side+".mrk.json"),... "file") success = Logger.timeLogExecution(... "Humerus load landmarks (slicer): ",... @(obj) obj.loadSlicerLandmarks, obj); elseif not(isempty(dir(fullfile(SCase.dataAmiraPath, "*HH*.landmarksAscii")))) success = Logger.timeLogExecution(... "Humerus load landmarks (slicer): ",... @(obj) obj.loadSlicerLandmarks, obj); else success = Logger.timeLogExecution(... "Humerus load landmarks: ",... @(message) error(message), "No landmarks file found"); end output = success; end function output = morphology(obj) % Call methods that can be run after loadData() methods has been run % by all ShoulderCase objects. success = Logger.timeLogExecution(... "Humerus center and radius: ",... @(obj) obj.measureCenterAndRadius, obj); output = success; end function output = measureFirst(obj) % Call methods that can be run after morphology() methods has been run % by all ShoulderCase objects. success = Logger.timeLogExecution(... "Humerus scapulo-humeral subluxation: ",... @(obj) obj.measureScapuloHumeralSubluxation, obj); output = success; end function output = measureSecond(obj) % Call methods that can be run after measureFirst() methods has been run % by all ShoulderCase objects. success = Logger.timeLogExecution(... "Humerus gleno-humeral subluxation: ",... @(obj) obj.measureGlenoHumeralSubluxation, obj); + success = success & Logger.timeLogExecution(... + "Humerus 3D subluxation index: ",... + @(obj) obj.measureSubluxationIndex3D, obj); output = success; end end end