| Customize Help

Steps to performing a sequence operation

The following steps provide a basic methodology for using the MIL Sequences module:

  1. Allocate a sequence context using MseqAlloc(). The sequence context is required to indicate the sequence operation that the Sequences module should perform and to hold the sequence operation settings. When allocating the context, choose the required sequence operation, and select the underlying hardware or software that the operation should use.

  2. Define the source of each input and the destination(s) of each output of your sequence operation, using MseqDefine(); each output can have multiple destinations. By default, the source of an input is set to M_USER_FEED; in which case, MIL expects the images to be passed individually (manual image feed). By default, the destination of an output is set to M_USER_HOOK; in which case, MIL assumes that you will retrieve the images individually from the processing operation's internal output buffer, using a hook function.

  3. If the destination of an output is a hook-based retrieval, hook a function to the event that occurs when a frame has finished being processed, using MseqHookFunction().

  4. Specify the processing operation settings and any additional settings for your sources and destinations, using MseqControl().

  5. Start the sequence processing session, using MseqProcess() with M_START. You must also specify whether the session will run synchronously or asynchronously. If you specify M_SYNCHRONOUS, your application will wait until the sequence operation has finished before executing the next function; this option is not available if the source of an input is a manual image feed. If you specify M_ASYNCHRONOUS, other functions can execute while the sequence operation is performed in a background thread.

  6. If the source of an input is a manual image feed, feed each image to the sequence processing operation, using MseqFeed().

  7. Stop the sequence processing session, using MseqProcess() with M_STOP specifying M_WAIT. The sequence processing session will finish performing the specified operation before stopping.

  8. Free your sequence context, using MseqFree().