Basic Operation

Controlling the DAQ FPGA

Primary EDAQ functionality (e.g. data capture, image processing, streaming to host) is provided by the FPGA processor. As such, interactions like controlling imaging modes and changing user-configurable settings are accomplished via writing 16-bit hexadecimal codes or values to a series of FPGA registers. Likewise, querying FPGA status is accomplished via reading values from these FPGA registers. Although the user has access to all FGPA registers, only those which provide user-accessible functionality are documented in this reference manual. Most FPGA registers in the full register map are reserved for Axsun internal purposes.

User read/write access to individual FPGA registers is provided via low-level methods in AxsunOCTControl when connected using Ethernet or USB 2.0, and/or via methods in AxsunOCTCapture when connected via PCIe. These same low-level read/write methods are exposed as GUI buttons in OCT Host and the Hardware Control Tool (Ethernet or USB 2.0 only), and the Image Capture Tool (PCIe only).

The Hardware Control Tool provides convienient access to many higher-level DAQ functions by obscuring multiple consecutive FPGA register accesses behind more user-friendly GUI buttons.

Interaction with the AxsunOCTCapture Library

It is helpful to understand the core image acquisition functionality provided by the AxsunOCTCapture library, even when interacting only with the Image Capture Tool GUI and not directly integrating the Capture API.

Starting the Capture Session

The first step when using the AxsunOCTCapture library is starting a Capture session. A Capture session is automatically started when launching the Image Capture Tool and selecting either Ethernet or PCIe mode. Starting the Capture session achieves three primary outcomes:

  • The desired hardware interface (Ethernet or PCIe) is opened for image data capture. If a hardware interface is not found or cannot be opened due to conflicts or missing dependencies, the session will support only review of previously captured images subsequently loaded from disk.

  • A circular Main Image Buffer is allocated in RAM to store captured images. The size of the Main Image Buffer is user-configurable and should be selected to provide the desired amount of storage needed for the expected recording time.

  • A thread is started which moves data into the Main Image Buffer when detected on the desired interface. This happens automatically in the background without subsequent user interaction (other than starting the data stream on the EDAQ hardware using the AxsunOCTControl API or related GUI Tool).

Requesting Images from the Main Image Buffer

Images streamed from the EDAQ are numbered in a monotonically increasing, consecutive fashion. The image sequence number is reset (to 1) only when the imaging sequence is stopped and restarted on the EDAQ or when Burst Record Mode is initiated (see below). Once image data has been captured and enqueued in the Main Image Buffer, the calling application can retrieve images arbitrarily (in a random-access fashion) using one of two approaches:

  • By an image’s unique sequence number. This assumes the image is in the Main Image Buffer and has not been overwritten by a newer image due to an undersized buffer. A loop at the application level can retrieve all images from the Main Image Buffer sequentially for comprehensive review, export, analysis, etc.

  • By requesting the most recently enqueued image. Often the image display rate is lower than the image acquisition rate. This approach allows a loop at the application level to display in a “live” fashion with the lowest possible display latency. The Main Image Buffer still contains all images for later retrieval via the first approach.

Stopping the Capture Session

The final step when using the AxsunOCTCapture library is deallocating host resources and freeing the interface by stopping the Capture session. This must be done prior to the parent application quitting; it is done automatically when quitting the Image Capture Tool.

Operational Modes

The two primary operational modes of the EDAQ are 1) Imaging-Off or "Idle" wherein no data capture or transmission is occurring, and 2) Imaging-On or "Live" wherein the DAQ is capturing, processing, and streaming image data to the host PC.

For many typical OCT workflows, these EDAQ modes have corresponding modes in the host software application and the Laser emission state as discussed in the notes below.

NOTE: The EDAQ Imaging-On or Imaging-Off modes usually correspond to an Emission-Enabled or Emission-Disabled state of the Laser. However, the EDAQ operational modes and the Laser emission state are controlled via unique API commands (or GUI buttons) which must be executed separately.

Enable the Laser emission prior to starting the EDAQ Imaging-On mode, and disable the Laser emission after transitioning the EDAQ to Idle mode. This insures that the Laser sweep trigger and K-clock are available for the EDAQ board during the sampling and digitization process.

Live Imaging

In Imaging-On or Live mode, images are streamed from the EDAQ to the host PC, received on the PC’s interface (Ethernet or PCIe) and then enqueued into the Main Image Buffer by the Capture library. Transmitted images are numbered sequentially starting with n = 1. The DAQ will persist in Live Imaging mode indefinitely until explicitly commanded to stop. Captured images are stored in the Main Image Buffer indefinitely and available for retrieval until overwritten by newer data in a circular buffer fashion, or explicitly cleared/deallocated.

The image width (in number of A-lines) is defined by the period of the Image_sync pulse provided to the EDAQ. The Image_sync pulse period, and therefore the width of each transmitted image, can change instantaneously over a large range from one image to the next. The Capture library accommodates this uncertainty with a restriction only on the minimum image size of 256 A-lines (a maximum image rate of ≈390 Hz for a 100 kHz laser).

NOTE: For many typical OCT workflows, Live Imaging mode on the EDAQ is concurrent with a live image display feature provided by GUI software for sample alignment, reference arm pathlength adjustment, scouting for regions of interest, or other pre-recording workflows in which low display latency is prioritized over access to a comprehensive data set.

Live Imaging (Force Trigger)

