function f=ranks2D(x)
  m = size(x,1);
  f=zeros(size(x));
  for ii=1:m
    f(ii,:) = ranks(x(ii,:));
  end
  