Create a non Isotropic 3D Gaussian Point Spread Function (PSF)

Create an isotropic or non isotropic 3D Gaussian PSF
1.1K Downloads
Updated 20 Mar 2012

View License

%% NONISOTROPICGAUSSIANPSF - Creates a isotropic / non isotropic 3D Gaussian kernel.
%Uses the Statistical toolbox if installed (mvnpdf). Works without Statistical Toolbox, but slower and
% with higher limitation when it comes to the size of the PSF support.
%
% Syntax: [outKer] = nonIsotropicPSF(inSigma)
% = nonIsotropicPSF(inSigma,sizeDomain)
% = nonIsotropicPSF(inSigma,sizeDomain,precision)
% Inputs:
% inSigma - scalar (isotropic) or 3x1 vector with the standard deviation of the Gaussian kernel (reminder:
% sigma=FWHM/(2*sqrt(2*ln(2))) )
% sizeDomain (optional) - Define the size of the support of the PSF (default: 2.1*max(inSigma))
% precision (optional) - Add 'single' as input to calculate in single precision (default: double).
% The precision is important when using the function without the Statistical Toolbox.
%
% Outputs:
% outKer - 3D non isotropic Gaussian kernel
%
% Example:
% outKer = nonIsotropicGaussianPSF([5.12 5.9 5.8],3);
% If Out of Memory, try :
% outKer = nonIsotropicGaussianPSF([5.12 5.9 5.8],3,'single');
%
% Other m-files required: areTheseToolboxesInstalled (added in this file)
% Subfunctions: none
% MAT-files required: none

% Author: Christopher Coello
% 2012/03/13; Last revision: 2012/03/16
% Created with Matlab version: 7.13.0.564 (R2011b)

Cite As

Christopher Coello (2024). Create a non Isotropic 3D Gaussian Point Spread Function (PSF) (https://www.mathworks.com/matlabcentral/fileexchange/35612-create-a-non-isotropic-3d-gaussian-point-spread-function-psf), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: Spatial FCM with bias correction

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.5.0.0

- Fixed bug size output

1.4.0.0

- Fix format output

1.2.0.0

- Single precision added
- Scalar input added

1.1.0.0

Uploaded screenshot.

1.0.0.0