.. java:import:: ch.epfl.leb.sass.utils RNG .. java:import:: ch.epfl.leb.sass.models.legacy Camera .. java:import:: cern.jet.random Poisson .. java:import:: java.awt.geom Point2D .. java:import:: java.util ArrayList .. java:import:: java.util.logging Level .. java:import:: java.util.logging Logger .. java:import:: org.apache.commons.math MathException .. java:import:: org.apache.commons.math.special Erf .. java:import:: ch.epfl.leb.sass.models.psfs PSF .. java:import:: ch.epfl.leb.sass.models.psfs PSFBuilder .. java:import:: ch.epfl.leb.sass.loggers PositionLogger .. java:import:: ch.epfl.leb.sass.loggers StateLogger .. java:import:: ch.epfl.leb.sass.loggers FrameLogger AbstractEmitter =============== .. java:package:: ch.epfl.leb.sass.models.emitters.internal :noindex: .. java:type:: 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 ^^^^^^^ .. java:field:: protected PSFBuilder builder :outertype: AbstractEmitter A builder for creating/updating the emitter PSF. camera ^^^^^^ .. java:field:: @Deprecated protected final Camera camera :outertype: AbstractEmitter Camera settings used for calculating PSF frameLogger ^^^^^^^^^^^ .. java:field:: protected final FrameLogger frameLogger :outertype: AbstractEmitter A copy of the frame logger. id ^^ .. java:field:: protected int id :outertype: AbstractEmitter A unique ID assigned to this emitter. numberOfEmitters ^^^^^^^^^^^^^^^^ .. java:field:: protected static int numberOfEmitters :outertype: AbstractEmitter Running total of the number of emitters. pixel_list ^^^^^^^^^^ .. java:field:: protected ArrayList pixel_list :outertype: AbstractEmitter List of pixels which are affected by this emitter's light (these pixels need to be updated when the emitter is on). poisson ^^^^^^^ .. java:field:: protected Poisson poisson :outertype: AbstractEmitter Poisson RNG for flickering simulation. positionLogger ^^^^^^^^^^^^^^ .. java:field:: protected final PositionLogger positionLogger :outertype: AbstractEmitter A copy of the position logger. psf ^^^ .. java:field:: protected PSF psf :outertype: AbstractEmitter The PSF model that's created by the emitter. stateLogger ^^^^^^^^^^^ .. java:field:: protected final StateLogger stateLogger :outertype: AbstractEmitter A copy of the state logger. z ^ .. java:field:: public double z :outertype: AbstractEmitter The emitter's z-position. Constructors ------------ AbstractEmitter ^^^^^^^^^^^^^^^ .. java:constructor:: @Deprecated public AbstractEmitter(Camera camera, double x, double y) :outertype: AbstractEmitter Creates emitter at given position, and calculates its signature on the image (what does it look like when it is turned on). :param camera: camera properties (needed for PSF calculation) :param x: x-position in image [pixels, with sub-pixel precision] :param y: y-position in image [pixels, with sub-pixel precision] AbstractEmitter ^^^^^^^^^^^^^^^ .. java:constructor:: public AbstractEmitter(double x, double y, double z, PSFBuilder psfBuilder) :outertype: AbstractEmitter Creates the emitter at given position, and calculates its image from the PSF and camera. :param x: x-position in image [pixels, with sub-pixel precision] :param y: y-position in image [pixels, with sub-pixel precision] :param z: z-position in image [pixels, with sub-pixel precision] :param psfBuilder: Builder for creating the emitter's PSF. Methods ------- applyTo ^^^^^^^ .. java:method:: public void applyTo(float[][] pixels) :outertype: AbstractEmitter Simulates the brightness pattern of this emitter for the next frame duration, and renders the emitter onto the image. :param pixels: image to be drawn on flicker ^^^^^^^ .. java:method:: protected double flicker(double baseBrightness) :outertype: AbstractEmitter Applies Poisson statistics to simulate flickering of an emitter. :param baseBrightness: mean of Poisson distribution to draw from :return: actual brightness of this emitter for this frame generate_signature_for_pixel ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Deprecated protected double generate_signature_for_pixel(int x, int y, double camera_fwhm_digital) throws MathException :outertype: AbstractEmitter Returns the signature that this emitter leaves on a given pixel (what fraction of this emitter's photons hits this particular pixel). :param x: pixel x-position :param y: pixel y-position :param camera_fwhm_digital: camera fwhm value :throws MathException: :return: signature value for this pixel getId ^^^^^ .. java:method:: public int getId() :outertype: AbstractEmitter Returns the emitter's ID. :return: The unique integer identifying the emitter. getPSF ^^^^^^ .. java:method:: public PSF getPSF() :outertype: AbstractEmitter Returns the emitter's PSF model. :return: The PSF model used to create the image of this emitter. getPixelList ^^^^^^^^^^^^ .. java:method:: public ArrayList getPixelList() :outertype: AbstractEmitter Returns list of pixels which need to be drawn on the image to accurately render the emitter. :return: list of Pixels getPixelsWithinRadius ^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public static final ArrayList getPixelsWithinRadius(Point2D point, double radius) :outertype: AbstractEmitter 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. :param point: :param radius: radius value [pixels] :return: list of Pixels with pre-calculated signatures get_pixels_within_radius ^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: @Deprecated protected final ArrayList get_pixels_within_radius(double radius, double camera_fwhm_digital) :outertype: AbstractEmitter 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. :param radius: radius value [pixels] :param camera_fwhm_digital: camera fwhm value :return: list of Pixels with precalculated signatures setPSF ^^^^^^ .. java:method:: public void setPSF(PSF psf) :outertype: AbstractEmitter Change the emitter's PSF model. :param psf: The PSF model used to create the image of this emitter. simulateBrightness ^^^^^^^^^^^^^^^^^^ .. java:method:: protected abstract double simulateBrightness() :outertype: AbstractEmitter Simulates the state evolution of the emitter for the next frame, and returns the integrated brightness of this emitter for this frame. :return: brightness of emitter in this frame [photons emitted]