% ------------------------------------------------------------- % GA FOR MIXTURE MODELS, function implementing the tournament selection % Copyright (c) 2005 - 2006 Jussi Tohka (jussi.tohka@tut.fi) % Institute of Signal Processing, Tampere University of Technology, Finland % and % Laboratory of Neuro Imaging, David Geffen School of Medicine, % University of California, Los Angeles, CA, USA % The algorithm is described in : % Tohka J, Krestyannikov E, Dinov ID, MacKenzie-Graham A, Shattuck DW, % Ruotsalainen U, Toga AW: % Genetic Algorithms for Finite Mixture Model Based Voxel Classification % in Neuroimaging, accepted to appear in IEEE Trans. on Medical Imaging, % 2007 % and % J. Tohka, E. Krestyannikov, I. Dinov, D. Shattuck, U. Ruotsalainen, % A.W. Toga. Genetic algorithms for finite mixture model based tissue % classification in brain MRI. In Proc. of European Medical and % Biological Engineering Conference, IFMBE Proceedings vol. 11, pp. 4077 % - 4082, Prague, Czech Republic, 2005. % ---------------------------------------------------------------- % Permission to use, copy, modify, and distribute this software % for any purpose and without fee is hereby % granted, provided that the above copyright notice appear in all % copies. The author, Tampere University of Technology and University of % California, Los Angeles make no representations % about the suitability of this software for any purpose. It is % provided "as is" without express or implied warranty. % ---------------------------- --------------------------------- % n is how many to select % q is the size of the tournament function new_pop = mixturega_tournamentselection(old_pop,energies,n,q); popsz = size(old_pop); % tournaments = unidrnd(popsz(2),q,n); tournaments = ceil(popsz(2) .* rand([q n])); [minene minind] = min(energies(tournaments)); indvector = diag(tournaments(minind,1:n)); new_pop = old_pop(:,indvector);