Diffusion Approximation

Infinite

LightPropagation.fluence_DA_inf_CWFunction
fluence_DA_inf_CW(ρ, μa, μsp)

Compute the steady-state fluence in an infinite medium.

Arguments

  • ρ: source-detector separation (cm⁻¹)
  • μa: absorption coefficient (cm⁻¹)
  • μsp: reduced scattering coefficient (cm⁻¹)

Examples

julia> fluence_DA_inf_CW(1.0, 0.1, 10.0)
source
LightPropagation.fluence_DA_inf_TDFunction
fluence_DA_inf_TD(t, ρ, μa, μsp; n_med = 1.0)

Compute the time-domain fluence in an infinite medium.

Arguments

  • t: the time vector (ns).
  • ρ: source-detector separation (cm⁻¹)
  • μa: absorption coefficient (cm⁻¹)
  • μsp: reduced scattering coefficient (cm⁻¹)

Keyword Arguments

  • n_med= 1.0: medium's index of refraction

Examples

julia> fluence_DA_inf_TD(0.1, 1.0, 0.1, 10.0, n_med = 1.4)
julia> fluence_DA_inf_TD(0.1:0.5:5.0, 1.0, 0.1, 10.0, n_med = 1.4)
source

Semi-infinite

LightPropagation.fluence_DA_semiinf_CWFunction
fluence_DA_semiinf_CW(ρ, μa, μsp; n_ext = 1.0, n_med = 1.0, z = 0.0)

Compute the steady-state fluence in a semi-infinite geometry.

Arguments

  • ρ: the source detector separation (cm⁻¹)
  • μa: absorption coefficient (cm⁻¹)
  • μsp: reduced scattering coefficient (cm⁻¹)

Keyword arguments

  • n_ext: the boundary's index of refraction (air or detector)
  • n_med: the sample medium's index of refraction
  • z: the z-depth orthogonal from the boundary (cm)

Examples

julia> fluence_DA_semiinf_CW(1.0, 0.1, 10.0)
julia> fluence_DA_semiinf_CW(1.0, 0.1, 10.0, n_ext = 1.0, n_med = 1.0, z = 0.0)
source
LightPropagation.fluence_DA_semiinf_TDFunction
fluence_DA_semiinf_TD(t, ρ, μa, μsp; n_ext = 1.0, n_med = 1.0, z = 0.0)

Compute the time-domain fluence in a semi-infinite medium.

Arguments

  • t: the time vector (ns).
  • ρ: the source detector separation (cm⁻¹)
  • μa: absorption coefficient (cm⁻¹)
  • μsp: reduced scattering coefficient (cm⁻¹)

Keyword arguments

  • n_ext: the boundary's index of refraction (air or detector)
  • n_med: the sample medium's index of refraction
  • z: the z-depth orthogonal from the boundary (cm)

Examples

julia> fluence_DA_semiinf_TD(0.1:0.1:2.0, 1.0, 0.1, 10.0)
julia> fluence_DA_semiinf_TD(0.2:0.2:1.0, 1.0, 0.1, 10.0, n_ext = 1.0, n_med = 1.0, z = 0.0)
source
LightPropagation.flux_DA_semiinf_CWFunction
flux_DA_semiinf_CW(ρ, μa, μsp; n_ext = 1.0, n_med = 1.0)

Compute the steady-state flux (D*∂ϕ(ρ)/∂z @ z = 0) from a semi-infinite medium.

Arguments

  • ρ: the source detector separation (cm⁻¹)
  • μa: absorption coefficient (cm⁻¹)
  • μsp: reduced scattering coefficient (cm⁻¹)

Keyword arguments

  • ndet: the boundary's index of refraction (air or detector)
  • nmed: the sample medium's index of refraction

Examples

julia> flux_DA_semiinf_CW(1.0, 0.1, 10.0, n_ext = 1.0, n_med = 1.0)
source
LightPropagation.flux_DA_semiinf_TDFunction
flux_DA_semiinf_TD(t, ρ, μa, μsp; n_ext = 1.0, n_med = 1.0)

Compute the time-domain flux (D*∂ϕ(t)/∂z @ z = 0) in a semi-infinite medium.

