function [LVCenter] =  computeLVCenter(invertedMeanMask)
    % invertedMeanMask is a 2d mask of heart
    % It could be generated by thresholding max/mean projecting 3d volume.
    lv = imclearborder(invertedMeanMask);
    CC = bwconncomp(lv,8);
    numPixels = cellfun(@numel,CC.PixelIdxList);
    [~, maxCCIdx] = max(numPixels);
    lv = 0*lv;
    lv(CC.PixelIdxList{maxCCIdx}) = 1;
    stats = regionprops(lv,'centroid');
    LVCenter = round(stats.Centroid);
end
