Library

MicroscopePSFs.Airy2DType
Airy PSF

2D Airy Patter psf using paraxial, scalar model

Fields

  • na : Numerical Aperture
  • λ : Emission Wavelength
  • pixelsize : Linear size of a back-projected pixel

The Airy PSF is I(r)=ν²/(4π)(2J₁(νr)/(νr))² where ν=πD/(λf)=2π*nₐ/λ

source
MicroscopePSFs.Dipole3DType
Dipole3D

3D psf using vector model and OTF rescaling

Fields

  • pupilfunctionx : Pupil Function defines the x component of the electric field
  • pupilfunctiony : Pupil Function defines the y component of the electric field
  • pixelsize : Linear size of a back-projected pixel, unit: micron
  • 'Σ' : OTF rescaling via image space 2D Gaussian Covariance matrix
  • 'dipole_ang' : orientation of dipole moment (polar, azimuthal)
  • 'ksize' : number of pixels in pupil
  • 'electricfield' : electric field component, 'x' or 'y'
  • 'normf' : normalization factor

Constructor

Dipole3D(nₐ, λ, n, pixelsize, dipole_ang; Σ=0, ksize=256, z::ZernikeCoefficients=ZernikeCoefficients(1))
  • 'nₐ' : numerical aperture
  • 'λ' : emission wavelength, unit is micrion
  • 'n' : refractive indices (sample medium, cover glass, immersion medium)
source
MicroscopePSFs.ImmPSFType
ImmPSF

3D psf with index mismatch aberration using scalar or vector model and OTF rescaling

Fields

  • pupilfunction : Pupil Function structure
  • pixelsize : Linear size of a back-projected pixel, unit: micron
  • 'Σ' : OTF rescaling via image space 2D Gaussian Covariance matrix
  • 'ksize' : number of pixels in pupil

Constructor

ImmPSF(nₐ, λ, n, pixelsize; inputpupil=nothing, Σ=0, ksize=256, z::ZernikeCoefficients=ZernikeCoefficients(1))
  • 'nₐ' : numerical aperture
  • 'λ' : emission wavelength, unit is micrion
  • 'n' : refractive indices of (sample medium, coverglass, immersion medium)
  • 'zstage' : position of the sample stage, unit: micron
  • 'inputpupil' : input pupil function, default is nothing
  • 'mvtype' : type of motion, the z position is changed by moving 'bead' or 'stage'
source
MicroscopePSFs.InterpolatedPSFType
InterpolatedPSF(p,r;subsampling=4)

3D psf interpolated from other PSF models (linear interpolation)

Fields

  • p : Generator PSF
  • r : range (x,y,z) where x,y,z are maximum supported range in each dimension
  • subsampling : subsampling (default = 4)
  • itp : linear interpolation object for intensity PSF
  • itp_real : linear interpolation object for real part of the amplitude PSF
  • itp_imag : linear interpolation object for imaginary part of the amplitude PSF
  • pixelsize : Linear size of a back-projected pixel

Constructor

InterpolatedPSF(p,r;subsampling=4)
source
MicroscopePSFs.PupilFunctionType
PupilFunction

A structure defines the pupil function.

Fields

  • nₐ : Numerical Aperture
  • λ : Emission Wavelength
  • n : Immersion Index
  • pixelsize : Linear size of a back-projected pixel
  • 'kpixelsize' : Number of pixels used in pupil function image
  • 'pupil' : Pupil function with a dimension of (ksize, ksize, 2), including the amplitude and phase

Calculations of various 3D PSF types will involve calculations based around Pupil Funciton. They differ in the complexity and approach used to calculate Pupil Function.

source
MicroscopePSFs.Scalar3DType
Scalar3D

3D psf using scalar model and OTF rescaling

Fields

  • pupilfunction : Pupil Function structure
  • pixelsize : Linear size of a back-projected pixel
  • 'Σ' : OTF rescaling via image space 2D Gaussian Covariance matrix
  • 'ksize' : number of pixels in pupil

Constructor

Scalar3D(nₐ, λ, n, pixelsize; inputpupil=nothing, Σ=0, ksize=256, z::ZernikeCoefficients=ZernikeCoefficients(1))
  • 'nₐ' : numerical aperture
  • 'λ' : emission wavelength, unit is micrion
  • 'n' : refractive indices of immersion medium
  • 'inputpupil' : input pupil function, default is nothing
