diff --git a/ShoulderCase/@ShoulderCase/plotManualAutoDifferences.m b/ShoulderCase/@ShoulderCase/plotManualAutoDifferences.m index b646aec..11b57d4 100644 --- a/ShoulderCase/@ShoulderCase/plotManualAutoDifferences.m +++ b/ShoulderCase/@ShoulderCase/plotManualAutoDifferences.m @@ -1,70 +1,70 @@ -function output = plotManualAutoDifference(obj,normLimitForOutliers) +function output = plotManualAutoDifference(obj, shoulderSide, normLimitForOutliers) % Plot the vectors between auto and manual points. % % input: normLimitForOutliers % % The vector is green if below the value given to normLimitForOutliers, % otherwise it is red. % initialisation - manual = obj.shoulderManual; + manual = obj.shoulders.(shoulderSide).manual; manualPoints = []; - auto = obj.shoulderAuto; + auto = obj.shoulders.(shoulderSide).auto; autoPoints = []; % find maximum number of common groove points minGroovePoints = min(size(manual.scapula.groove),size(auto.scapula.groove)); if (minGroovePoints > 0) manualPoints = [manual.scapula.groove(1:minGroovePoints,:)]; autoPoints = [auto.scapula.groove(1:minGroovePoints,:)]; end % create points arrays manualPoints = [manualPoints;... manual.scapula.angulusInferior;... manual.scapula.trigonumSpinae;... manual.scapula.processusCoracoideus;... manual.scapula.acromioClavicular;... manual.scapula.angulusAcromialis;... manual.scapula.spinoGlenoidNotch;... manual.scapula.coordSys.origin;... manual.scapula.glenoid.center;... ]; autoPoints = [autoPoints;... auto.scapula.angulusInferior;... auto.scapula.trigonumSpinae;... auto.scapula.processusCoracoideus;... auto.scapula.acromioClavicular;... auto.scapula.angulusAcromialis;... auto.scapula.spinoGlenoidNotch;... auto.scapula.coordSys.origin;... auto.scapula.glenoid.center;... ]; % measure norm difference manualAutoDifference = vecnorm(autoPoints-manualPoints,2,2); % plot the difference vectors for i = 1:size(manualAutoDifference,1) if (manualAutoDifference(i) > normLimitForOutliers) % outlier color = 'red'; else % valid point color = 'green'; end differenceLine = [manualPoints(i,:);... autoPoints(i,:)]; plotHandle(i) = plot3(differenceLine(:,1),differenceLine(:,2),differenceLine(:,3),... ':x',... 'Color',color,... 'LineWidth',3); hold on end output = plotHandle; end \ No newline at end of file diff --git a/ShoulderCase/@ShoulderCasePlotter/plot.m b/ShoulderCase/@ShoulderCasePlotter/plot.m index f785f66..909c2aa 100644 --- a/ShoulderCase/@ShoulderCasePlotter/plot.m +++ b/ShoulderCase/@ShoulderCasePlotter/plot.m @@ -1,100 +1,100 @@ function plot(obj) % set method colors autoColors = {'b','cyan'}; manualColors = {'#D95319','#ffcc00'}; % plot scapula data axes(obj.axesHandle('scapula')); hold on; grid on axis vis3d auto = containers.Map; try auto('landmarks') = obj.SCase.shoulders.(obj.shoulderSide).auto.scapula.plotLandmarks(autoColors{2},autoColors{2}); end try auto('scapula surface') = obj.SCase.shoulders.(obj.shoulderSide).auto.scapula.plotSurface(autoColors{1},autoColors{1}); end try auto('glenoid surface') = obj.SCase.shoulders.(obj.shoulderSide).auto.scapula.glenoid.plot(); end try auto('coordinate system') = obj.SCase.shoulders.(obj.shoulderSide).auto.scapula.coordSys.plot(autoColors{1},false); end manual = containers.Map; try manual('landmarks') = obj.SCase.shoulders.(obj.shoulderSide).manual.scapula.plotLandmarks(manualColors{2},manualColors{2}); end try manual('scapula surface') = obj.SCase.shoulders.(obj.shoulderSide).manual.scapula.plotSurface(manualColors{1},manualColors{1}); end try manual('glenoid surface') = obj.SCase.shoulders.(obj.shoulderSide).manual.scapula.glenoid.plot(); end try manual('coordinate system') = obj.SCase.shoulders.(obj.shoulderSide).manual.scapula.coordSys.plot(manualColors{1},false); end outliersNormLimit = 10; difference = containers.Map; try - difference('difference') = obj.SCase.plotManualAutoDifferences(outliersNormLimit); + difference('difference') = obj.SCase.plotManualAutoDifferences(obj.shoulderSide, outliersNormLimit); end % plot centered coordinate system axes(obj.axesHandle('centered coordinate system')); hold on; grid on axis vis3d try auto('centered coordinate system') = obj.SCase.shoulders.(obj.shoulderSide).auto.scapula.coordSys.plot(autoColors{1},true); end try manual('centered coordinate system') = obj.SCase.shoulders.(obj.shoulderSide).manual.scapula.coordSys.plot(manualColors{1},true); end % plot muscles segmentation axes(obj.axesHandle('auto muscles')); title('Auto segmentation with auto landmarks'); hold on; try auto('rotator cuff') = obj.SCase.shoulders.(obj.shoulderSide).auto.rotatorCuff.plot(); end axes(obj.axesHandle('scapula')) try auto("rotator cuff") = [auto("rotator cuff") obj.SCase.shoulders.(obj.shoulderSide).auto.rotatorCuff.plot3()]; end try auto("rotator cuff") = [auto("rotator cuff") obj.SCase.shoulders.(obj.shoulderSide).auto.humerus.plot()]; end axes(obj.axesHandle('manual muscles')); title('Auto segmentation with manual landmarks'); hold on; try manual('rotator cuff') = obj.SCase.shoulders.(obj.shoulderSide).manual.rotatorCuff.plot(); end axes(obj.axesHandle('scapula')) try manual("rotator cuff") = [manual("rotator cuff") obj.SCase.shoulders.(obj.shoulderSide).manual.rotatorCuff.plot3()]; end try manual("rotator cuff") = [manual("rotator cuff") obj.SCase.shoulders.(obj.shoulderSide).manual.humerus.plot()]; end % store the data handles obj.plotHandle.auto = auto; obj.plotHandle.manual = manual; obj.plotHandle.difference = difference; end \ No newline at end of file