function ColorLatticeImage = IsingTrioFluorescence(Lattice) % ===================================== % David Liao % 2008 January 27 % Simulated two-strain fluorescence % ===================================== L = size(Lattice); % Identify cooperators and defectors C = max(Lattice,0); D = max(-Lattice,0); % Collapse data on z axis G = sum(C,3); R = sum(D,3); % Build a color image ColorLatticeImage = zeros(L(1),L(2),3); ColorLatticeImage(:,:,1) = R; ColorLatticeImage(:,:,2) = G; % Normalize ColorLatticeImage = ColorLatticeImage/L(3); % figure; % image(ColorLatticeImage);