function [out,mxint]=absmedianv9(imat,randp,pick)
% *** absolute (real-part) median noise at random coordinates ***
% Y. Matsuki, February, 2009
% Y. Matsuki, May, 2012
% usage:
% [out]=absmedianv7(imat,rnadp)
% =====================================

npts=length(randp(:,1));
nr=length(squeeze(imat(:,1,1)));

% for n=1:length(imat(:,1,1))
col=1;

% for n=1:nr
f3slices=[];
for n=1:length(pick)
    
    f3slices=[f3slices;abs(real(squeeze(imat(pick(n),:,:))))]; % may1712, mtk.
end

intt=zeros(npts,1);
m=1;
for cyc=1:npts
    intt(m,1)=f3slices(randp(cyc,1),randp(cyc,2)); % may1712, mtk.
    m=m+1;
end


mxint=max(max(f3slices));
out=median(intt);




