@@ -28,14 +28,16 @@ Pkg.add("SMLMSim")
2828
2929## Basic Usage
3030
31- The high-level interface for simulating SMLM super-resolution coordinate data is the ` simulate() ` function (or the alias ` sim() ` ) .
31+ The high-level interface for simulating SMLM super-resolution coordinate data is the ` simulate() ` function with a ` StaticSMLMParams ` object .
3232
3333``` julia
3434using SMLMSim
3535
3636# Basic simulation with default parameters
3737camera = IdealCamera(1 : 128 , 1 : 128 , 0.1 ) # 128×128 pixels, 100nm pixels
38+ params = StaticSMLMParams() # Default parameters
3839smld_true, smld_model, smld_noisy = simulate(
40+ params,
3941 camera= camera
4042)
4143```
@@ -57,16 +59,20 @@ For more control, you can customize the parameters:
5759
5860``` julia
5961# More customized simulation
60- smld_true, smld_model, smld_noisy = simulate(;
62+ params = StaticSMLMParams(
6163 ρ= 1.0 , # emitters per μm²
6264 σ_psf= 0.13 , # PSF width in μm (130nm)
6365 minphotons= 50 , # minimum photons for detection
6466 ndatasets= 10 , # number of independent datasets
6567 nframes= 1000 , # frames per dataset
66- framerate= 50.0 , # frames per second
68+ framerate= 50.0 # frames per second
69+ )
70+
71+ smld_true, smld_model, smld_noisy = simulate(
72+ params,
6773 pattern= Nmer2D(n= 6 , d= 0.2 ), # hexamer with 200nm diameter
6874 molecule= GenericFluor(; q= [0 50 ; 1e-2 0 ]), # rates in 1/s
69- camera= IdealCamera(; ypixels = 256 , xpixels = 128 , pixelsize = 0.1 ) # pixelsize in μm
75+ camera= IdealCamera(1 : 256 , 1 : 128 , 0.1 ) # 128×256 pixels, 100nm pixels
7076)
7177```
7278
@@ -166,10 +172,15 @@ using CairoMakie
166172# Create camera with physical pixel size
167173camera = IdealCamera(1 : 128 , 1 : 256 , 0.1 ) # 128×256 pixels, 100nm pixels
168174
169- # Simulation parameters in physical units
170- smld_true, smld_model, smld_noisy = simulate(;
175+ # Create simulation parameters
176+ params = StaticSMLMParams(
171177 ρ= 1.0 , # emitters per μm²
172- σ_psf= 0.13 , # PSF width in μm
178+ σ_psf= 0.13 # PSF width in μm
179+ )
180+
181+ # Run simulation
182+ smld_true, smld_model, smld_noisy = simulate(
183+ params,
173184 pattern= Nmer2D(n= 6 , d= 0.2 ), # hexamer with 200nm diameter
174185 camera= camera
175186)
@@ -212,13 +223,19 @@ using SMLMSim
212223# Create camera with physical pixel size
213224camera = IdealCamera(1 : 128 , 1 : 256 , 0.1 ) # 128×256 pixels, 100nm pixels
214225
215- # Simulation parameters in physical units
216- smld_true, smld_model, smld_noisy = simulate(;
226+ # Create 3D simulation parameters
227+ params = StaticSMLMParams(
217228 ρ= 0.5 , # emitters per μm²
218- pattern= Nmer3D(n= 8 , d= 0.3 ), # 3D pattern
219- camera= camera,
229+ ndims= 3 , # 3D simulation
220230 zrange= [- 2.0 , 2.0 ] # 4μm axial range
221231)
232+
233+ # Run simulation
234+ smld_true, smld_model, smld_noisy = simulate(
235+ params,
236+ pattern= Nmer3D(n= 8 , d= 0.3 ), # 3D pattern
237+ camera= camera
238+ )
222239```
223240
224241## Contributors
0 commit comments