source
MicroscopePSFs.SplinePSFType
SplinePSF

3D psf interpolated from a 3D PSF stack (spline interpolation)

Fields

  • psfstack : a 3D PSF stack
  • sitp : spline interpolation object
  • pixelsize : Linear size of a back-projected pixel
  • pixelsize_z : step size in z, unit: micron

Constructor

SplinePSF(psfstack;pixelsize_z=0.05,pixelsize=0.1)
source
MicroscopePSFs.ZernikeCoefficientsType
ZernikeCoefficients

A mutable struct to hold the Zernike coefficients

Fields

  • mag : Zernike coefficients of pupil mangnitude
  • phase : Zernike coefficients of pupil phase

Constructor

ZernikeCoefficients(n::Int)
  • n : number of Zernike coefficients
source
MicroscopePSFs.calEfieldMethod
calEfield(ϕ, Tp, Ts, sinθ₁, cosθ₁; dvec = [1,1,1])

Calculate electric field of a given dipole orientation

Arguments

  • ϕ : azimuthal coordinate of the electric field
  • Tp : Fresnel coefficient for p-polarization
  • Ts : Fresnel coefficient for s-polarization
  • sinθ₁ : sine of the incident angle in the sample medium
  • cosθ₁ : cosine of the incident angle in the sample medium
  • dvec : dipole moment vector

Returns

  • x component of the electric field
  • y component of the electric field
  • A vector of six components of the electric field from dipole radiation
source
MicroscopePSFs.calFresnelMethod
calFresnel(kr2,λ,n::Vector)

Calculate Fresnel coefficients

Arguments

  • kr2 : magnitude square of the radial component of the k vector
  • λ : emission wavelength, unit is micrion
  • n : refractive indices (sample medium, cover glass, immersion medium)

Returns

  • Tp : Fresnel coefficient for p-polarization
  • Ts : Fresnel coefficient for s-polarization
  • sinθ₁ : sine of the incident angle in the sample medium
  • cosθ₁ : cosine of the incident angle in the sample medium
  • cosθ₂ : cosine of the incident angle in the cover glass
  • cosθ₃ : cosine of the incident angle in the immersion medium
source
MicroscopePSFs.importpsfMethod
importpsf(filename, psftype; zstage=0.0, source="python", mvtype="bead")

import PSF data from PSF learning software

Arguments

  • filename : file name of the PSF data
  • psftype : PSF types that are supported by julia package, options are: "scalar3D", "immPSF", "splinePSF"
  • source : software that generates the PSF data, default is "python"
  • zstage : position of the sample stage, equal to zero at the coverslip, positive when imaging inside the sample
  • mvtype : for immPSF only, options are: "bead", "stage"

returns

  • p : PSF Type
  • PSFstack : a 3D stack of learned PSF
  • z : ZernikeCoefficients Type
  • h : PupilFunction Type

Example:

p, PSFstack, z, h = importpsf(filename,psftype)

source
MicroscopePSFs.loadMethod
load(psffile::String)

load PSF file

Arguments

  • psffile : The full path to the psf file

Return

The MicroscopePSFs type from the file

source
MicroscopePSFs.makeobsMethod
makeobs(r)

make a set of observations points in a square window

Arguments

  • r : A range

returns a vector of Tuples e.g. (x,y)

Example:

obs=makeobs(-8:8)

source
MicroscopePSFs.nl2nollMethod
nl2noll(n::Int,l::Int)

convert the n and l indexes into a Noll linear index

Arguments

  • n : radial index
  • l : azimuthal index

Returns

  • j : Noll linear index
source
MicroscopePSFs.nl2osaMethod
nl2osa(n::Int,l::Int)

convert the n and l indexes into a OSE linear index

Arguments

  • n : radial index
  • l : azimuthal index

Returns

OSA linear index

source
MicroscopePSFs.noll2nlMethod
noll2nl(j::Int)

convert the Noll index j into n and l

Arguments

  • j : Noll linear index

Returns

  • n : radial index
  • l : azimuthal index
source
MicroscopePSFs.noll2osaMethod
noll2osa(j::Int)

convert the Noll index j to OSA index j

Arguments

  • j : Noll linear index

Returns

OSA linear index

source
MicroscopePSFs.osa2nlMethod
osa2nl(j::Int)

convert the OSA index j into n and l

