.. java:import:: ch.epfl.leb.sass.logging Message .. java:import:: ch.epfl.leb.sass.models Microscope .. java:import:: ch.epfl.leb.sass.utils.images ImageS .. java:import:: ch.epfl.leb.sass.utils.images ImageShapeException .. java:import:: com.google.gson JsonElement .. java:import:: java.io File .. java:import:: java.util List .. java:import:: java.util HashMap Simulator ========= .. java:package:: ch.epfl.leb.sass.simulator :noindex: .. java:type:: public interface Simulator The interface that defines everything that a Simulator should do. :author: Marcel Stefko, Kyle M. Douglass Methods ------- getCameraJsonName ^^^^^^^^^^^^^^^^^ .. java:method:: public String getCameraJsonName() :outertype: Simulator Returns the name of the JSON key for the camera info. :return: The name of the key indicating the camera information. **See also:** :java:ref:`.toJsonState()` getControlSignal ^^^^^^^^^^^^^^^^ .. java:method:: public double getControlSignal() :outertype: Simulator Returns currently set control signal of the generator (e.g. laser power settings). :return: control signal value getCustomParameters ^^^^^^^^^^^^^^^^^^^ .. java:method:: public HashMap getCustomParameters() :outertype: Simulator Returns custom parameters of the generator. :return: map of custom parameters getFOVSize ^^^^^^^^^^ .. java:method:: public double getFOVSize() :outertype: Simulator Returns the size of the field-of-view in object space units. :return: size of current FOV in object space units. getFluorescenceJsonName ^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public String getFluorescenceJsonName() :outertype: Simulator Returns the name of the JSON key for the fluorescence state info. :return: The name of the key indicating the fluorescence information. **See also:** :java:ref:`.toJsonState()` getId ^^^^^ .. java:method:: public int getId() :outertype: Simulator Returns the unique ID assigned to this simulator. :return: The integer ID of this simulator. getImageCount ^^^^^^^^^^^^^ .. java:method:: public int getImageCount() :outertype: Simulator 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 \ :java:ref:`incrementTimeStep()`\ to advance the simulation one time step without generating an image. :return: The number of images that have been simulated. getLaserJsonName ^^^^^^^^^^^^^^^^ .. java:method:: public String getLaserJsonName() :outertype: Simulator Returns the name of the JSON key for the laser state info. :return: The name of the key indicating the laser information. **See also:** :java:ref:`.toJsonState()` getMessages ^^^^^^^^^^^ .. java:method:: public List getMessages() :outertype: Simulator Returns messages about changes in the simulation state. Unlike \ :java:ref:`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. :return: A list containing the state change messages. getMicroscope ^^^^^^^^^^^^^ .. java:method:: public Microscope getMicroscope() :outertype: Simulator Returns a copy of the Microscope that is controlled by this simulation. The copy that is returned is a deep copy of the \ :java:ref:`Microscope `\ that the simulation was initialized with. :return: A copy of the Microscope object controlled by this simulation. getNextImage ^^^^^^^^^^^^ .. java:method:: public ImageS getNextImage() throws ImageShapeException :outertype: Simulator Generates a new image and adds it to the internal stack. :return: newly generated image getObjectSpacePixelSize ^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public double getObjectSpacePixelSize() :outertype: Simulator 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. :return: length of one pixel side in object space units. getObjectiveJsonName ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public String getObjectiveJsonName() :outertype: Simulator Returns the name of the JSON key for the objective state info. :return: The name of the key indicating the objective information. **See also:** :java:ref:`.toJsonState()` getShortTrueSignalDescription ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public String getShortTrueSignalDescription() :outertype: Simulator Returns a brief description of the ground truth signal. :return: A short description of the truth signal, typically its units. getStack ^^^^^^^^ .. java:method:: public ImageS getStack() :outertype: Simulator Returns internal stack with all generated images. :return: internal stack getStageJsonName ^^^^^^^^^^^^^^^^ .. java:method:: public String getStageJsonName() :outertype: Simulator Returns the name of the JSON key for the stage state info. :return: The name of the key indicating the stage information. **See also:** :java:ref:`.toJsonState()` getTrueSignal ^^^^^^^^^^^^^ .. java:method:: public double getTrueSignal(int image_no) :outertype: Simulator Returns the actual value of signal (if applicable) for given image. :param image_no: 1-based image number in history :return: value of signal (e.g. no. of active emitters) incrementTimeStep ^^^^^^^^^^^^^^^^^ .. java:method:: public void incrementTimeStep() :outertype: Simulator Increments the simulation by one time step without creating an image. saveMessages ^^^^^^^^^^^^ .. java:method:: public void saveMessages(File file) :outertype: Simulator Saves the messages in the cache to a select file. :param file: The file to save to. saveStack ^^^^^^^^^ .. java:method:: public void saveStack(File file) :outertype: Simulator Saves the .tif image stack to a select file. :param file: file to save to saveState ^^^^^^^^^ .. java:method:: public void saveState(File file) :outertype: Simulator Saves the current state of the simulation. :param file: The file to save to. setControlSignal ^^^^^^^^^^^^^^^^ .. java:method:: public void setControlSignal(double value) :outertype: Simulator Sets control signal of the generator (e.g. laser power). This should be used by the controller. :param value: new value of the control signal setCustomParameters ^^^^^^^^^^^^^^^^^^^ .. java:method:: public void setCustomParameters(HashMap map) :outertype: Simulator Sets custom parameters of the generator. :param map: map of custom parameters toJsonMessages ^^^^^^^^^^^^^^ .. java:method:: public JsonElement toJsonMessages() :outertype: Simulator Returns messages about changes in the simulation state as a JSON object. Unlike \ :java:ref:`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. :return: A JSON object containing the simulation messages. toJsonState ^^^^^^^^^^^ .. java:method:: public JsonElement toJsonState() :outertype: Simulator Returns information on the simulation's current state as a JSON object. Unlike \ :java:ref:`toJsonMessages() `\ , which returns information about previous changes in the simulation's state, this method reports on the current state of the simulation. :return: A JSON object containing information on the simulation state.