function [ungrowth_params_bar] = calculate_growth_params_from_gt(av_info)
num_stages = length(av_info);
ungrowth_params_bar = cell(num_stages, 1);
if num_stages<2
    return;
end

for i=1:num_stages
    G_t = av_info{i}.av_info_later; % smaller sectors
    G_t_delta = av_info{i}.av_info_earlier; % slightly larger sectors
    % we want to calculate the tranformation that sends G_t to G_t_delta
    num_regions = size(G_t,3);
    
    for j = 1:num_regions
        [smax1, smin1, theta1] = gtlib_growthTensor2Params(G_t(:,:,j));
        [smax2, smin2, theta2] = gtlib_growthTensor2Params(G_t_delta(:,:,j));
       % if (smax1<1) || (smin1<1)
            
        %    ungrowth_params_bar{i}(:,:,j) = gtlib_growthParams2Tensor(1, 1, theta2);
       % else
      

        ungrowth_params_bar{i}(:,:,j) = gtlib_growthParams2Tensor(smax2/smax1, smin2/smin1, theta2);
       % end
        
       % [U_t, S_t, V_t] = svd(G_t(:,:,j));
       % [U_t_delta, S_t_delta, V_t_delta] = svd(G_t_delta(:,:,j));
       % diffS = zeros(3,3);
        
%        small = G_t(1:2,1:2,j);
%        large = G_t_delta(1:2,1:2,j);   
%        
%       figure(1); clf; hold on;
%       gtlib_plotGrowthTensor('growth_tensor', G_t(:,:,j));
%       gtlib_plotGrowthTensor('growth_tensor', G_t_delta(:,:,j));
%       axis image;
%       
%       
%         T = large*inv(small);
%         [U, S, V] = svd(T);
%  diffS(1,1) = S(1,1);
%  diffS(2,2) = S(2,2);


        % this calculates the scaling along the principal directions for
        % ungrowth, these scalings s should be 0 < s < 1
       %   diffS(1,1) = S_t(1,1)./S_t_delta(1,1);
       % diffS(2,2) = S_t(2,2)./S_t_delta(2,2);
        
       
        % diffS(1,1) = S_t_delta(1,1)./S_t(1,1);
        % diffS(2,2) = S_t_delta(2,2)./S_t(2,2);
         
        % if diffS(1,1)<1
        %     diffS(1,1) = 1;
        % end
        % if diffS(2,2)<1
        %     diffS(2,2) = 1;
        % end
         
%         if diffS(1,1)<diffS(2,2)
%             a = diffS(1,1);
%             diffS(1,1) = diffS(2,2);
%             diffS(2,2) = a;
%             a = U_t_delta(:,1);
%             U_t_delta(:,1) = U_t_delta(:,2);
%             U_t_delta(:,2) = a;
%             a = V_t_delta(:,1);
%             V_t_delta(:,1) = V_t_delta(:,2);
%             V_t_delta(:,2) = a;
%             disp('altered');
%         end
       
        % which rotation matrix to keep ?? not sure so pick the biggest one
        %ungrowth_params_bar{i}(:,:,j) = U_t_delta*diffS*V_t_delta';
        %growth_params_bar{i}(:,:,j) = U_t*diffS*V_t';
    end
end
return;