Arguments

  • t: the time vector (ns).
  • ρ: the source detector separation (cm⁻¹)
  • μa: absorption coefficient (cm⁻¹)
  • μsp: reduced scattering coefficient (cm⁻¹)

Keyword arguments

  • n_ext: the boundary's index of refraction (air or detector)
  • n_med: the sample medium's index of refraction

Examples

julia> flux_DA_semiinf_TD(0.1:0.1:2.0, 1.0, 0.1, 10.0, n_ext = 1.0, n_med = 1.0)
source

Slab

LightPropagation.fluence_DA_slab_CWFunction
fluence_DA_slab_CW(ρ, μa, μsp; n_ext = 1.0, n_med = 1.0, s = 2.0, z = 0.0, xs = 10)

Compute the steady-state fluence from a slab geometry (x, y -> inf, z -> finite). The fluence is calculated from an infinite summation that converges rather rapidly. Generally only 5 terms are needed (xs = 5), but more terms will be required if ρ >> s.

Arguments

  • ρ: the source detector separation (cm⁻¹)
  • μa: absorption coefficient (cm⁻¹)
  • μsp: reduced scattering coefficient (cm⁻¹)

Optional arguments

  • n_ext: the boundary's index of refraction (air or detector)
  • n_med: the sample medium's index of refraction
  • s: the thickness (z-depth) of the slab (cm)
  • z: the z-depth within slab (cm)
  • xs: the number of sources to compute in the series

Examples

julia> fluence_DA_slab_CW(1.0, 0.1, 10.0, n_ext = 1.0, n_med = 1.0, s = 1.0, z = 0.0)
source
fluence_DA_slab_CW(data::DiffusionParameters)

Wrapper to fluence_DA_slab_CW(ρ, μa, μsp; n_ext = 1.0, n_med = 1.0, z = 0.0, s = 1.0, xs = 10)

Examples

julia> data = DAslab(ρ = 1.0, s = 3.0) # use structure to generate inputs
julia> fluence_DA_slab_CW(data) # then call the function
source
LightPropagation.fluence_DA_slab_TDFunction
fluence_DA_slab_TD(t, ρ, μa, μsp; n_ext = 1.0, n_med = 1.0, s = 1.0, z = 0.0, xs = 10)

Compute the time-domain fluence from a slab geometry (x, y -> inf, z -> finite). The fluence is calculated from an infinite summation that converges rather rapidly. Generally only 5 terms are needed (xs = 5), but more terms will be required if ρ >> s. At long time values (low fluence values), the solution struggles with limited precision. Using double floats or BigFloats is advised at these times.

Arguments

  • t: the time vector (ns).
  • ρ: the source detector separation (cm⁻¹)
  • μa: absorption coefficient (cm⁻¹)
  • μsp: reduced scattering coefficient (cm⁻¹)

Optional arguments

  • n_ext: the boundary's index of refraction (air or detector)
  • n_med: the sample medium's index of refraction
  • s: the thickness (z-depth) of the slab (cm)
  • z: the z-depth coordinate (cm)
  • xs: the number of sources to compute in the series

Examples

julia> fluence_DA_slab_TD(0.1, 1.0, 0.1, 10.0, s = 40.0)

source
fluence_DA_slab_TD(t, data::DiffusionParameters)

Wrapper to fluence_DA_slab_TD(t, ρ, μa, μsp; n_ext = 1.0, n_med = 1.0, s = 1.0, z = 0.0, xs = 10)

Examples

julia> data = DAslab() # use structure to generate inputs
julia> fluence_DA_slab_TD(data) # then call the function
source
LightPropagation.flux_DA_slab_CWFunction
fluence_DA_slab_CW(ρ, μa, μsp; n_ext = 1.0, n_med = 1.0, s = 2.0, z = 0.0, xs = 10)

Compute the steady-state flux, D∂ϕ(ρ)/∂z for z = 0 and -D∂ϕ(ρ)/∂z for z = s from a slab geometry (x, y -> inf, z -> finite). If z != 0 or s will default to compute D*∂ϕ(ρ)/∂z for the z given.

