%%% type/paste these into MATLAB prompt %%% plot exponential decay curves for two different T2's on one graph hold; % put multiple plots on one graph T2short = 30; T2long = 60; step = 0.1; t = 0:step:250; sigshort = exp(-t/T2short); siglong = exp(-t/T2long); plot(t,sigshort,'r'); plot(t,siglong,'g'); %%% plot signal eq. for FLASH sequence as function of flip angle 0-90 deg hold; T1 = 1100; T2 = 90; PD = 0.68; TR = 19; TE = 6; step = 0.02; flip = 0:step:pi/2; numer = PD*(1 - exp(-TR/T1)); denom = 1 - cos(flip)*exp(-TR/T1); numer2 = sin(flip)*exp(-TE/T2); sig = numer ./ denom .* numer2; % dots means component-wise operation plot(flip,sig,'g'); %%% plot image and its amplitude spectrum (k-space amplitude) on one page [get any tiff, e.g., http://www.cogsci.ucsd.edu/~sereno/276/t1sag.tiff] figure; % this is a comment Im = double(imread('t1sag.tiff')); % load a tiff into a matrix FT = fftshift(fft2(Im)); % take the Fourier transform of it FT_Amp = abs(FT); % extract Fourier amplitude minAmp = min(min(FT_Amp)); maxAmp = max(max(FT_Amp)); colormap gray; subplot(1,2,1); imagesc(Im); % auto scale, display image axis square; title('Real Image'); subplot(1,2,2); imagesc(FT_Amp,[minAmp 0.01*maxAmp]); % change scale for better visibility axis square; title('K-Space Ampl');