diff --git a/ShoulderCase/@Glenoid/Glenoid.m b/ShoulderCase/@Glenoid/Glenoid.m index 0459abc..e0deba7 100644 --- a/ShoulderCase/@Glenoid/Glenoid.m +++ b/ShoulderCase/@Glenoid/Glenoid.m @@ -1,99 +1,100 @@ classdef (Abstract) Glenoid < handle %GLENOID Summary of this class goes here % Detailed explanation goes here % Need to load surface points from Amira (or auto-segment) % Need to set anatomical calculation, and use the scapular coord.Syst % TODO % loadMatlab() properties surface % points of the glenoid surface load glenoid surface center % Glenoid center in CT coordinate system centerLocal % Glenoid center in scapula coordinate system radius centerLine posteroAnteriorLine inferoSuperiorLine depth width height anteroSuperiorAngle versionAmplitude versionOrientation version inclination + retroversion density comment fittedSphere scapula walch end methods (Abstract) load(obj); end methods (Access = protected) % Only Scapula is allowed to construct a Glenoid function obj = Glenoid(scapula) %GLENOID Construct an instance of this class % Detailed explanation goes here obj.surface = []; obj.center = []; obj.centerLocal.x = []; obj.centerLocal.y = []; obj.centerLocal.z = []; obj.radius = []; obj.depth = []; obj.width = []; obj.height = []; obj.anteroSuperiorAngle = []; obj.versionAmplitude = []; obj.versionOrientation = []; obj.version = []; obj.inclination = []; obj.density = []; obj.comment = []; obj.fittedSphere = Sphere(); obj.scapula = scapula; obj.walch = []; end end methods function outputArg = morphology(obj) % Calculate morphological properties of the glenoid from its surface: % center, center line, radius, depth, width, height, % versionAmpl, versionOrient, version, inclination, % antero-superior angle outputArg = 1; try obj.fittedSphere.fitTo(obj.surface.points); obj.measureCenter; obj.measureCenterLocal; obj.measureCenterLine; obj.measureRadius; obj.measureDepth; obj.measureWidthAndHeight; obj.measureVersionAndInclination; obj.measureAnteroSuperiorAngle; catch outputArg = 0; end end end end diff --git a/ShoulderCase/@Glenoid/measureRetroversion.m b/ShoulderCase/@Glenoid/measureRetroversion.m new file mode 100644 index 0000000..3610d85 --- /dev/null +++ b/ShoulderCase/@Glenoid/measureRetroversion.m @@ -0,0 +1,19 @@ +function measureRetroversion(obj) + % Glenoid retroversion is the angle between the glenoid postero-anterior line + % and the line perpendicular to the Friedman's line that goes through the most + % anterior glenoid rim point. + % + % obj.measurePosteroAnteriorLine() and obj.scapula.measureFriedmansLine() must + % have been run before measuring the glenoid retroversion. + FL = obj.scapula.friedmansLine; + anteriorRimPoint = obj.getAnatomicalExtremeRimPoints().anterior; + FLToAnteriorRimPoint = FL.orthogonalComplementToPoint(anteriorRimPoint); + + % Lines projection on scapular axial plane. + IS = Vector([0 0 0], obj.scapula.coordSys.IS); + FLToAnteriorRimPointXZ = IS.orthogonalComplementToPoint(FLToAnteriorRimPoint.vector); + glenoidPosteroAnteriorLineXZ = IS.orthogonalComplementToPoint(obj.posteroAnteriorLine.vector); + + retroversionRotation = vrrotvec(FLToAnteriorRimPointXZ.vector, glenoidPosteroAnteriorLineXZ.vector); + obj.retroversion = -sign(dot(IS.vector,retroversionRotation(1:3)))*rad2deg(retroversionRotation(4)); +end \ No newline at end of file