Arguments

  • ρ: the source detector separation (cm⁻¹)
  • μa: absorption coefficient (cm⁻¹)
  • μsp: reduced scattering coefficient (cm⁻¹)

Optional arguments

  • n_ext: the boundary's index of refraction (air or detector)
  • n_med: the sample medium's index of refraction
  • s: the thickness (z-depth) of the slab (cm)
  • z: the z-depth within slab (cm)
  • xs: the number of sources to compute in the series

Examples

julia> flux_DA_slab_CW(1.0, 0.1, 10.0, n_ext = 1.0, n_med = 1.0, s = 2.0, z = 0.0)
source
flux_DA_slab_CW(data::DiffusionParameters)

Wrapper to flux_DA_slab_CW(ρ, μa, μsp; n_ext = 1.0, n_med = 1.0)

Examples

julia> data = DAslab(ρ = 1.0) # use structure to generate inputs
julia> flux_DA_slab_CW(data) # then call the function
source
LightPropagation.flux_DA_slab_TDFunction
flux_DA_slab_TD(t, ρ, μa, μsp; n_ext = 1.0, n_med = 1.0, s = 1.0, z = 0.0, xs = 15)

Compute the time-domain flux, D*∂ϕ(t)/∂z for z = 0 and -D*∂ϕ(t)/∂z for z = s from a slab geometry (x, y -> inf, z -> finite).
If z != 0 or s will default to compute D*∂ϕ(t)/∂z for the z given.

Arguments

  • t: the time vector (ns).
  • ρ: the source detector separation (cm⁻¹)
  • μa: absorption coefficient (cm⁻¹)
  • μsp: reduced scattering coefficient (cm⁻¹)

Keyword arguments

  • n_ext: the boundary's index of refraction (air or detector)
  • n_med: the sample medium's index of refraction
  • s: the thickness (z-depth) of the slab (cm)
  • z: the z-depth coordinate (cm) must be equal
  • xs: the number of sources to compute in the series

Examples

julia> flux_DA_slab_TD(1.0, 1.0, 0.1, 10.0, n_ext = 1.0, n_med = 1.0, z = 0.0, s = 1.0)

source
flux_DA_slab_TD(t, data::DiffusionParameters)

Wrapper to flux_DA_slab_TD(t, ρ, μa, μsp; n_ext = 1.0, n_med = 1.0, z = 0.0, s = 1.0, xs = 15)

Examples

julia> data = DAslab(ρ = 1.0) # use structure to generate inputs
julia> flux_DA_slab_TD(data) # then call the function
source

Parallelepiped

LightPropagation.fluence_DA_paralpip_CWFunction
fluence_DA_paralpip_CW(μa, μsp; n_ext = 1.0, n_med = 1.0, rd = [4.0, 5.0, 0.0], rs = [5.0, 5.0], L = [10.0, 10.0, 10.0], xs = 10)

Compute the steady-state fluence in a parallelepiped [lx, ly, lz].

Arguments

  • μa: absorption coefficient (cm⁻¹)
  • μsp: reduced scattering coefficient (cm⁻¹)

Optional arguments

  • n_ext: the boundary's index of refraction (air or detector)
  • n_med: the sample medium's index of refraction
  • rd: target location within medium [x,y,z] with origin x,y = 0 at corner of parallelepiped; z assumed to be 0
  • rs: the location of the source [x,y] with origin x,y = 0 at corner of parallelepiped; z assumed to be 0
  • L: the dimensions [lx, ly, lz] of the parallelepiped
  • xs: the number of sources to compute in the series

Examples

julia> fluence_DA_paralpip_CW(0.1, 10.0, n_ext = 1.0, n_med = 1.0, rd = [24.0, 25.0, 0.0], rs = [25.0,25.0], L = [50.0,50.0,50.0], xs = 20)

source
LightPropagation.fluence_DA_paralpip_TDFunction
fluence_DA_paralpip_TD(t, μa, μsp; n_ext = 1.0, n_med = 1.0, rd = [4.0, 5.0, 0.0], rs = [5.0, 5.0], L = [10.0, 10.0, 10.0], xs = 10)

