function [zfilt] = bookfig4(z, threshold) % Simple script to generate Figures 4 & 5, chapter 14 WITHOUT SPM! Just Matlab % Book: Human Brain Function. Academic Press, 2nd edition, 2003 % Authors: Frackowiak, Friston, Frith, Dolan, Price, Zeki, Ashburner, and Penny. % Script source: http://www.poirrier.be/~jean-etienne/presentations/rft/ % !!!!! YOU SHOULD HAVE RUN SCRIPTS bookfig1-3.m BEFORE THIS ONE % !!!!!!!!!! IN ORDER TO HAVE THE CORRECT AND SAME 'z' MATRIX ! % How to run it? "z4 = bookfig4(z3, 0.93);" % Argument 'a' is the square ramdom map from script bookfig1! % Clear screen clf; close; %FWHM = 10; %sigma = FWHM/sqrt(8*log(2)); %z = normpdf(my2, 0, sigma); for i = 1:100 for j = 1:100 if z(i,j) > threshold zfilt(i,j) = 1; else zfilt(i,j) = 0; end end end imagesc(zfilt); % Beautify image set(gca,'YDir','normal'); colormap('gray'); ylabel('Position du pixel en Y'); xlabel('Position du pixel en X');