function [wfb_vals] = evaluate_wfb_prediction(pred, gt_map)

wfb_vals = nan(1, size(gt_map, 3));
nonz_lab = any(any(gt_map ~= 0, 1), 2);

% for lab_i = find(nonz_lab)'
%     wfb_vals(lab_i) = WFb(double(pred(:,:,lab_i)), gt_map(:,:,lab_i));
% end

[max_r, max_c] = find(any(gt_map ~= 0, 3));
min_r = min(max_r);
min_c = min(max_c);
max_r = max(max_r);
max_c = max(max_c);

for lab_i = find(nonz_lab)'
    wfb_vals(lab_i) = WFb(double(pred(min_r:max_r,min_c:max_c,lab_i)), ...
                          gt_map(min_r:max_r,min_c:max_c,lab_i));
end