If an attempt is made to retrieve the most recently enqueued image but an Image_sync pulse has not been detected by the EDAQ within a user-configurable period (e.g. too slow or missing altogether), the Capture library will automatically transition into a sub-state of Live Imaging mode called Force Trigger mode. The data retrieved from the Main Image Buffer in this instance will be the most recent 256 A-line frame with no external synchronization. This is analogous to the behavior of an oscilloscope without a valid trigger input: it immediately updates the screen with the most recently acquired data in an asynchronous fashion.

Live Imaging (Burst Record)

The EDAQ provides a Burst Record functionality for workflows that need to gather a finite number of consecutive images following a single start command, such as the acquisition of a 3D volume scan. Burst Record is a sub-state of Live Imaging mode in which the EDAQ acquires a pre-configured number of images (N) and then automatically transitions to Idle following the Nth image. Images are transmitted with metadata indicating that they were acquired in Burst Record mode and are marked with unique and monotonically-increasing image numbers from 1 up to N for easy retrieval from the Main Image Buffer. The DAQ does not have on-board memory which can store image data for later transmission to the host PC; rather, all images – whether Burst Record or not – are stored in host RAM within the Main Image Buffer created and managed by the AxsunOCTCapture library. There must be N+1 valid Image_sync pulses detected by the EDAQ for the Burst Record operation to fully execute.

NOTE: For many typical OCT workflows, Burst Record mode on the DAQ starts and ends concurrently with a slow-axis galvo sweep, catheter pullback, or other atomic scanning operation in which a comprehensive “3D” image data set is captured with intent to be stored for subsequent user interaction, analysis, archival, etc.

Idle / Imaging-Off

While in Imaging-Off or Idle mode, no new image data is generated or transmitted from the DAQ and the contents of the Main Image Buffer remain unchanged (unless explicitly cleared/deallocated or overwritten by loading data from disk).

NOTE: For many typical OCT workflows, Imaging Off mode on the DAQ is concurrent with a replay feature provided by GUI software for reviewing, analyzing, or archiving previously acquired Burst Record sequences at display rates often much slower than acquisition rates and where comprehensive data access is prioritized over display latency.

Controlling the Operational Mode

The EDAQ operational mode (and associated Laser emission state) can be controlled using convenient buttons in the Axsun-provided GUI Tools or by low-level FPGA register configurations made via API methods called in a custom application. Note that the API and GUI Tool used depends on whether the EDAQ board is connected via Ethernet or PCIe interface.

Laser Emission Enable / Disable

Hardware Control Tool
AxsunOCTControl API
Image Capture Tool
AxsunOCTCapture API

These buttons toggle the Laser emission ON and OFF.

To enable Laser emission issue StartScan().

To disable Laser emission issue StopScan().

The Image Capture Tool cannot be used to control the Laser emission state.

The AxsunOCTCapture API cannot be used to control the Laser emission state.

EDAQ Live Imaging / Idle (Ethernet)

Hardware Control Tool
AxsunOCTControl API
Image Capture Tool
AxsunOCTCapture API

These buttons toggle the EDAQ between Imaging-On (LIVE) and Idle (OFF).

To enable Live Imaging set FPGA register 19 [bit 15] and set FPGA register 2 [bit 2]:

WriteDAQRegisterBit(19,15,1);
WriteDAQRegisterBit(2,2,1);

To disable Live Imaging (-> Idle) clear FPGA register 2 [bit 2] and clear FPGA register 19 [bit 15]:

WriteDAQRegisterBit(2,2,0);
WriteDAQRegisterBit(19,15,0);

The Image Capture Tool cannot be used to control the EDAQ imaging state when connected via Ethernet.

The AxsunOCTCapture API cannot be used to control the EDAQ imaging state when connected via Ethernet.

EDAQ Burst Record (Ethernet)

Hardware Control Tool
AxsunOCTControl API
Image Capture Tool
AxsunOCTCapture API

First set the desired number of images to acquire and then press RECORD.

First write the desired number of images to record into FPGA register 33, and then to start the Burst Record operation set FPGA register 31 [bit 0] :

SetFPGARegister(33,numOfImages);
WriteDAQRegisterBit(31,0,1);
// wait for all images to be transmitted

After the Burst Record operation has completed, the DAQ's internal image counter must be reset prior to returning to Live Imaging mode. Disable Burst Record by clearing FPGA register 31 [bit 0] and select Idle mode:

// after all images transmitted (or to abort a Burst Record in progress)
WriteDAQRegisterBit(31,0,0);
WriteDAQRegisterBit(2,2,0);
WriteDAQRegisterBit(19,15,0);

The Image Capture Tool cannot be used to control the EDAQ recording state when connected via Ethernet.

The AxsunOCTCapture API cannot be used to control the EDAQ recording state when connected via Ethernet.

EDAQ Live Imaging / Idle (PCIe)

Hardware Control Tool
AxsunOCTControl API
Image Capture Tool
AxsunOCTCapture API

The Hardware Control Tool cannot be used to control the EDAQ imaging state when connected via PCIe.

The AxsunOCTControl API cannot be used to control the EDAQ imaging state when connected via PCIe.

These buttons toggle the EDAQ between Imaging-On (LIVE) and Idle (OFF).

To enable Live Imaging issue axImagingCntrlPCIe(-1).

To disable Live Imaging (-> Idle) issue axImagingCntrlPCIe(0).

EDAQ Burst Record (PCIe)

Hardware Control Tool
AxsunOCTControl API
Image Capture Tool
AxsunOCTCapture API

The Hardware Control Tool cannot be used to control the EDAQ recording state when connected via PCIe.

The AxsunOCTControl API cannot be used to control the EDAQ recording state when connected via PCIe.

First set the desired number of images to acquire and then press RECORD.

To start the Burst Record operation for a desired number of images issue axImagingCntrlPCIe(numOfImages).