Synthetic Data

For generating synthetic data there is a module SyntheticData that is exported from TransferFunctions.

Synthetic data models are a subtype of SyntheticModel

TransferFunctions.SyntheticData.SyntheticModelType
SyntheticModel{N}

SyntheticModel{N} is an abstract type that represents a model which allows generating a ground truth image of dimensionality N.

It itself may be randomized but the generation of the ground truth image from the instance must be deterministic.

Subtypes include Beads

source

A ground truth sampled image from the model can then be generated using groundtruth

Sub-diffraction Beads

TransferFunctions.SyntheticData.beadFunction
bead([T=Float64], d, Δ; <kwargs>)

Generate a model of a fluorescent microsphere (AKA calibration bead) with diameter d and pixel-size Δ.

Arguments

  • α=0u"nm^-1: evanescent wave attenuation constant in the TIR-FM microscopy modulation. An acquisition that is not TIR-FM is equivalent to setting α=0u"nm^-1".
  • pixel_grid=10: aliasing of the pixels is done by averaging values at a larger grid. pixel_grid sets the dimensions equivalent to each pixel in the grid
  • intesity=1.0: peak intensity value, i.e. the theoretical value at the center of the bead
  • position=(0.0, 0.0): set the subpixel position of the peak (center) of the bead within the generated array

Examples

julia> SyntheticData.bead(100u"nm", 30.5u"nm");

julia> SyntheticData.bead(95u"nm", (30.5u"nm", 25u"nm"));

julia> SyntheticData.bead(Float32, 0.1u"μm", 30.5u"nm");

julia> SyntheticData.bead(0.1u"μm", 30.5u"nm"; α=0.01u"nm^-1")
5×5 SampledArray{Float64, Quantity{Float64, 𝐋, Unitful.FreeUnits{(nm,), 𝐋, nothing}}, 2, OffsetArrays.OffsetMatrix{Float64, Matrix{Float64}}, (30.5 nm, 30.5 nm)} with indices -2:2×-2:2:
 0.0        0.0       0.0705075  0.0       0.0
 0.0        0.606779  0.892914   0.606779  0.0
 0.0705075  0.892914  1.0        0.892914  0.0705075
 0.0        0.606779  0.892914   0.606779  0.0
 0.0        0.0       0.0705075  0.0       0.0

julia> SyntheticData.bead(0.1u"μm", 50.5u"nm"; position=(-0.3,-0.2))
3×3 SampledArray{Float64, Quantity{Float64, 𝐋, Unitful.FreeUnits{(nm,), 𝐋, nothing}}, 2, OffsetArrays.OffsetMatrix{Float64, Matrix{Float64}}, (50.5 nm, 50.5 nm)} with indices -1:1×-1:1:
 0.333333  0.737374  0.0808081
 0.59596   1.0       0.20202
 0.020202  0.141414  0.0

julia> SyntheticData.bead(0.1u"μm", 50.5u"nm"; intensity=0.5)
3×3 SampledArray{Float64, Quantity{Float64, 𝐋, Unitful.FreeUnits{(nm,), 𝐋, nothing}}, 2, OffsetArrays.OffsetMatrix{Float64, Matrix{Float64}}, (50.5 nm, 50.5 nm)} with indices -1:1×-1:1:
 0.03  0.23  0.03
 0.23  0.5   0.23
 0.03  0.23  0.03
source
TransferFunctions.SyntheticData.beadsFunction
beads(N::Int, d::Length, Δxy::PixelSize, wh::Size; <kwargs>)

Generate synthetic the Beads SyntheticModel with N beads of the diameter d

Keyword Arguments

  • spacing::Length=2.5d: spacing between the beads
  • maxiters=30: maximum number of attempts to generate the beads locations with the given spacing
  • xdist=Uniform(0,wh[1]): distribution for sampling the x-coordinate
  • ydist=Uniform(0,wh[2]): distribution for sampling the y-coordinate
  • α=0u"nm^-1: evanescent wave attenuation constant
source

Generating $N=100$ beads with a diameter of $100\;\mathrm{nm}$ in an image of the size $256 \times 256$ pixels

beads = SyntheticData.beads(100, 100u"nm", 40u"nm", (256,256))
GT = SyntheticData.groundtruth(beads)