function [ssfp2, a, b] = call_fmin_angle(data, ssfp1)
a = 0;
[a, Fval, exitflag, output] = fminsearch('fmin_angle', a, optimset('MaxFunEvals', 2000, 'TolX', 1e-5), data);
ssfp2 = data*exp(1j*a*pi/180);
ssfp3 = ssfp1*max(abs(ssfp2))/max(abs(ssfp1));
if norm(ssfp3(:) - ssfp2(:)) > norm(ssfp3(:) + ssfp2(:))
    % if mean(imag(ssfp2)) < 0
    % ssfp2 = -ssfp2;
    a = a + 180;
end
a = angle(exp(1j*a*pi/180))*180/pi;
ssfp2 = data*exp(1j*a*pi/180);

% b = [0, 1];
% b(1) = mean(ssfp3(:) - ssfp2(:));
% [b, Fval, exitflag, output] = fminsearch('fmin_dc', b, optimset...
%     ('MaxFunEvals', 2000, 'TolX', 1e-5), ssfp2, ssfp3);
% ssfp2 = b(2)*(ssfp2 + b(1));
% if plot_data > 0
%     plotri(ssfp2);
%     title([' optimal phase = ', num2str(a, 3), ' deg.'])
% end