Compute the time-domain fluence in a parallelepiped [lx, ly, lz].

Arguments

  • t: the time vector (ns).
  • μa: absorption coefficient (cm⁻¹)
  • μsp: reduced scattering coefficient (cm⁻¹)

Optional arguments

  • n_ext: the boundary's index of refraction (air or detector)
  • n_med: the sample medium's index of refraction
  • rd: target location within medium [x,y,z] with origin x,y = 0 at corner of parallelepiped; z assumed to be 0
  • rs: the location of the source [x,y] with origin x,y = 0 at corner of parallelepiped; z assumed to be 0
  • L: the dimensions [lx, ly, lz] of the parallelepiped
  • xs: the number of sources to compute in the series

Examples

julia> fluence_DA_paralpip_TD(0.5, 0.1, 10.0, n_ext = 1.0, n_med = 1.0, rd = [24.0, 25.0, 0.0], rs = [25.0,25.0], L = [50.0,50.0,50.0], xs = 20)
source

Layered Cylinder

LightPropagation.fluence_DA_Nlay_cylinder_CWFunction
fluence_DA_Nlay_cylinder_CW(ρ, μa, μsp; n_ext=1.0, n_med=(1.0, 1.0), l=(1.0, 5.0), a=10.0, z=0.0, MaxIter=10000, atol=eps(Float64))

Compute the steady-state fluence in an N-layered cylinder.

Arguments

  • ρ::Union{T, NTuple{M, T}}: source-detector separation(s) in cylindrical coordinates (distance from middle z-axis of cylinder) (cm⁻¹)
  • μa::NTuple{N, T}: absorption coefficients in each layer (cm⁻¹)
  • μsp::NTuple{N, T}: reduced scattering coefficient in each layer (cm⁻¹)

Keyword arguments

  • n_ext::T: the boundary's index of refraction (air or detector)
  • n_med::NTuple{N, T}: the sample medium's index of refraction in each layer
  • z::T: the z-depth orthogonal from the boundary (cm) within the cylinder
  • l::NTuple{N, T}: layer thicknesses (cm)
  • a::T: cylinder radius (cm)
  • MaxIter::Int: the maximum number of terms to consider in the infinite sum
  • atol::T: the infinite sum will break after this absolute tolerance is met

The source must be located in the first layer (l[1] > 1/μsp[1]). Other arguments are not checked but should be restricted to:

  • ρ, μa, and z >= 0.0
  • μsp, next, nmed, a > 0.0
  • l .> 0.0
  • ρ < a
  • length(μa) == length(μsp) == length(n_med) == length(l)

ρ can be a single source detector separation or a tuple of separations. μa, μsp, n_med, l should be tuples of the same length (e.g., (0.1, 0.1)). The input parameters should be of the same type, but will work with mixed types. The routine can be accurate until the machine precision used in the calculation. Therefore, atol should be >= eps(T). Larger values of μsp[1] will require a larger number of terms in the summation. It is recommended to increase MaxIter if simulating higher scattering coefficients. It is also recommended to keep the cylinder radius as small as possible to increase convergence rate.

Examples

julia> fluence_DA_Nlay_cylinder_CW(1.0, (0.1, 0.1), (10.0, 10.0))
julia> fluence_DA_Nlay_cylinder_CW((1.0, 2.0), (0.1, 0.1), (10.0, 10.0))
julia> fluence_DA_Nlay_cylinder_CW(1.0, (0.2, 0.1), (12.0, 10.0), l = (10.0, 10.0), MaxIter=1000, atol=1.0e-8)
# to simulate a 3 layer media
julia> fluence_DA_Nlay_cylinder_CW(1.0, (0.2, 0.1, 0.2), (12.0, 10.0, 11.0), l = (1.0, 1.2, 4.0), n_med = (1.0, 1.0, 1.0), MaxIter=1000, atol=1.0e-8)
source
LightPropagation.fluence_DA_Nlay_cylinder_TDFunction
fluence_DA_Nlay_cylinder_TD(t, ρ, μa, μsp; n_ext=1.0, n_med=(1.0, 1.0), l=(1.0, 5.0), a=10.0, z=0.0, MaxIter=10000, atol=eps(Float64), N, ILT)

