function [av] = average_ellipse_av_growth_tensor(M)

av = zeros(1, 6);
GT = zeros(3,3,size(M,1));
for i=1:size(M,1)
    major = M(i,4);
    minor = M(i,5);
    theta = M(i,6);
    GT(:,:,i) = gtlib_growthParams2Tensor(major, minor, theta );
end
mean_gt = mean(GT,3);
[major, minor, theta] = gtlib_growthTensor2Params(mean_gt);
% mgt = zeros(1,6);
% mgt(1) = mean_gt(1,1);
% mgt(2) = mean_gt(2,2);
% mgt(6) = mean_gt(1,2);
% [major, minor, theta] = growthParamsFromTensor(mgt);

%smax = max(major, minor);
%smin = min(major, minor);
%av = [M(1,1:2), mean(M(:,3)), smax, smin, theta];
av = [M(1,1:2), mean(M(:,3)), major, minor, theta];
return;