Simulated Brownian Diffusion

The SimBrownian class generates synthetic images corresponding to particles performing a thermal Brownian motion. This class was designed in order to make explicit the real parameters of the particles (i.e. the diffusion coefficient in real-space) with the magnification of the microscope. The PSF on the camera is derived from the pixel size, the wavelength and the numerical aperture of the objective. If the parameter frames_to_accumulate is set to a positive value, memory will be allocated in order to store the first N simulated frames. Once that number is achieved, the frames will keep looping between the already generated data. The decision not to simulate the frames a-priori was to give a better feeling regarding the user-interface. It is also assumed that frames are of datatype np.int16, which is a sensible default for most cameras, although int8 can also be useful for speeding up the trackpy algorithm.

Warning

There is no memory check regarding the accumulated frames.

Todo

Think how to add noise, background, and intensity fluuctuations to the particles.

copyright

Aquiles Carattino <aquiles@uetke.com>

license

GPLv3, see LICENSE for more details

class pynta.model.cameras.simulate_brownian.SimBrownian(camera_size: tuple = (500, 500))[source]

Bases: object

Parameters

camera_size (tuple) – number of pixels in the x and y direction

Returns

generated an image with specified noise and particles displaced accordingly

NA = 1

Numerical aperture of the objective, used to estimate PSF

dif_coef = 2

Diffusion coefficient um^2/s

dif_coef_2 = 0
frames_to_accumulate = 0

Number of frames will be accumulated in order to speed up simulations (they will be an infinite loop). Set to 0 in order to avoid accumulating frames

gen_image()[source]
Returns

generated image with specified noise and particles position

kernel_size = 5

Number of pixels used to calculate the PSF of the particle

magnification = 30

Magnification of the microscope

next_random_step()[source]
noise = 0

Background noise TODO: Needs to be implemented

num_particles = 100

Number of particles per frame

pixel_size = 5

In real space, um

resize_view(camera_size)[source]

SimulateBrownian.resizeView() adjusts the coordinates of the moving particles such that they fit into the desired framesize of the simulated dummycamera

signal = 300

Peak intensity for a particle

time_step = 0.03

Time step in the simulation. Should be set to the acquisition rate if used for a camera, seconds

wavelength = 0.5

um, used to estimate PSF