Compute the time-domain fluence in an N-layered cylinder.

Arguments

  • t::Union{T, Vector{T}}: time point or vector of time values (ns)
  • ρ::Union{T}: source-detector separation in cylindrical coordinates (distance from middle z-axis of cylinder) (cm⁻¹)
  • μa::NTuple{N, T}: absorption coefficients in each layer (cm⁻¹)
  • μsp::NTuple{N, T}: reduced scattering coefficient in each layer (cm⁻¹)

Keyword arguments

  • n_ext::T: the boundary's index of refraction (air or detector)
  • n_med::NTuple{N, T}: the sample medium's index of refraction in each layer
  • z::T: the z-depth orthogonal from the boundary (cm) within the cylinder
  • l::NTuple{N, T}: layer thicknesses (cm)
  • a::T: cylinder radius (cm)
  • MaxIter::Int: the maximum number of terms to consider in the infinite sum
  • atol::T: the infinite sum will break after this absolute tolerance is met
  • N::Int: the number of terms used in the integration of the trapezoidal rule for the Laplace transform
  • ILT: fucntion used to perform the inverse Laplace transform

The source must be located in the first layer (l[1] > 1/μsp[1]). Other arguments are not checked but should be restricted to:

  • ρ, μa, and z >= 0.0
  • μsp, next, nmed, a > 0.0
  • l .> 0.0
  • ρ < a
  • length(μa) == length(μsp) == length(n_med) == length(l)
  • t .> 0.0

t can be a scaler or a vector but all values of t should be greater than zero and if a vector, should be ordered. If t is a scaler hyperbola is used for the inverse Laplace transform where hyper_fixed is used if it is a vector. The value of N should be proportional to the dynamic range of the time-domain signal needed. If t[end]/t[1] is large then a higher value of N will be required. In general, a larger N will be needed to reconstruct very late times. μa, μsp, n_med, l should be tuples of the same length (e.g., (0.1, 0.1)). The input parameters should be of the same type, but will work with mixed types. The routine can be accurate until the machine precision used in the calculation. Therefore, atol should be >= eps(eltype(μsp)). Larger values of μsp[1] will require a larger number of terms in the summation. It is recommended to increase MaxIter if simulating higher scattering coefficients. It is also recommended to keep the cylinder radius as small as possible to increase convergence rate.

The Laplace transform implements threaded parallelism. It is recommended to start Julia with multiple threads (check with Threads.nthreads() in the REPL)

Examples

# at a single time point
julia> fluence_DA_Nlay_cylinder_TD(1.0, 1.0, (0.1, 0.1), (10.0, 10.0))
# for several time points
julia> fluence_DA_Nlay_cylinder_TD(0.2:0.2:2.0, 1.0, (0.1, 0.1), (10.0, 10.0))
julia> fluence_DA_Nlay_cylinder_TD([0.5, 0.8, 1.2], 1.0, (0.1, 0.1), (10.0, 10.0))
julia> fluence_DA_Nlay_cylinder_TD(0.1:0.3:5.0, 1.0, (0.1, 0.2), (12.0, 10.0), N = 48)
# to simulate a 3 layer media
julia> fluence_DA_Nlay_cylinder_TD(0.1:0.2:1.2, 1.0, (0.2, 0.1, 0.2), (12.0, 10.0, 11.0), l = (1.0, 1.2, 4.0), n_med = (1.0, 1.0, 1.0), MaxIter=1000, atol=1.0e-8)
source
LightPropagation.flux_DA_Nlay_cylinder_CWFunction
flux_DA_Nlay_cylinder_CW(ρ, μa, μsp; n_ext=1.0, n_med=(1.0, 1.0), l=(1.0, 5.0), a=10.0, z=0.0, MaxIter=10000, atol=eps(Float64))

Compute the steady-state flux using Fick's law D[1]∂ϕ(ρ)/∂z for z = 0 (reflectance) and -D[end]∂ϕ(ρ)/∂z for z = sum(l) (transmittance) in an N-layered cylinder. z must be equal to 0 or the total length sum(l) of cylinder.

