Synthetic Data
For generating synthetic data there is a module SyntheticData that is exported from TransferFunctions.
TransferFunctions.SyntheticData — Modulemodule SyntheticDataA module that holds the methods for generating synthetic data as imitations of the objects that are relevant in microscopy.
Every model is a subtype of the SyntheticData.SyntheticModel abstract type. Every instance of this type has a SyntheticData.groundtruth interface which returns a SpatialArray with the sampled model.
Synthetic data models are a subtype of SyntheticModel
TransferFunctions.SyntheticData.SyntheticModel — TypeSyntheticModel{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
A ground truth sampled image from the model can then be generated using groundtruth
TransferFunctions.SyntheticData.groundtruth — Functiongroundtruth(s::SyntheticModel)Generate the ground truth image for the SyntheticModel s.
Sub-diffraction Beads
TransferFunctions.SyntheticData.Beads — TypeBeads{T, D} <: SyntheticModel{2}Sub-diffraction beads synthetic data model.
It can be constructed with beads which samples the position of the beads with an allowed spacing.
TransferFunctions.SyntheticData.bead — Functionbead([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_gridsets the dimensions equivalent to each pixel in the gridintesity=1.0: peak intensity value, i.e. the theoretical value at the center of the beadposition=(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.03TransferFunctions.SyntheticData.beads — Functionbeads(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 beadsmaxiters=30: maximum number of attempts to generate the beads locations with the given spacingxdist=Uniform(0,wh[1]): distribution for sampling the x-coordinateydist=Uniform(0,wh[2]): distribution for sampling the y-coordinateα=0u"nm^-1: evanescent wave attenuation constant
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)