Arguments

  • j : OSA linear index

Returns

  • n : radial index
  • l : azimuthal index
source
MicroscopePSFs.osa2nollMethod
osa2noll(j::Int)

convert the OSA index j to Noll index j

Arguments

  • j : OSA linear index

Returns

Noll linear index

source
MicroscopePSFs.pdf!Method
pdf!(im::Array,p::PSF,roi::Array,x_emitter::Tuple)

update im to the psf at pixel locations defined by roi with emitter located at x_emitter.

Arguments

  • im::Array : array of numerical values with the same size as roi
  • p::PSF : psf structure
  • roi::Array : array of tuples that define the pixel locations
  • x_emitter::Tuple : location of emitter
source
MicroscopePSFs.pdfMethod
pdf(p::PSF,roi::Array,x_emitter::Array)

return the overlap of multiple psfs at pixel locations defined by roi with emitter positions defined by x_emitter.

Arguments

  • p::PSF : psf structure
  • roi::Array : array of tuples that define the pixel locations
  • x_emitter::Array : array of tuples that defines the emitter locations
source
MicroscopePSFs.pdfMethod
pdf(p::PSF,roi::Array,x_emitter::Tuple)

return the psf at pixel locations defined by roi with emitter located at x_emitter.

Arguments

  • p::PSF : psf structure
  • roi::Array : array of tuples that define the pixel locations
  • x_emitter::Tuple : location of emitter
source
MicroscopePSFs.pdfMethod
pdf(p::PSF,x_pixel::Tuple,x_emitter::Tuple)

abstract function: return the psf at pixel x_pixel with emitter located at x_emitter.

Arguments

  • p::PSF : psf structure
  • x_pixel::Tuple : location of pixel
  • x_emitter::Tuple : location of emitter
source
MicroscopePSFs.pdfₐ!Method
pdfₐ!(im::Array,p::PSF,roi::Array,x_emitter::Tuple)

update im to the complex amplitude at pixel locations defined by roi with emitter located at x_emitter.

Arguments

  • im::Array : array of numerical values with the same size as roi
  • p::PSF : psf structure
  • roi::Array : array of tuples that define the pixel locations
  • x_emitter::Tuple : location of emitter
source
MicroscopePSFs.pdfₐMethod
pdfₐ(p::PSF,roi::Array,x_emitter::Tuple)

return the complex amplitude at pixel locations defined by roi with emitter located at x_emitter.

Arguments

  • p::PSF : psf structure
  • roi::Array : array of tuples that define the pixel locations
  • x_emitter::Tuple : location of emitter
source
MicroscopePSFs.pdfₐMethod
pdfₐ(p::PSF,x_pixel::Tuple,x_emitter::Tuple)

abstract function: return the complex amplitude at pixel x_pixel with emitter located at x_emitter.

Arguments

  • p::PSF : psf structure
  • x_pixel::Tuple : location of pixel
  • x_emitter::Tuple : location of emitter
source
MicroscopePSFs.radialpolynomialMethod
radialpolynomical(n::Int,m::Int,ρ)

return the value of the n,m radial polynomial at ρ

values of ρ>1 will return zero

Arguments

  • n : radial index
  • m : azimuthal index
  • ρ : radial coordinate

Returns

  • r : value of the radial polynomial at ρ
source
MicroscopePSFs.saveMethod
save(psffile::String,p::PSF)

save PSF type as .jld2 file

Arguments

  • psffile : The full saving path
  • p : MicroscopePSFs type
source
MicroscopePSFs.zernikepolynomialMethod
zernike(j::Int,ρ,ϕ; linearindex="OSA")

return the value of jth zernike polynomial at ρ,ϕ for a given Zernike linear index

Arguments

  • j : Zernike linear index
  • ρ : radial coordinate
  • ϕ : azimuthal coordinate
  • linearindex : linear index type, either "OSA" or "Noll"

Returns

value of the zernike polynomial at ρ,ϕ

source
MicroscopePSFs.zernikepolynomialMethod
zernike(n::Int,l::Int,ρ,ϕ)

return the value the n,l zernike polynomial at ρ,ϕ

Note that l is in -n<:2:n.

Arguments

  • n : radial index
  • l : azimuthal index
  • ρ : radial coordinate
  • ϕ : azimuthal coordinate

Returns

value of the zernike polynomial at ρ,ϕ

source