Arguments

  • ρ::Union{T}: source-detector separation in cylindrical coordinates (distance from middle z-axis of cylinder) (cm⁻¹)
  • μa::NTuple{N, T}: absorption coefficients in each layer (cm⁻¹)
  • μsp::NTuple{N, T}: reduced scattering coefficient in each layer (cm⁻¹)

Keyword arguments

  • n_ext::T: the boundary's index of refraction (air or detector)
  • n_med::NTuple{N, T}: the sample medium's index of refraction in each layer
  • z::T: the z-depth orthogonal from the boundary (cm) within the cylinder
  • l::NTuple{N, T}: layer thicknesses (cm)
  • a::T: cylinder radius (cm)
  • MaxIter::Int: the maximum number of terms to consider in the infinite sum
  • atol::T: the infinite sum will break after this absolute tolerance is met

The source must be located in the first layer (l[1] > 1/μsp[1]). Other arguments are not checked but should be restricted to:

  • ρ, μa, and z >= 0.0
  • μsp, next, nmed, a > 0.0
  • l .> 0.0
  • ρ < a
  • length(μa) == length(μsp) == length(n_med) == length(l)

ρ can be a single source detector separation, however there is currently a bug in the code preventing this https://github.com/heltonmc/LightPropagation.jl/issues/11. μa, μsp, n_med, l should be tuples of the same length (e.g., (0.1, 0.1)). The input parameters should be of the same type, but will work with mixed types. The routine can be accurate until the machine precision used in the calculation. Therefore, atol should be >= eps(eltype(μsp)). Larger values of μsp[1] will require a larger number of terms in the summation. It is recommended to increase MaxIter if simulating higher scattering coefficients. It is also recommended to keep the cylinder radius as small as possible to increase convergence rate.

Examples

julia> flux_DA_Nlay_cylinder_CW(1.0, (0.1, 0.1), (10.0, 10.0))
julia> flux_DA_Nlay_cylinder_CW((1.0, 2.0), (0.1, 0.1), (10.0, 10.0))
julia> flux_DA_Nlay_cylinder_CW(1.0, (0.2, 0.1), (12.0, 10.0), l = (10.0, 10.0), MaxIter=1000, atol=1.0e-8)
# to simulate a 3 layer media
julia> flux_DA_Nlay_cylinder_CW(1.0, (0.2, 0.1, 0.2), (12.0, 10.0, 11.0), l = (1.0, 1.2, 4.0), n_med = (1.0, 1.0, 1.0), MaxIter=1000, atol=1.0e-8)
source
LightPropagation.flux_DA_Nlay_cylinder_TDFunction
flux_DA_Nlay_cylinder_TD(t, ρ, μa, μsp; n_ext=1.0, n_med=(1.0, 1.0), l=(1.0, 5.0), a=10.0, z=0.0, MaxIter=10000, atol=eps(Float64), N, ILT)

Compute the time-domain flux using Fick's law D[1]∂ϕ(ρ, t)/∂z for z = 0 (reflectance) and -D[end]∂ϕ(ρ, t)/∂z for z = sum(l) (transmittance) in an N-layered cylinder. ∂ϕ(ρ, t)/∂z is calculated using forward mode auto-differentiation with ForwardDiff.jl

Arguments

  • t::Union{T, Vector{T}}: time point or vector of time values (ns)
  • ρ::Union{T}: source-detector separation in cylindrical coordinates (distance from middle z-axis of cylinder) (cm⁻¹)
  • μa::NTuple{N, T}: absorption coefficients in each layer (cm⁻¹)
  • μsp::NTuple{N, T}: reduced scattering coefficient in each layer (cm⁻¹)

Keyword arguments

  • n_ext::T: the boundary's index of refraction (air or detector)
  • n_med::NTuple{N, T}: the sample medium's index of refraction in each layer
  • z::T: the z-depth orthogonal from the boundary (cm) within the cylinder
  • l::NTuple{N, T}: layer thicknesses (cm)
  • a::T: cylinder radius (cm)
  • MaxIter::Int: the maximum number of terms to consider in the infinite sum
  • atol::T: the infinite sum will break after this absolute tolerance is met
  • N::Int: the number of terms used in the integration of the trapezoidal rule for the Laplace transform
  • ILT: fucntion used to perform the inverse Laplace transform

