Giter Site home page Giter Site logo

acqengj's Introduction

AcqEngJ

Java-based acquisition engine for Micro-manager. Used by Micro-Magellan, Pycro-Manager, LightSheetManager, and (optionally) Micro-Manager. An acquisition engine takes instructions in and controls hardware via the Micro-Manager core, sending the acquired images to a user-provided destination. The engine handles handles the threading to avoid hardware errors and ensure fast performance.

The example folder describes how to use it in more detail. The Pycro-Manager documentation also provides a lot of information about key concepts in more detail

Usage example (from FullExample.java)

// Create a DataSink where images will be sent
DataSink dataSink = new BlackHoleDataSink();

// Create the acquisition
AcquisitionAPI acquisition = new Acquisition(dataSink);

// Create an acquisition hook, which will be run on the same thread that controls
// hardware
acquisition.addHook(new WorthlessAcquisitionHook(), AcquisitionAPI.AFTER_HARDWARE_HOOK);

// Create an image processor, which will run on its own thread
acquisition.addImageProcessor(new WorthlessImageProcessor());

// Must call this after adding hook(s) and processor(s)
acquisition.start()

// Now that everything is setup, AcquistionEvents can be added in order to
// start acquiring data.
// Each AcquisitionEvent will order the collection of one image per camera
// Acquisitions accept lazy sequences of AcquisitionEvents, in for form of
// an Iterator<AcquisitionEvent>.
// below is an example of using a convenience function AcqEventModules to order the
// collection a 5 image timelapse with 0 interval between images.
Iterator<AcquisitionEvent> lazySequence = AcqEventModules.timelapse(
      5, 0).apply(new AcquisitionEvent(acquisition));

// Make sure that all desired hooks and image processors have been added by this point,
// or else they may miss the Events/images
Future result = acquisition.submitEventIterator(lazySequence);

//Submitting an event iterator returns a Future. Since the actual acquisition occurs on a
// different thread, submitEventIterotor will return immediately. The future can be used
// to check on the progress of the events:

// Calling get will block until the events are acquired, or throw an exceoption if something
// went wrong
try {
   result.get();
} catch (Exception e) {
   // Something went wrong when acquiring the data
}

// Cancel the execution of the previously submitted events
result.cancel(true);

// submitEventIterator can be called again, if desired


// once no more events will be submitted, signal the acquisition to shutdown.
// This will automatically handle the orderly shutdown of all DataSinks/Hooks/Image processors
acquisition.finish();

// Block until everythin cleaned up
acquisition.waitForCompletion();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.