function b = posori26(a);
%
% posori26 puts orientation in 0 to pi interval
% On input:
%     a: 2D matrix with angles in radians
% On output:
%     b: 2D matrix with angles in radians between 0 and pi
% Call:
%  b = posori26(a);
%
%	(Genetics Version 6 posori2)

[m,n] = size(a);
b = a;
for ii = 1:m
  for jj = 1:n
    if a(ii,jj) < 0
      b(ii,jj) = a(ii,jj) + 2*pi;
    end
    if b(ii,jj) >= pi
      b(ii,jj) = b(ii,jj) - pi;
    end
  end
end
