function R = rank_indifferencezone(X,delta,imethod); %-------------------------------------------------------------------------- % This program was used to generate indifference-zone ranking results % for the paper (http://www.mindboggle.info/papers/): % % "Evaluation of 14 nonlinear deformation algorithms % applied to human brain MRI registration" % NeuroImage (2009), doi:10.1016/j.neuroimage.2008.12.037 % by Arno Klein, Jesper Andersson, Babak A. Ardekani, John Ashburner, % Brian Avants, Ming-Chang Chiang, Gary E. Christensen, D. Louis Collins, % James Gee, Pierre Hellier, Joo Hyun Song, Mark Jenkinson, Claude Lepage, % Daniel Rueckert, Paul Thompson, Tom Vercauteren, Roger P. Woods, % J. John Mann, and Ramin V. Parsey. % % (c) 2008, @rno klein %-------------------------------------------------------------------------- composite_rank=0; if composite_rank==0 R = zeros(length(X),length(X)); for iX = 1:length(X) I=find(X-X(iX)>delta); if length(I)>0 R(iX,I) = -1; end I=find(X-X(iX)<-delta); if length(I)>0 R(iX,I) = 1; end end else nX = length(X); R = X; for i1=1:nX-1 for i2=2:nX if i2>i1 I=find(abs(X(i2)-X(1:i1))<=delta); if length(I)>0 R(i2) = R(I(1)); end end end end for i3=nX:-1:2 I=find(abs(X(i3)-X)<=delta); if length(I)>0 R(I) = R(I(end)); end end tiedr=1; if tiedr==1 R=tiedrank(R); else R2 = zeros(size(R)); setr = length(R); while prod(R2)==0 uR = unique(R); maxR = max(uR); if maxR > 0 I = find(R==maxR); R2(I) = setr; setr = setr-1; R(I) = 0; else break end end R = R2; end end