bbm_simulation_to_img: Create an image series from a 'bbm_sim'.

Description Usage Arguments Value See Also Examples

Description

Given an output of bbm_simulate(), create an image in the style of an ijtiff_img where each frame represents a time-point in the simulation. You must set the pixel size and there is the option for the pixel values to be counts of the number of molecules in that pixel, or Poisson photon counts where each particle has a user-defined brightness.

Usage

1
2
bbm_simulation_to_img(bbms, pixel_size, method = c("count", "poisson"),
  brightness = NULL, check_duplicates = TRUE)

Arguments

bbms

An object of class bbm_sim; the result of a simulation with bbm_simulate(). This must be 2-dimensional.

pixel_size

The pixel size for the image. A grid of pixels is filled out over the simulation space, starting at the bottom-left (the origin). Any pixels crossing the boundary of the simulation are discarded.

method

How shall the pixel values be calculated? method = "count" results in each pixel value being a count of the number of particles therein. method = "poisson" results in each particle being treated as a Poisson-emmitter of photons with rate specified in the brightness parameter.

brightness

Required only if method = poisson. The poisson photon emmission rate of the diffusing particles in units of per frame. This is the brightness 'epsilon' referred to in the field of number and brightness, a method in fluorescence fluctuation spectroscopy.

check_duplicates

Check for duplicate coordinates at each time point of the simulation, throwing an error if any are present. One reason to turn this off is for speed; the check slows things down slightly. If it's off and df does contain duplicate coordinates, the value associated with the last duplicate coordinate will count.

Value

An ijtiff_img.

See Also

bbm_simulate_img

Examples

1
2
3
sim <- bbm_simulate(n_particles = 2, D = 1.5, dim = c(3, 5), end_time = 2)
bbm_simulation_to_img(sim, pixel_size = 1, method = "c")
bbm_simulation_to_img(sim, pixel_size = 1, method = "p", brightness = 9)

rorynolan/brownded documentation built on May 5, 2019, 9:20 a.m.