function [ modelROC modelPrecision modelFalseAlarms] = calcAUCjudd( SM , eyefix ) %CALCAUC Summary of this function goes here % Detailed explanation goes here if size(SM,3) > 1 SM = rgb2gray(SM); end SM = double(SM); SM = imresize(SM,size(eyefix),'nearest'); % normalization SM = SM - min(min(SM)); SM = SM ./ max(max(SM)); % Judd's AUC % Calculate the area under the ROC curve S = SM(:); F = eyefix(:); S = imresize(S,[800000 1],'nearest'); F = imresize(F,[800000 1],'nearest'); [S, k] = sort(S, 'descend'); F = F(k); % calculate precision and false alarms % n = length(F); cumSumF = cumsum(F); sumF = sum(F); cumSumOneMinusF = cumsum(1-F); sumOneMinusF = sum(1-F); modelPrecision = cumSumF / sumF; modelFalseAlarms = cumSumOneMinusF / sumOneMinusF; areaUnderROC = sum(modelPrecision) / length(modelPrecision); modelROC = areaUnderROC; end