DefaultFluorophore

public class DefaultFluorophore extends AbstractEmitter implements Fluorophore

A general fluorescent molecule which emits light. This class directly implements the methods of Observables, rather than extending AbstractObservable, because Java does not support multiple inheritance.

Author:Marcel Stefko, Kyle M. Douglass

Constructors

DefaultFluorophore

public DefaultFluorophore(PSFBuilder psfBuilder, Illumination illumination, double signal, StateSystem state_system, int start_state, double x, double y, double z)

Initialize fluorophore and calculate its pattern on camera

Parameters:
  • psfBuilder – The Builder for calculating microscope PSFs.
  • illumination – The illumination profile on the sample.
  • signal – Number of photons per frame.
  • state_system – Internal state system for this fluorophore
  • start_state – Initial state number
  • x – x-position in pixels
  • y – y-position in pixels
  • z – z-position in pixels

Methods

addListener

public void addListener(Listener listener)

Adds a new listener to the list of subscribed listeners.

deleteListener

public void deleteListener(Listener listener)

Deletes a listener from the list of subscribed listeners.

getCurrentState

public int getCurrentState()

Returns the id of the fluorophore state system’s current state.

Returns:The id of the current state of the fluorophore’s state system.

getIlluminationListener

public Listener getIlluminationListener()

Returns the Listener that is attached to the illumination profile.

Returns:The illumination Listener.

getOnTimeThisFrame

public double getOnTimeThisFrame()

Returns the time spent in the emitting state during the previous frame. This time is the proportion of the frame’s duration; 1 corresponds to having spent the entirety of the frame in the emitting state.

Returns:The time spent in the emitting state.

getPhotonsThisFrame

public double getPhotonsThisFrame()

Returns the number of photons emitted during the previous frame.

Returns:The number of photons emitted during the previous frame.

getSignal

public double getSignal()

Returns the fluorophore’s number of photons per frame.

Returns:The number of photons per frame emitted by the fluorophore.

getX

public double getX()

Return the x-position of the fluorophore.

Returns:The fluorophore’s x-position.

getY

public double getY()

Return the y-position of the fluorophore.

Returns:The fluorophore’s y-position.

getZ

public double getZ()

Return the z-position of the fluorophore.

Returns:The fluorophore’s z-position.

isBleached

public boolean isBleached()

Informs if this emitter switched into the irreversible bleached state.

Returns:boolean, true if emitter is bleached

isOn

public boolean isOn()

Returns the current state of the emitter (on or off), but does not inform if this emitter is also bleached!

Returns:true-emitter is on, false-emitter is off

nextExponential

protected final double nextExponential(double mean)

Sample an random number from an exponential distribution

Parameters:
  • mean – mean of the distribution
Returns:

random number from this distribution

notifyListeners

public void notifyListeners()

Notifies all subscribed listeners to a change in the Observable’s state. This method should only be called if setChanged() has been called.

notifyListeners

public void notifyListeners(Object data)

Notifies all subscribed listeners of a state change and pushes the data.

Parameters:
  • data – The data object to push to the listeners.

recalculateLifetimes

public void recalculateLifetimes(double laserPower)

Recalculates the lifetimes of this emitter based on current laser power.

Parameters:
  • laserPower – current laser power

setChanged

public void setChanged()

Indicates that the state of this Observable has been changed.

simulateBrightness

protected double simulateBrightness()

toJson

public JsonElement toJson()

Returns the fluorophore’s properties as a JSON string.

Returns:The properties of the fluorophore as a JSON string.