The source must be located in the first layer (l[1] > 1/μsp[1]). Other arguments are not checked but should be restricted to:

  • ρ, μa, and z >= 0.0
  • μsp, next, nmed, a > 0.0
  • l .> 0.0
  • ρ < a
  • length(μa) == length(μsp) == length(n_med) == length(l)
  • t .> 0.0

t can be a scaler or a vector but all values of t should be greater than zero and if a vector, should be ordered. If t is a scaler hyperbola is used for the inverse Laplace transform where hyper_fixed is used if it is a vector. The value of N should be proportional to the dynamic range of the time-domain signal needed. If t[end]/t[1] is large then a higher value of N will be required. In general, a larger N will be needed to reconstruct very late times. μa, μsp, n_med, l should be tuples of the same length (e.g., (0.1, 0.1)). The input parameters should be of the same type, but will work with mixed types. The routine can be accurate until the machine precision used in the calculation. Therefore, atol should be >= eps(T). Larger values of μsp[1] will require a larger number of terms in the summation. It is recommended to increase MaxIter if simulating higher scattering coefficients. It is also recommended to keep the cylinder radius as small as possible to increase convergence rate.

The Laplace transform implements threaded parallelism. It is recommended to start Julia with multiple threads (check with Threads.nthreads() in the REPL)

Examples

# at a single time point
julia> flux_DA_Nlay_cylinder_TD(1.0, 1.0, (0.1, 0.1), (10.0, 10.0))
# for several time points
julia> flux_DA_Nlay_cylinder_TD(0.2:0.2:2.0, 1.0, (0.1, 0.1), (10.0, 10.0))
julia> flux_DA_Nlay_cylinder_TD([0.5, 0.8, 1.2], 1.0, (0.1, 0.1), (10.0, 10.0))
julia> flux_DA_Nlay_cylinder_TD(0.1:0.3:5.0, 1.0, (0.1, 0.2), (12.0, 10.0), N = 48)
# to simulate a 3 layer media
julia> flux_DA_Nlay_cylinder_TD(0.1:0.2:1.2, 1.0, (0.2, 0.1, 0.2), (12.0, 10.0, 11.0), l = (1.0, 1.2, 4.0), n_med = (1.0, 1.0, 1.0), MaxIter=1000, atol=1.0e-8)
source

DCS

Missing docstring.

Missing docstring for DAsemiinf_DCS. Check Documenter's build log for details.

Missing docstring.

Missing docstring for g2_DA_semiinf_CW. Check Documenter's build log for details.

LightPropagation.Nlayer_cylinder_DCSType

NlayercylinderDCS

Provides default parameters to use to compute the autocorrelation function g2 in a N-layered cylinder. The arguments defined with a Vector should be the same length and same type.

Keyword Arguments

  • ρ: source-detector separation (cm⁻¹)
  • μa::Vector{T}: absorption coefficient (cm⁻¹)
  • μsp::Vector{T}: reduced scattering coefficient (cm⁻¹)
  • n_med::Vector{T}: medium's index of refraction
  • n_ext: external medium's index of refraction (air or detector)
  • l: the thicknesses of each layer (cm)
  • z: the z-depth orthogonal from the boundary (cm)
  • a: the radius of the cylinder (cm)
  • β: constant in Siegert relation dependent on collection optics
  • BFi::Vector{T}: Blood flow index ~αDb (cm²/s)
  • λ: wavelength (nm)
  • N_J0Roots: roots of J0

Examples

julia> data = Nlayer_cylinder_DCS() # return default parameters
julia> data = Nlayer_cylinder_DCS(ρ = 1.5) # return ρ = 1.5 with the rest of the parameters given by defaults

# we can now define our correlation times τ
julia> τ = 10 .^(range(-10,stop=0,length=250))
julia> g2_DA_Nlay_cylinder_CW(τ, data)
source
Missing docstring.

Missing docstring for g2_DA_Nlay_cylinder_CW. Check Documenter's build log for details.