All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.micromanager.acqj.example.BlackHoleDataSink Maven / Gradle / Ivy

There is a newer version: 0.38.1
Show newest version
package org.micromanager.acqj.example;

import mmcorej.TaggedImage;
import mmcorej.org.json.JSONObject;
import org.micromanager.acqj.api.DataSink;
import org.micromanager.acqj.main.Acquisition;

/**
 * This is a minimal implementation of a DataSink meant for demonstration purposes only. This
 * DataSink acts as a black hole, immediately discarding every image it recieves forever.
 * In practice, DataSinks should instead do something useful (e.g. save and display)
 * with the images they receive
 */
public class BlackHoleDataSink implements DataSink {

   boolean finished_ = false;
   boolean somethingAcquired_ = false;

   @Override
   public void initialize(Acquisition acq, JSONObject summaryMetadata) {

   }

   @Override
   public void finish() {
      finished_ = true;
   }

   @Override
   public boolean isFinished() {
      return finished_;
   }

   @Override
   public void putImage(TaggedImage image) {
      somethingAcquired_ = true;
      System.out.println("throwing away an image forever");
   }

   @Override
   public boolean anythingAcquired() {
      return somethingAcquired_;
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy