diff --git a/ShoulderCase/@Scapula/Scapula.m b/ShoulderCase/@Scapula/Scapula.m index f4e7b97..6ded9d7 100644 --- a/ShoulderCase/@Scapula/Scapula.m +++ b/ShoulderCase/@Scapula/Scapula.m @@ -1,116 +1,117 @@ classdef (Abstract) Scapula < handle % This class defines the scapula. Landmarks are used to define its % coordinate system. It includes the glenoid object. properties angulusInferior = []; % Landmark Angulus Inferior read from amira trigonumSpinae = []; % Landmark Trigonum Spinae Scapulae (the midpoint of the triangular surface on the medial border of the scapula in line with the scaoular spine read from amira processusCoracoideus = []; % Landmark Processus Coracoideus (most lateral point) read from amira acromioClavicular = []; % Landmark Acromio-clavicular joint (most lateral part on acromion)read from amira angulusAcromialis = []; % Landmark Angulus Acromialis (most laterodorsal point) read from amira spinoGlenoidNotch = []; % Landmark Spino-glenoid notch read from amira pillar = []; % 5 landmarks on the pillar groove = []; % 5 landmarks on the scapula (supraspinatus) groove friedmansLine = []; % Line that goes through trigonumSpinae end the glenoid center - + coordSys + plane segmentation = "N"; % either none 'N', manual 'M' or automatic 'A' surface = [];% surface points and triangles of the scapula glenoid % Glenoid class acromion % Acromion class comment = ""; % any comment shoulder end methods function obj = Scapula(shoulder) obj.shoulder = shoulder; obj.coordSys = CoordinateSystemAnatomical(); obj.plane = Plane(); obj.acromion = Acromion(obj); end function output = isempty(obj) % The following landmarks are used to define the scapula coordinate % system which is the basis for all ShoulderCase measurements. output =... isempty(obj.angulusInferior)... | isempty(obj.trigonumSpinae)... | isempty(obj.groove)... | isempty(obj.spinoGlenoidNotch)... | isempty(obj.angulusAcromialis)... | isempty(obj.processusCoracoideus); end function resetLandmarks(obj) obj.angulusInferior = []; obj.trigonumSpinae = []; obj.processusCoracoideus = []; obj.acromioClavicular = []; obj.angulusAcromialis = []; obj.spinoGlenoidNotch = []; obj.pillar = []; obj.groove = []; end function output = loadData(obj) % Call methods that can be run after the ShoulderCase object has % been instanciated. success = Logger.timeLogExecution(... "Scapula landmarks: ",... @(obj) obj.loadLandmarks(), obj); success = success & Logger.timeLogExecution(... "Scapula groove points: ",... @(obj) obj.loadGroovePoints(), obj); success = success & Logger.timeLogExecution(... "Scapula pillar points: ",... @(obj) obj.loadPillarPoints(), obj); % The following operations used to be called by morphology() but we need % the coordinate system to be checked in order to assess the shoulder % side consistency. Manualy segmented landmarks shoulder side is not % specified in the filename so a manual left shoulder might load right % side landmarks. success = Logger.timeLogExecution(... "Scapula plane: ",... @(obj) obj.measurePlane(), obj); success = success & Logger.timeLogExecution(... "Scapula coordinate system: ",... @(obj) obj.measureCoordinateSystem(), obj); if success & obj.isInconsistentWithShoulderSide() Logger.logn(""); Logger.logn("Loaded landmarks are inconsistent with shoulder side. "); Logger.logn("Shouder will be reset after data loading step."); Logger.logn(""); % reset scapula data obj.resetLandmarks(); obj.coordSys = CoordinateSystemAnatomical(); obj.plane = Plane(); return end success = success & Logger.timeLogExecution(... "Scapula surface: ",... @(obj) obj.loadSurface(), obj); output = success; end function output = morphology(obj) % Call methods that can be run after loadData() methods has been run by % all ShoulderCase objects. output = true; end function output = measureFirst(obj) % Call methods that can be run after morphology() methods has been run by % all ShoulderCase objects. success = Logger.timeLogExecution(... "Scapula Friedmans line: ",... @(obj) obj.measureFriedmansLine(), obj); output = success; end end end