diff --git a/ShoulderCase/@Glenoid/Glenoid.m b/ShoulderCase/@Glenoid/Glenoid.m index 4b8005d..8a72351 100644 --- a/ShoulderCase/@Glenoid/Glenoid.m +++ b/ShoulderCase/@Glenoid/Glenoid.m @@ -1,114 +1,117 @@ 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 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 = []; rimInclination = []; beta = []; density = []; comment = []; walch = []; fittedSphere = []; scapula = []; end methods function obj = Glenoid(scapula) obj.fittedSphere = Sphere(); obj.scapula = scapula; end function output = loadData(obj) % Call methods that can be run after the ShoulderCase object has % been instanciated. if obj.scapula.isempty() output = false; return end success = Logger.timeLogExecution(... "Glenoid load surface: ",... @(obj) obj.loadSurface(), obj); + success = success & Logger.timeLogExecution(... + "Glenoid load Walch class: ",... + @(obj) obj.readWalchData(), obj); 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(... "Glenoid sphere fitting: ",... @(obj) obj.fittedSphere.fitTo(obj.surface.points), obj); success = success & Logger.timeLogExecution(... "Glenoid center: ",... @(obj) obj.measureCenter(), obj); success = success & Logger.timeLogExecution(... "Glenoid radius: ",... @(obj) obj.measureRadius(), 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(... "Glenoid center local: ",... @(obj) obj.measureCenterLocal(), obj); success = success & Logger.timeLogExecution(... "Glenoid center line: ",... @(obj) obj.measureCenterLine(), obj); success = success & Logger.timeLogExecution(... "Glenoid depth: ",... @(obj) obj.measureDepth(), obj); success = success & Logger.timeLogExecution(... "Glenoid width and height: ",... @(obj) obj.measureWidthAndHeight(), obj); success = success & Logger.timeLogExecution(... "Glenoid version and inclination: ",... @(obj) obj.measureVersionAndInclination(), obj); success = success & Logger.timeLogExecution(... "Glenoid antero-superior angle: ",... @(obj) obj.measureAnteroSuperiorAngle(), obj); success = success & Logger.timeLogExecution(... "Glenoid infero-superior line: ",... @(obj) obj.measureInferoSuperiorLine(), obj); success = success & Logger.timeLogExecution(... "Glenoid beta angle: ",... @(obj) obj.measureBetaAngle(), obj); success = success & Logger.timeLogExecution(... "Glenoid postero-anterior line: ",... @(obj) obj.measurePosteroAnteriorLine(), obj); success = success & Logger.timeLogExecution(... "Glenoid rim inclination: ",... @(obj) obj.measureRimInclination(), 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(... "Glenoid retroversion: ",... @(obj) obj.measureRetroversion(), obj); output = success; end end end diff --git a/ShoulderCase/@Glenoid/readWalchData.m b/ShoulderCase/@Glenoid/readWalchData.m new file mode 100644 index 0000000..61f0f3e --- /dev/null +++ b/ShoulderCase/@Glenoid/readWalchData.m @@ -0,0 +1,12 @@ +function readWalchData(obj) + filename = fullfile(getConfig().dataDir, "Excel", "ShoulderDataBase.xlsx"); + caseMetadata = readtable(filename, "Sheet", "SCase", "Text", "String"); + walchClass = caseMetadata(... + caseMetadata.SCase_ID == obj.SCase.id... + & caseMetadata.shoulder_side == obj.scapula.shoulder.side... + , :).glenoid_walchClass; + + if not(isempty(walchClass)) + obj.walch = walchClass; + end +end \ No newline at end of file diff --git a/ShoulderCase/@Patient/readPatientData.m b/ShoulderCase/@Patient/readPatientData.m index d8edb8b..6c4d253 100644 --- a/ShoulderCase/@Patient/readPatientData.m +++ b/ShoulderCase/@Patient/readPatientData.m @@ -1,25 +1,13 @@ function readPatientData(obj) filename = fullfile(getConfig().dataDir, "Excel", "ShoulderDataBase.xlsx"); patientData = readtable(filename, "Sheet", "SCase", "Text", "String"); patientData = patientData(patientData.SCase_ID == obj.SCase.id,:); obj.SCase.diagnosis = patientData.diagnosis_name; obj.SCase.treatment = patientData.treatment_name; obj.SCase.patient.gender = patientData.patient_gender; obj.SCase.patient.age = patientData.patient_age; obj.SCase.patient.height = patientData.patient_height; obj.SCase.patient.weight = patientData.patient_weight; obj.SCase.patient.BMI = patientData.patient_BMI; - - if isequal(patientData.shoulder_side, "R") - obj.SCase.shoulders.right.auto.scapula.glenoid.walch =... - patientData.glenoid_walchClass; - obj.SCase.shoulders.right.manual.scapula.glenoid.walch =... - patientData.glenoid_walchClass; - elseif isequal(patientData.shoulder_side, "L") - obj.SCase.shoulders.left.auto.scapula.glenoid.walch =... - patientData.glenoid_walchClass; - obj.SCase.shoulders.left.manual.scapula.glenoid.walch =... - patientData.glenoid_walchClass; - end end \ No newline at end of file