Simulator

public interface Simulator

The interface that defines everything that a Simulator should do.

Author:Marcel Stefko, Kyle M. Douglass

Methods

getCameraJsonName

public String getCameraJsonName()

Returns the name of the JSON key for the camera info.

Returns:The name of the key indicating the camera information.

See also: .toJsonState()

getControlSignal

public double getControlSignal()

Returns currently set control signal of the generator (e.g. laser power settings).

Returns:control signal value

getCustomParameters

public HashMap<String, Double> getCustomParameters()

Returns custom parameters of the generator.

Returns:map of custom parameters

getFOVSize

public double getFOVSize()

Returns the size of the field-of-view in object space units.

Returns:size of current FOV in object space units.

getFluorescenceJsonName

public String getFluorescenceJsonName()

Returns the name of the JSON key for the fluorescence state info.

Returns:The name of the key indicating the fluorescence information.

See also: .toJsonState()

getId

public int getId()

Returns the unique ID assigned to this simulator.

Returns:The integer ID of this simulator.

getImageCount

public int getImageCount()

Returns the number of images simulated. Because the simulation can advance without generating an image, this value will be less than or equal to the number of simulation time steps. Use incrementTimeStep() to advance the simulation one time step without generating an image.

Returns:The number of images that have been simulated.

getLaserJsonName

public String getLaserJsonName()

Returns the name of the JSON key for the laser state info.

Returns:The name of the key indicating the laser information.

See also: .toJsonState()

getMessages

public List<Message> getMessages()

Returns messages about changes in the simulation state. Unlike getSimulationState(), which returns information about the current state of the simulation, this method returns the messages from individual components that contain information about changes in their state that have occurred since the last time this method was called.

Returns:A list containing the state change messages.

getMicroscope

public Microscope getMicroscope()

Returns a copy of the Microscope that is controlled by this simulation. The copy that is returned is a deep copy of the Microscope that the simulation was initialized with.

Returns:A copy of the Microscope object controlled by this simulation.

getNextImage

public ImageS getNextImage()

Generates a new image and adds it to the internal stack.

Returns:newly generated image

getObjectSpacePixelSize

public double getObjectSpacePixelSize()

Returns the size of a pixel in object space units. The units of this quantity are determined by those of the camera’s pixels. The value is the magnitude of the camera’s pixel size divided by the objective’s magnification.

Returns:length of one pixel side in object space units.

getObjectiveJsonName

public String getObjectiveJsonName()

Returns the name of the JSON key for the objective state info.

Returns:The name of the key indicating the objective information.

See also: .toJsonState()

getShortTrueSignalDescription

public String getShortTrueSignalDescription()

Returns a brief description of the ground truth signal.

Returns:A short description of the truth signal, typically its units.

getStack

public ImageS getStack()

Returns internal stack with all generated images.

Returns:internal stack

getStageJsonName

public String getStageJsonName()

Returns the name of the JSON key for the stage state info.

Returns:The name of the key indicating the stage information.

See also: .toJsonState()

getTrueSignal

public double getTrueSignal(int image_no)

Returns the actual value of signal (if applicable) for given image.

Parameters:
  • image_no – 1-based image number in history
Returns:

value of signal (e.g. no. of active emitters)

incrementTimeStep

public void incrementTimeStep()

Increments the simulation by one time step without creating an image.

saveMessages

public void saveMessages(File file)

Saves the messages in the cache to a select file.

Parameters:
  • file – The file to save to.

saveStack

public void saveStack(File file)

Saves the .tif image stack to a select file.

Parameters:
  • file – file to save to

saveState

public void saveState(File file)

Saves the current state of the simulation.

Parameters:
  • file – The file to save to.

setControlSignal

public void setControlSignal(double value)

Sets control signal of the generator (e.g. laser power). This should be used by the controller.

Parameters:
  • value – new value of the control signal

setCustomParameters

public void setCustomParameters(HashMap<String, Double> map)

Sets custom parameters of the generator.

Parameters:
  • map – map of custom parameters

toJsonMessages

public JsonElement toJsonMessages()

Returns messages about changes in the simulation state as a JSON object. Unlike toJsonState(), which returns information about the current state of the simulation, this method returns the messages from individual simulation components that contain information about changes in their state that have occurred since the last time this method was called.

Returns:A JSON object containing the simulation messages.

toJsonState

public JsonElement toJsonState()

Returns information on the simulation’s current state as a JSON object. Unlike toJsonMessages(), which returns information about previous changes in the simulation’s state, this method reports on the current state of the simulation.

Returns:A JSON object containing information on the simulation state.