[PSF] = deconSTORM_preparePSF(sigma,Npixels,npixels) Create a Gaussian point spread function (PSF) matrix Inputs: sigma - Standard deviation parameter of the Gaussian PSF shape, in pixels Npixels - linear dimension, in pixels, of the image field of view (assumed square) npixels - Linear dimension (in pixels) of the super-resolution estimate Output: PSF - point spread function, of size npixels x npixels APSF - transfer function mapping from between the high- and low-resolution images, of size (npixels^2) x (Npixels^2)
0001 function [PSF] = deconSTORM_preparePSF(sigma,Npixels,npixels) 0002 % 0003 % [PSF] = deconSTORM_preparePSF(sigma,Npixels,npixels) 0004 % 0005 % Create a Gaussian point spread function (PSF) matrix 0006 % 0007 % Inputs: 0008 % sigma - Standard deviation parameter of the Gaussian PSF shape, in pixels 0009 % Npixels - linear dimension, in pixels, of the image field of view 0010 % (assumed square) 0011 % npixels - Linear dimension (in pixels) of the super-resolution estimate 0012 % 0013 % Output: 0014 % PSF - point spread function, of size npixels x npixels 0015 % APSF - transfer function mapping from between the high- and 0016 % low-resolution images, of size (npixels^2) x (Npixels^2) 0017 % 0018 0019 % Copyright, 2012 0020 % Eran Mukamel, Hazen Babcock and Xiaowei Zhuang 0021 % Contact: eran@post.harvard.edu 0022 % 0023 0024 dsamp = npixels/Npixels; 0025 0026 if mod(npixels,Npixels)~=0 0027 error('npixels must be an integer multiple of Npixels.') 0028 end 0029 0030 xvec = ([1:npixels]-1/2)*Npixels/npixels; 0031 Xvec = ([1:Npixels]-1/2)*Npixels/Npixels; 0032 0033 [xx,yy] = meshgrid(xvec); 0034 PSF = exp(-((xx-(Npixels+1)/2).^2 + (yy-(Npixels+1)/2).^2)/(2*sigma^2)); 0035 0036 if dsamp>1 0037 dsampvec = [dsamp/2:dsamp:npixels]; 0038 elseif dsamp==1 0039 dsampvec = [1:npixels]; 0040 end 0041 0042 norm = sum(sum(PSF(dsampvec,dsampvec))); 0043 PSF = PSF / norm; 0044