AbstractEmitter

public abstract class AbstractEmitter extends Point2D.Double

A point source of light and tools to compute its signature on a digital detector. Emitters are general point sources of light that are imaged by an optical system and recorded by a digital sensor. The AbstractEmitter class contains tools for generating the digital images of point sources without any regard for the dynamics of the of the signal (apart from photon shot noise). Classes that extend the AbstractEmitter class are intended to implement the dynamics of the source’s signal.

Author:Marcel Stefko, Kyle M. Douglass

Fields

builder

protected PSFBuilder builder

A builder for creating/updating the emitter PSF.

id

protected int id

A unique ID assigned to this emitter.

numberOfEmitters

protected static int numberOfEmitters

Running total of the number of emitters.

pixel_list

protected ArrayList<Pixel> pixel_list

List of pixels which are affected by this emitter’s light (these pixels need to be updated when the emitter is on).

poisson

protected Poisson poisson

Poisson RNG for flickering simulation.

psf

protected PSF psf

The PSF model that’s created by the emitter.

z

public double z

The emitter’s z-position.

Constructors

AbstractEmitter

public AbstractEmitter(double x, double y, double z, PSFBuilder psfBuilder)

Creates the emitter at given position, and calculates its image from the PSF and camera.

Parameters:
  • x – x-position in image [pixels, with sub-pixel precision]
  • y – y-position in image [pixels, with sub-pixel precision]
  • z – z-position in image [pixels, with sub-pixel precision]
  • psfBuilder – Builder for creating the emitter’s PSF.

Methods

applyTo

public void applyTo(float[][] pixels)

Simulates the brightness pattern of this emitter for the next frame duration, and renders the emitter onto the image.

Parameters:
  • pixels – image to be drawn on

flicker

protected double flicker(double baseBrightness)

Applies Poisson statistics to simulate flickering of an emitter.

Parameters:
  • baseBrightness – mean of Poisson distribution to draw from
Returns:

actual brightness of this emitter for this frame

generate_signature_for_pixel

protected double generate_signature_for_pixel(int x, int y, double camera_fwhm_digital)

Returns the signature that this emitter leaves on a given pixel (what fraction of this emitter’s photons hits this particular pixel).

Parameters:
  • x – pixel x-position
  • y – pixel y-position
  • camera_fwhm_digital – camera fwhm value
Throws:
  • MathException
Returns:

signature value for this pixel

getId

public int getId()

Returns the emitter’s ID.

Returns:The unique integer identifying the emitter.

getPSF

public PSF getPSF()

Returns the emitter’s PSF model.

Returns:The PSF model used to create the image of this emitter.

getPixelList

public ArrayList<Pixel> getPixelList()

Returns list of pixels which need to be drawn on the image to accurately render the emitter.

Returns:list of Pixels

getPixelsWithinRadius

public static final ArrayList<Pixel> getPixelsWithinRadius(Point2D point, double radius)

Returns a list of pixels within a certain radius from a point. This method locates all the pixels within a circular area surrounding a given two-dimensional point whose center lies at (x, y). The coordinate of a pixel is assumed to lie at the pixel’s center, and a pixel is within a given radius of another if the pixel’s center lies within this circle.

Parameters:
  • point
  • radius – radius value [pixels]
Returns:

list of Pixels with pre-calculated signatures

get_pixels_within_radius

protected final ArrayList<Pixel> get_pixels_within_radius(double radius, double camera_fwhm_digital)

Returns a list of pixels within a certain radius from this emitter (so that their signature is precalculated). Pixels outside this radius are considered to have negligible signature.

Parameters:
  • radius – radius value [pixels]
  • camera_fwhm_digital – camera fwhm value
Returns:

list of Pixels with precalculated signatures

setPSF

public void setPSF(PSF psf)

Change the emitter’s PSF model.

Parameters:
  • psf – The PSF model used to create the image of this emitter.

simulateBrightness

protected abstract double simulateBrightness()

Simulates the state evolution of the emitter for the next frame, and returns the integrated brightness of this emitter for this frame.

Returns:brightness of emitter in this frame [photons emitted]