MATLAB: How to identified left side or right side view mammogram by using mean

mammogrammeans

Hi all
Below is my sample code I refer some website guide to identified left or right side view on my mask mammogram, but my code can't works well, anyone can help me through this? Thank you.
mean_LM = mean(LM);
mean_RM = mean(RM);
if mean_LM > mean_RM
view = LM;
disp('Left')
else
view = RM;
disp('Right')
end

Best Answer

If LM and RM are images, you need to say
mean_LM = mean(LM(:));
mean_RM = mean(RM(:));
If that's not the problem, you probably need to post some of the mammogram images, and explain what exactly goes wrong with your existing code.