diff --git a/ShoulderCase/@RotatorCuff/plot.m b/ShoulderCase/@RotatorCuff/plot.m index 86c7d0b..28b47f6 100644 --- a/ShoulderCase/@RotatorCuff/plot.m +++ b/ShoulderCase/@RotatorCuff/plot.m @@ -1,46 +1,46 @@ function output = plot(obj,varargin) if nargin == 2 error('Provide the slice name and the mask name or provide nothing (auto slice and segmentations will be plotted).') elseif nargin == 3 sliceName = varargin{1} + "_ForSegmentation.png"; maskName = varargin{2} + "_Mask.png"; else sliceName = "rotatorCuffMatthieu_ForSegmentation.png"; maskName = "autoMatthieu_Mask.png"; end rotatorCuffCrossSection = imread(fullfile(obj.dataSlicesPath,sliceName)); leg = {}; plotHandle(1) = imshow(rotatorCuffCrossSection); hold on muscleColor = containers.Map; muscleColor("SC") = "b"; muscleColor("SS") = "r"; muscleColor("IS") = "g"; muscleColor("TM") = "y"; for muscleName = ["SC", "SS", "IS", "TM"] try segmentedImage = imread(fullfile(obj.(muscleName).dataMaskPath,maskName)); catch continue end if (max(segmentedImage,[],'all') > 0) % if segmentation result is not empty leg{end+1} = muscleName; [~,plotHandle(end+1)] = contour(segmentedImage,'color',muscleColor(muscleName)); end try centroid = obj.(muscleName).getCentroid().indices; leg{end+1} = muscleName + " centroid"; plotHandle(end+1) = scatter(centroid(1), centroid(2), 50, "o",... "MarkerEdgeColor", muscleColor(muscleName),... "MarkerFaceColor", muscleColor(muscleName)); end end - plotHandle(end+1) = legend(leg); + plotHandle(end+1) = legend(leg, "Location", "bestoutside"); output = plotHandle; end