function [countResults] = getCounts(groupName, predictResult)
% This function is to find the classified results for each groups
% Input variables: groupName is a cell array containing group names and
% predictResults is a ceall array containing classification result for each
% ROI within an image. Out variable is a vector of #groups.
%
% Created By: Kaichang CHENG, May 25,2019
%**************************************************************************
numberGroups = size(groupName, 1);
tempCounts = zeros(1, numberGroups);
nROI = size(predictResult, 1);
for idxGroup = 1: numberGroups
    tempName = groupName{idxGroup,1};
    groupCounts = zeros(1, nROI);
    for idxROI = 1:nROI
        groupCounts(1, idxROI) = strcmp(tempName, predictResult{idxROI,1});
    end
    tempCounts(1, idxGroup) = length(find(groupCounts));
end
countResults = tempCounts;
end