.. java:import:: ch.epfl.leb.alica.interfaces Analyzer .. java:import:: ch.epfl.leb.alica.interfaces Controller .. 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:: java.io File .. java:import:: java.io FileNotFoundException .. java:import:: java.io PrintWriter .. java:import:: java.util HashMap .. java:import:: java.util.logging Level .. java:import:: java.util.logging Logger .. java:import:: org.json JSONException .. java:import:: org.json JSONObject ImageJSimulator =============== .. java:package:: ch.epfl.leb.sass.simulator.internal :noindex: .. java:type:: public class ImageJSimulator extends DefaultSimulator The default simulator that is run as, for example, the ImageJ plugin. :author: Marcel Stefko Fields ------ TIMEPERFRAME ^^^^^^^^^^^^ .. java:field:: protected final long TIMEPERFRAME :outertype: ImageJSimulator The time duration of each frame. This is here only for compatibility with ALICA's analyzers, which require a time argument. analyzer ^^^^^^^^ .. java:field:: protected final Analyzer analyzer :outertype: ImageJSimulator Analyzer which analyzes generated images controller ^^^^^^^^^^ .. java:field:: protected final Controller controller :outertype: ImageJSimulator Takes the output of a single analyzer, processes it, and outputs a signal to the generator, for feedback loop control. history ^^^^^^^ .. java:field:: protected HashMap history :outertype: ImageJSimulator Records of values of output of analyzer, controller. image_count ^^^^^^^^^^^ .. java:field:: protected int image_count :outertype: ImageJSimulator Number of already-generated images. Constructors ------------ ImageJSimulator ^^^^^^^^^^^^^^^ .. java:constructor:: public ImageJSimulator(Microscope microscope, Analyzer analyzer, Controller controller) :outertype: ImageJSimulator Initialize the simulator from user-specified components. :param microscope: The microscope to be simulated. :param analyzer: An analyzer for processing images from the microscope. :param controller: A controller that adjusts the state of the microscope. Methods ------- execute ^^^^^^^ .. java:method:: public ImageS execute(int no_of_images, int controller_refresh_rate, String csv_save_path, String tiff_save_path) throws ImageShapeException :outertype: ImageJSimulator An example simulation :param no_of_images: :param controller_refresh_rate: :param csv_save_path: :param tiff_save_path: getImageCount ^^^^^^^^^^^^^ .. java:method:: @Override public int getImageCount() :outertype: ImageJSimulator Returns the number of generated images since simulation start. :return: number of generated images incrementCounter ^^^^^^^^^^^^^^^^ .. java:method:: public void incrementCounter() :outertype: ImageJSimulator Increments image counter in case an image was generated outside of this class. saveStack ^^^^^^^^^ .. java:method:: public void saveStack(File tiff_file) :outertype: ImageJSimulator Save current ImageStack to TIFF file :param tiff_file: file to save to saveToCsv ^^^^^^^^^ .. java:method:: public void saveToCsv(File file) :outertype: ImageJSimulator Saves the data for generator, analyzer and controller for each frame into a .csv file :param file: destination csv file