AxsunOCTCapture 3.8.2
Captures and buffers streamed imaged data from the Axsun Ethernet/PCIe DAQ and displays or retrieves images to a client application on request.
Data Structures | Macros | Typedefs | Enumerations | Functions
AxsunOCTCapture.h File Reference

This header file contains all exported function prototypes, structures, and enums necessary for integrating AxsunOCTCapture into a client application. More...

#include "AxsunCommonEnums.h"

Go to the source code of this file.

Data Structures

struct  scan_params_t
 Structure for passing raster scan pattern parameters to axScanCmd(SET_RECT_PATTERN, ...). More...
 
struct  ext_pattern_t
 Structure for passing a user-generated scan pattern to axScanCmd(LOAD_EXT_PATTERN, ...). More...
 
struct  request_prefs_t
 Structure for image request preferences. More...
 
struct  export_prefs_t
 Structure for image export preferences (movie functionality requires installation of OpenCV). More...
 
struct  axpacket_t
 Structure for packet metadata (for internal use.) More...
 
struct  image_info_t
 Structure for conveying metadata information about an image. More...
 
struct  new_image_callback_data_t
 Structure for data made available to user in a new image callback event via registered AxNewImageCallbackFunction_t. More...
 
struct  span_t
 A construct similar in functionality to std::span (non-owning memory address with size). More...
 

Macros

#define MOST_RECENT_IMAGE   0
 

Typedefs

typedef struct CaptureSession * AOChandle
 Axsun OCT Capture handle - a pointer to the opaque structure used to manage created capture sessions.
 
typedef enum AxDimension AxDimension
 Dimension for sectioning data cube with axRequestCutPlane().
 
typedef enum AxColormap AxColormap
 Available colormaps to select using axSelectColormap().
 
typedef enum AxFileType AxFileType
 Available file types to export using axExportImages() and axExportImagesAdv().
 
typedef enum AxRequestMode AxRequestMode
 Available request modes to define behavior of axRequestImageAdv().
 
typedef enum AxDAQEvent AxDAQEvent
 Types of transitions in DAQ's operational mode, conveyed via user callback function. See axRegisterDAQCallback() for usage.
 
typedef enum AxInterface AxInterface
 Available capture interfaces to be selected by axSelectInterface().
 
typedef enum AxWindowLinkage AxWindowLinkage
 Available linkage behaviors for OpenGL display windows to be selected by axLinkWindows(). See https://docs.microsoft.com for more information on Windows OS window relationship concepts like Parent-Child and Ownership.
 
typedef enum AxScannerCommand AxScannerCommand
 Available scanner command types to be executed by axScanCmd().
 
typedef struct scan_params_t scan_params_t
 Structure for passing raster scan pattern parameters to axScanCmd(SET_RECT_PATTERN, ...).
 
typedef struct ext_pattern_t ext_pattern_t
 Structure for passing a user-generated scan pattern to axScanCmd(LOAD_EXT_PATTERN, ...).
 
typedef struct request_prefs_t request_prefs_t
 Structure for image request preferences.
 
typedef struct export_prefs_t export_prefs_t
 Structure for image export preferences (movie functionality requires installation of OpenCV).
 
typedef struct axpacket_t axpacket_t
 Structure for packet metadata (for internal use.)
 
typedef struct image_info_t image_info_t
 Structure for conveying metadata information about an image.
 
typedef struct new_image_callback_data_t new_image_callback_data_t
 Structure for data made available to user in a new image callback event via registered AxNewImageCallbackFunction_t.
 
typedef struct span_t span_t
 A construct similar in functionality to std::span (non-owning memory address with size).
 
typedef void(__cdecl * AxNewImageCallbackFunction_t) (new_image_callback_data_t, void *)
 A user-provided function to be called when a new image is enqueued in the Main Image Buffer. See axRegisterNewImageCallback() for usage.
 
typedef void(__cdecl * AxConnectScannerCallbackFunction_t) (void *)
 A user-provided function to be called upon connection or disconnection of a NI-DAQmx device. See axRegisterScannerConnectCallback() for usage.
 
typedef void(__cdecl * AxCallbackFunction_t) (int32_t, void *)
 A generic user-provided callback function with a signed int and void* argument. See axRegisterExportCallback(), or axRegisterDAQCallback() for usage.
 

Enumerations

enum  AxDimension { XY , XZ , YZ }
 Dimension for sectioning data cube with axRequestCutPlane(). More...
 
enum  AxColormap { SEPIA , GREYSCALE , INV_GREYSCALE , USER_COLORMAP }
 Available colormaps to select using axSelectColormap().
 
enum  AxFileType {
  BINARY , JPEG , BMP , PNG ,
  RAW3D , FILETYPE_RFU
}
 Available file types to export using axExportImages() and axExportImagesAdv(). More...
 
enum  AxRequestMode { RETRIEVE_TO_CALLER , DISPLAY_ONLY , RETRIEVE_AND_DISPLAY , REQUESTMODE_RFU }
 Available request modes to define behavior of axRequestImageAdv(). More...
 
enum  AxDAQEvent {
  IMAGING_STOP = 0 , IMAGING_START = 1 , RECORD_DONE = 2 , RECORD_START = 3 ,
  CALIBRATION_DONE = 4 , CALIBRATION_START = 5 , LOAD_DONE = 6 , LOAD_START = 7 ,
  EXPORT_DONE = 8 , EXPORT_START = 9 , EXPORT_CANCELED_BY_USER = 10 , EXPORT_CANCELED_BY_ERROR = 11
}
 Types of transitions in DAQ's operational mode, conveyed via user callback function. See axRegisterDAQCallback() for usage. More...
 
enum  AxInterface { GIGABIT_ETHERNET , PCI_EXPRESS , NO_INTERFACE , INTERFACE_RFU }
 Available capture interfaces to be selected by axSelectInterface(). More...
 
enum  AxWindowLinkage { NO_LINKAGE = 0 , PARENT_CHILD = 1 , OWNER_OWNED = 2 }
 Available linkage behaviors for OpenGL display windows to be selected by axLinkWindows(). See https://docs.microsoft.com for more information on Windows OS window relationship concepts like Parent-Child and Ownership. More...
 
enum  AxScannerCommand {
  INIT_SCAN , DESTROY_SCAN , SET_RECT_PATTERN , LOAD_EXT_PATTERN ,
  CONTINUOUS_LINE_SCAN , CONTINUOUS_RASTER_SCAN , STOP_AT_POSITION , SETUP_BURST_RASTER ,
  START_BURST_RASTER , WAIT_BURST , SET_SAMPLE_CLOCK , GET_DEVICE_SERIALNO ,
  SELECT_DEVICE , COUNT_DEVICES , SET_MAX_VOLTAGE , SET_DIGITAL_OUTPUT ,
  SET_SQUAREWAVE_OUTPUT , SET_XSINE_YRAMP_PATTERN , SET_AUX_DC_ANALOG_OUTPUT , SET_AUX_DC_ANALOG_MAX ,
  SET_AUX_DC_ANALOG_MIN , GET_DEVICE_MODEL_NUMBER , SET_XSINE_YSINE_PATTERN
}
 Available scanner command types to be executed by axScanCmd(). More...
 

Functions

AxErr __cdecl axStartSession (AOChandle *session, float capacity_MB)
 Start an Axsun DAQ imaging session by allocating memory for the Main Image Buffer. More...
 
AxErr __cdecl axSelectInterface (AOChandle session, AxInterface which_interface)
 Select the data interface (Ethernet, PCIe, or none) for the capture session. More...
 
AxErr __cdecl axGetSelectedInterface (AOChandle session, AxInterface *selected_interface)
 Queries the currently selected data interface (Ethernet, PCIe, or none) for the capture session. More...
 
AxErr __cdecl axStopSession (AOChandle session)
 Stop a capture session and deallocate all resources, including Main Image Buffer and interfaces. More...
 
void __cdecl axGetErrorString (AxErr errorcode, char *message_out)
 Get a description of a specific AxErr error code. More...
 
AxErr __cdecl axGetMessage (AOChandle session, char *message_out)
 Get a description of the capture session's interface status. More...
 
AxErr __cdecl axGetStatus (AOChandle session, uint32_t *imaging, uint32_t *last_packet_in, uint32_t *last_frame_in, uint32_t *last_image_in, uint32_t *dropped_packets, uint32_t *frames_since_sync)
 Get imaging mode status and Main Image Buffer statistics. More...
 
AxErr __cdecl axGetDataRate (AOChandle session, double *datarate_Mbps)
 Get data transfer rate on the active interface. More...
 
AxErr __cdecl axGetImageRate (AOChandle session, int32_t *images_per_second)
 Get the rate of new images being enqueued in the main image buffer. More...
 
AxErr __cdecl axGetImageInfo (AOChandle session, uint32_t requested_image, image_info_t *image_info)
 Get information on an image in the Main Image Buffer. More...
 
AxErr __cdecl axGetImageInfoAdv (AOChandle session, int64_t requested_image_number, uint32_t *returned_image_number, int32_t *height, int32_t *width, AxDataType *data_type_out, uint32_t *required_buffer_size, uint8_t *force_trig, uint8_t *trig_too_fast)
 Advanced function for getting information on an image in the Main Image Buffer. More...
 
AxErr __cdecl axRequestImage (AOChandle session, uint32_t requested_image, request_prefs_t prefs, uint32_t output_buf_len, uint8_t *image_data_out, image_info_t *image_info)
 Retrieve and/or display an image from the Main Image Buffer. More...
 
AxErr __cdecl axRequestImagePointer (AOChandle session, uint32_t requested_image, image_info_t *image_info, span_t *part1, span_t *part2)
 Retrieve a pointer to an image in the Main Image Buffer (non-compressed images only). More...
 
AxErr __cdecl axRequestImageAdv (AOChandle session, int64_t requested_image_number, uint8_t *image_data_out, axpacket_t *metadata_out, int32_t *height, int32_t *width, AxDataType *data_type_out, uint32_t output_buf_len, request_prefs_t prefs, uint8_t *force_trig, uint8_t *trig_too_fast)
 Advanced function for retrieving and/or displaying an image from the Main Image Buffer. More...
 
AxErr __cdecl axGetFrameInfoAdv (AOChandle session, int64_t requested_frame_number, uint32_t *returned_frame_number, int32_t *height, int32_t *width, AxDataType *data_type_out, uint32_t *required_buffer_size)
 Get information on a frame in the Main Image Buffer (A frame is 256 A-scans, unsynchronized with Image_sync signal). More...
 
AxErr __cdecl axRequestFrameAdv (AOChandle session, int64_t requested_frame_number, uint8_t *frame_data_out, axpacket_t *metadata_out, int32_t *height, int32_t *width, AxDataType *data_type_out, uint32_t output_buf_len)
 Retrieve a frame from the Main Image Buffer (A frame is 256 A-scans, unsynchronized with Image_sync signal). More...
 
AxErr __cdecl axGetCompressedJPEGInfo (AOChandle session, int64_t requested_frame_number, uint32_t *returned_frame_number, uint32_t *required_buffer_size)
 Get un-decompressed size information on a compressed JPEG frame in the Main Image Buffer (A frame is 256 A-scans, unsynchronized with Image_sync signal). More...
 
AxErr __cdecl axRequestCompressedJPEG (AOChandle session, int64_t requested_frame_number, uint8_t *JPEG_data_out, axpacket_t *metadata_out, uint32_t output_buf_len)
 Retrieve an un-decompressed JPEG frame from the Main Image Buffer (A frame is 256 A-scans, unsynchronized with Image_sync signal). More...
 
AxErr __cdecl axSetupDisplay (AOChandle session, uint8_t window_style, int32_t w_left, int32_t w_top, int32_t w_width, int32_t w_height, uintptr_t linked_window_handle)
 Setup an OpenGL display window for direct rendering of image data. (Windows OS only) More...
 
AxErr __cdecl axCountWindows (AOChandle session, int32_t *num_of_windows)
 Count the number of OpenGL display windows currently created. (Windows OS only) More...
 
AxErr __cdecl axUpdateWindowStyle (AOChandle session, int32_t which_window, uint8_t window_style)
 Change the OpenGL display window style. (Windows OS only) More...
 
AxErr __cdecl axLinkWindows (AOChandle session, int32_t which_window, AxWindowLinkage linkage, uintptr_t linked_handle)
 Change the linkage of the OpenGL display window to another window (i.e. parent or owner). (Windows OS only) More...
 
AxErr __cdecl axSelectInterpolation (AOChandle session, int32_t which_window, uint8_t interpolation)
 Change the OpenGL display interpolation mode. (Windows OS only) More...
 
AxErr __cdecl axDisplayImage (AOChandle session, int64_t requested_image_number, uint32_t *returned_image_number, int32_t *height, int32_t *width)
 Display an image from the Main Image Buffer directly to an OpenGL window (8-bit image data only). (Windows OS only) More...
 
AxErr __cdecl axSelectColormap (AOChandle session, int32_t which_window, AxColormap colors)
 Select the color scheme of images displayed in an OpenGL window. (Windows OS only) More...
 
AxErr __cdecl axLoadUserColormap (AOChandle session, int32_t which_window, uint8_t *user_colormap_in)
 Load a user-defined AxColormap for images displayed in an OpenGL window. (Windows OS only) More...
 
AxErr __cdecl axScanConvert (AOChandle session, int32_t which_window, uint8_t convert, float inner_radius, float outer_radius, float crop_inner, float crop_outer)
 Change the polar -> rectangular scan conversion behavior of images displayed in an OpenGL window. (Windows OS only) More...
 
AxErr __cdecl axUpdateView (AOChandle session, int32_t which_window, int32_t w_left, int32_t w_top, int32_t w_width, int32_t w_height)
 Change the OpenGL window size and position. (Windows OS only) More...
 
AxErr __cdecl axCropRect (AOChandle session, int32_t which_window, float crop_left, float crop_top, float crop_bottom, float crop_right)
 Change the rectangular cropping behavior of images displayed in an OpenGL window. (Windows OS only) More...
 
AxErr __cdecl axAdjustBrightnessContrast (AOChandle session, int32_t which_window, float brightness, float contrast)
 Change the brightness and contrast of images displayed in an OpenGL window. (Windows OS only) More...
 
AxErr __cdecl axHideWindow (AOChandle session, int32_t which_window, uint32_t state)
 Hide or unhide the OpenGL image display window. (Windows OS only) More...
 
AxErr __cdecl axSetTrigTimeout (AOChandle session, uint32_t framesUntilForceTrig)
 Control the behavior of Force Trigger mode. More...
 
AxErr __cdecl axSaveFile (AOChandle session, const char *path_file, uint8_t full_buffer, int32_t *packets_written)
 Save contents of Main Image Buffer to disk. More...
 
AxErr __cdecl axLoadFile (AOChandle session, const char *path_file, int32_t *packets_read)
 Load contents from file on disk into Main Image Buffer. More...
 
AxErr __cdecl axResizeBuffer (AOChandle session, float capacity_MB)
 Clears and resets the Main Image Buffer, optionally with a new buffer size. More...
 
AxErr __cdecl axImagingCntrlPCIe (AOChandle session, int16_t number_of_images)
 Control the image streaming behavior of the Axsun PCIe DAQ between Live Imaging, Burst Recording, and Imaging Off states. (Windows OS only) More...
 
const char *__cdecl axGetPCIeDriverVersion ()
 Get the version of the PCIe device driver & library which must be installed to use the PCIe interface. More...
 
AxErr __cdecl axWriteFPGAreg (AOChandle session, uint16_t regnum, uint16_t regval)
 Write a FPGA register on the Axsun DAQ via the PCIe interface. More...
 
AxErr __cdecl axWriteFPGAregBIT (AOChandle session, uint16_t regnum, uint8_t bitnum, uint8_t bitval)
 Write a single bit in an FPGA register on the Axsun DAQ via the PCIe interface. More...
 
AxErr __cdecl axWriteFPGAarray (AOChandle session, uint16_t regnum, uint16_t *regvals, int32_t number_of_words)
 Write multiple FPGA registers on the Axsun DAQ via the PCIe interface. More...
 
AxErr __cdecl axPipelineMode (AOChandle session, AxPipelineMode mode, AxChannelMode channels)
 Configures FPGA registers to output the desired data type & location from the processing pipeline via the PCIe interface. More...
 
AxErr __cdecl axReadFPGAreg (AOChandle session, uint16_t regnum, uint16_t *regval)
 Read a FPGA register on the Axsun DAQ via the PCIe interface. More...
 
AxErr __cdecl axExportImages (AOChandle session, const char *path_directory, int32_t *images_exported, AxFileType file_type)
 Export images from the Main Image Buffer into individual binary or graphics files. More...
 
AxErr __cdecl axExportImagesAdv (AOChandle session, const char *path_directory, int32_t *images_exported, AxFileType file_type, uint32_t start_image, uint32_t end_image, request_prefs_t request_prefs, export_prefs_t export_prefs)
 Export images from the Main Image Buffer into individual graphics and movie files, with dimensional (cropping and scaling), intensity (brightness and contrast), and colormap adjustments. More...
 
AxErr __cdecl axExportImagesAsync (AOChandle session, const char *path_directory, AxFileType file_type, uint32_t start_image, uint32_t end_image, request_prefs_t request_prefs, export_prefs_t export_prefs)
 Asynchronously (as a background task) export images from the Main Image Buffer into individual graphics and movie files, with dimensional (cropping and scaling), intensity (brightness and contrast), and colormap adjustments. More...
 
AxErr __cdecl axCancelExport (AOChandle session)
 Cancel background image exporting started by axExportImagesAsync() More...
 
AxErr __cdecl axScanCmd (AxScannerCommand scan_command, double misc_scalar, const scan_params_t *scan_parameters, ext_pattern_t *external_scan_pattern, void *RFU)
 Control analog output waveform generation for 2 channel (X-Y) scanners. (Windows OS only) More...
 
AxErr __cdecl axRegisterScannerConnectCallback (AxConnectScannerCallbackFunction_t callback_function, void *userData)
 Registers a callback function to be executed following a scanner (DAQmx) device connection or disconnection event. (Windows OS only) More...
 
AxErr __cdecl axRegisterDAQCallback (AOChandle session, AxCallbackFunction_t callback_function, void *user_data)
 Registers a callback function to be executed upon a change in the DAQ imaging state (e.g. transition to live, record, idle). More...
 
AxErr __cdecl axReportImagingState (AOChandle session)
 Programmatically executes the pre-registered callback function to indicate the current DAQ imaging state. More...
 
AxErr __cdecl axRegisterExportCallback (AOChandle session, AxCallbackFunction_t callback_function, void *user_data)
 Registers a callback function to be executed each time an image is exported using axExportImages(), axExportImagesAdv(), or axExportImagesAsync(). More...
 
AxErr __cdecl axRegisterNewImageCallback (AOChandle session, AxNewImageCallbackFunction_t callback_function, void *user_data)
 Registers a callback function to be executed each time a new image is enqueued in the Main Image Buffer, whether captured from DAQ hardware or loaded from disk. More...
 
int32_t __cdecl axGetLibBuildCfg (void)
 Get the build configuration of the library. More...
 
int32_t __cdecl axGetLibBuildDateTime (char *datetime_str)
 Get a string describing the time and date that the library was built. More...
 
void __cdecl axGetLibVersion (int32_t *major, int32_t *minor, int32_t *patch, int32_t *build, char *version_str)
 Get the library version. More...
 

Detailed Description

This header file contains all exported function prototypes, structures, and enums necessary for integrating AxsunOCTCapture into a client application.

Please note that SIGNIFICANT API CHANGES have been made in this version 3.x relative to previous 2.x versions of the library:

General Functionality:

DAQmx Scanner Control Functionality:

OpenGL Display Functionality:

DETAILED RELEASE NOTES

Version 3.0.0.0

Version 3.1.0.0

Version 3.2.0.0

Version 3.3.0.0

Version 3.3.1.0

Version 3.4.0.0

Version 3.4.1.0

Version 3.4.2.0

Version 3.4.3.0

Version 3.4.4.0

Version 3.4.5.0

Version 3.5.0.0

Version 3.5.1.0

Version 3.5.2.0

Version 3.5.3.0

Version 3.5.4.0

Version 3.6.0.0

Version 3.6.1.0

Version 3.6.2.0

Version 3.6.3.0

Version 3.6.4.0

Version 3.6.5.0

Version 3.7.0.0

Version 3.8.0.0

Version 3.8.1.0

Enumeration Type Documentation

◆ AxDAQEvent

enum AxDAQEvent

Types of transitions in DAQ's operational mode, conveyed via user callback function. See axRegisterDAQCallback() for usage.

Enumerator
IMAGING_STOP 

Image data stopped being enqueued into the main image buffer.

IMAGING_START 

Image data started being enqueued into the main image buffer (via DAQ Live, DAQ Record, or via loading from disk).

RECORD_DONE 

Image data stopped being enqueued into the main image buffer following Burst Record mode.

RECORD_START 

Image data started to be enqueued via Burst Record mode.

CALIBRATION_DONE 

DAQ completed calibration routine.

CALIBRATION_START 

DAQ started calibration routine.

LOAD_DONE 

Image data stopped being enqueued into the main image buffer following loading from disk.

LOAD_START 

Image data started to be enqueued via loading from disk.

EXPORT_DONE 

Export operation completed.

EXPORT_START 

Export operation started.

EXPORT_CANCELED_BY_USER 

Export operation cancelled by user.

EXPORT_CANCELED_BY_ERROR 

Export operation cancelled due to error.

◆ AxDimension

Dimension for sectioning data cube with axRequestCutPlane().

Enumerator
XY 

Enface.

XZ 

Primary (fast) B-scan dimension.

YZ 

Secondary (slow) B-scan dimension.

◆ AxFileType

enum AxFileType

Available file types to export using axExportImages() and axExportImagesAdv().

Enumerator
BINARY 

Individual raw binary files.

JPEG 

Individual JPEG files.

BMP 

Individual Windows Bitmap (.bmp) files.

PNG 

Individual PNG files (requires OpenCV).

RAW3D 

3D raw binary file (raw 3D file can be imported into '3DView' available from http://www.rmrsystems.co.uk/volume_rendering.htm if all three dimensions are less than or equal to 512).

FILETYPE_RFU 

(reserved for future use).

◆ AxInterface

Available capture interfaces to be selected by axSelectInterface().

Enumerator
GIGABIT_ETHERNET 

Gigabit Ethernet interface.

PCI_EXPRESS 

PCI Express interface.

NO_INTERFACE 

No interface selected.

INTERFACE_RFU 

(reserved for future use).

◆ AxRequestMode

Available request modes to define behavior of axRequestImageAdv().

Enumerator
RETRIEVE_TO_CALLER 

Copy image into the user-provided preallocated buffer.

DISPLAY_ONLY 

Display the image in an OpenGL window.

RETRIEVE_AND_DISPLAY 

Copy image into the user-provided preallocated buffer and display the image in an OpenGL window.

REQUESTMODE_RFU 

(reserved for future use).

◆ AxScannerCommand

Available scanner command types to be executed by axScanCmd().

Enumerator
INIT_SCAN 

Initialize & allocate scanner control resources (DEPRECATED).

DESTROY_SCAN 

Destroy & deallocate scanner control resources.

SET_RECT_PATTERN 

Configure a raster scan pattern with linear ramp waveforms on both X and Y dimensions.

LOAD_EXT_PATTERN 

Load an externally generated scan pattern.

CONTINUOUS_LINE_SCAN 

Start continuous line scanning based on configured scan pattern.

CONTINUOUS_RASTER_SCAN 

Start continuous raster scanning based on configured scan pattern.

STOP_AT_POSITION 

Move to a configured position and stop scanning.

SETUP_BURST_RASTER 

Prepare burst raster scan by pre-loading buffers and waiting at start position.

START_BURST_RASTER 

Start burst raster scan with minimum latency.

WAIT_BURST 

Wait for burst raster to complete.

SET_SAMPLE_CLOCK 

Change between external and internal sample clock.

GET_DEVICE_SERIALNO 

Get the device serial number.

SELECT_DEVICE 

Select a device to be the active device.

COUNT_DEVICES 

Count number of connected devices.

SET_MAX_VOLTAGE 

Set maximum allowable voltage for X scan and Y scan waveform outputs.

SET_DIGITAL_OUTPUT 

Control general purpose digital output.

SET_SQUAREWAVE_OUTPUT 

Control general purpose square wave synthesizer.

SET_XSINE_YRAMP_PATTERN 

Configure a raster scan pattern with sinusoidal waveform on the X dimension and linear ramp waveform on the Y dimension.

SET_AUX_DC_ANALOG_OUTPUT 

Control general purpose DC analog output voltage.

SET_AUX_DC_ANALOG_MAX 

Set general purpose DC analog output voltage maximum limit.

SET_AUX_DC_ANALOG_MIN 

Set general purpose DC analog output voltage minimum limit.

GET_DEVICE_MODEL_NUMBER 

Get the device model number. i.e. NI USB-xxxx

SET_XSINE_YSINE_PATTERN 

Configure a raster scan pattern with sinusoidal waveform on the X and Y dimensions.

◆ AxWindowLinkage

Available linkage behaviors for OpenGL display windows to be selected by axLinkWindows(). See https://docs.microsoft.com for more information on Windows OS window relationship concepts like Parent-Child and Ownership.

Enumerator
NO_LINKAGE 

Window has no behavioral dependence on other windows.

PARENT_CHILD 

Parent-Child relationship between windows.

OWNER_OWNED 

Owner-Owned relationship between windows.

Function Documentation

◆ axAdjustBrightnessContrast()

AxErr __cdecl axAdjustBrightnessContrast ( AOChandle  session,
int32_t  which_window,
float  brightness,
float  contrast 
)

Change the brightness and contrast of images displayed in an OpenGL window. (Windows OS only)

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]which_windowSelects which OpenGL window is targeted for this behavior change.
[in]brightnessThe desired brightness. Typical values are in the range [-0.5, 0.5].
[in]contrastThe desired contrast. Typical values are in the range [0.5, 1.5].
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

Note that if the color scheme is set to INVERTED GREYSCALE (see axLoadColormap), the behavior of the brightness parameter is inverted (i.e. higher values of the brightness parameter result in a darker image). Setting contrast = 0 auto-scales the Brightness and Contrast values once based on the next rendered image. Setting contrast = -1 auto-scales continuously for all subsequent rendered images.

Examples
AxsunOCTCapture_example.c, and AxsunOCTCapture_example_NewImageCallback.cpp.

◆ axCancelExport()

AxErr __cdecl axCancelExport ( AOChandle  session)

Cancel background image exporting started by axExportImagesAsync()

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

◆ axCountWindows()

AxErr __cdecl axCountWindows ( AOChandle  session,
int32_t *  num_of_windows 
)

Count the number of OpenGL display windows currently created. (Windows OS only)

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[out]num_of_windowsWill be populated with the number of OpenGL display windows currently created. This will correspond to the number of times axSetupDisplay() has been successfully called since session creation.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

◆ axCropRect()

AxErr __cdecl axCropRect ( AOChandle  session,
int32_t  which_window,
float  crop_left,
float  crop_top,
float  crop_bottom,
float  crop_right 
)

Change the rectangular cropping behavior of images displayed in an OpenGL window. (Windows OS only)

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]which_windowSelects which OpenGL window is targeted for this behavior change.
[in]crop_leftFraction of total image width cropped from left (0 = no cropping, 0.5 = half of image cropped, etc.).
[in]crop_topFraction of total image height cropped from top.
[in]crop_bottomFraction of total image height cropped from bottom.
[in]crop_rightFraction of total image width cropped from right.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

Cropping parameters less than zero are ignored.

◆ axDisplayImage()

AxErr __cdecl axDisplayImage ( AOChandle  session,
int64_t  requested_image_number,
uint32_t *  returned_image_number,
int32_t *  height,
int32_t *  width 
)

Display an image from the Main Image Buffer directly to an OpenGL window (8-bit image data only). (Windows OS only)

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]requested_image_numberThe image number requested for display. This can be a unique image number or it can be set < 1 to request the most recently enqueued image in the buffer.
[out]returned_image_numberWill be populated with the unique image number displayed. This will be equal to the "requested_image_number" parameter unless that parameter is set < 1 to request the most recent image.
[out]heightWill be populated with the height of the requested image (in pixels).
[out]widthWill be populated with the width of the requested image (in pixels).
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

axDisplayImage requests the display (directly rendered into an OpenGL window) of an image from the Main Image Buffer.

Deprecated:
This function may be removed in future versions. Instead use axRequestImage() with the prefs.request_mode member set to DISPLAY_ONLY. (DEPRECATED in v3.4.0)

◆ axExportImages()

AxErr __cdecl axExportImages ( AOChandle  session,
const char *  path_directory,
int32_t *  images_exported,
AxFileType  file_type 
)

Export images from the Main Image Buffer into individual binary or graphics files.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]path_directoryNul-terminated path to directory in which to export files (must be less than 200 characters; UTF8-encoded).
[out]images_exportedWill be populated with the number of images successfully exported.
[in]file_typeThe desired file type (.bin, .jpg, .bmp, .png)
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

Note that any preexisting files in the directory indicated for exporting could be overwritten without warning. Do not call this function concurrently with new data being captured into the buffer (i.e. when the DAQ is in imaging mode) as buffer contents may change in an undesired fashion during export. Descriptors such as image dimensions (height & width) or data type are not exported in the raw .bin file; the user must associate these descriptors manually if needed. 2 or 4-byte data types are exported in big-endian format.

◆ axExportImagesAdv()

AxErr __cdecl axExportImagesAdv ( AOChandle  session,
const char *  path_directory,
int32_t *  images_exported,
AxFileType  file_type,
uint32_t  start_image,
uint32_t  end_image,
request_prefs_t  request_prefs,
export_prefs_t  export_prefs 
)

Export images from the Main Image Buffer into individual graphics and movie files, with dimensional (cropping and scaling), intensity (brightness and contrast), and colormap adjustments.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]path_directoryNul-terminated path to directory in which to export binary files (must be less than 200 characters; UTF8-encoded).
[out]images_exportedWill be populated with the number of images successfully exported.
[in]file_typeThe desired file type. Raw Binary files can be exported for any data type. PNG files can be exported for U8 and U16 data types. JPEG and BMP files can be exported only for U8 data type.
[in]start_imageThe unique image number of the image at which to start exporting. If = 0, all images will be exported.
[in]end_imageThe unique image number of the image at which to stop exporting. If = 0, all images will be exported.
[in]request_prefsPreferences related to image averaging, cropping, and other behaviors (same scheme used in axRequestImage()).
[in]export_prefsControls properties such as size, colormap, contrast, and brightness of the exported images.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

Note that any preexisting files in the directory indicated for exporting could be overwritten without warning. Do not call this function concurrently with new data being captured into the buffer (i.e. when the DAQ is in imaging mode) as buffer contents may change in an undesired fashion during export. Descriptors such as image dimensions (height & width) or data type are not exported in the raw .bin file; the user must associate these descriptors manually if needed. 2 or 4-byte data types are exported in big-endian format.

Examples
AxsunOCTCapture_example_LoadExport.cpp.

◆ axExportImagesAsync()

AxErr __cdecl axExportImagesAsync ( AOChandle  session,
const char *  path_directory,
AxFileType  file_type,
uint32_t  start_image,
uint32_t  end_image,
request_prefs_t  request_prefs,
export_prefs_t  export_prefs 
)

Asynchronously (as a background task) export images from the Main Image Buffer into individual graphics and movie files, with dimensional (cropping and scaling), intensity (brightness and contrast), and colormap adjustments.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]path_directoryNul-terminated path to directory in which to export binary files (must be less than 200 characters; UTF8-encoded).
[in]file_typeThe desired file type. Raw Binary files can be exported for any data type. PNG files can be exported for U8 and U16 data types. JPEG and BMP files can be exported only for U8 data type.
[in]start_imageThe unique image number of the image at which to start exporting. If = 0, all images will be exported.
[in]end_imageThe unique image number of the image at which to stop exporting. If = 0, all images will be exported.
[in]request_prefsPreferences related to image averaging, cropping, and other behaviors (same scheme used in axRequestImage()).
[in]export_prefsControls properties such as size, colormap, contrast, and brightness of the exported images.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

Note that any preexisting files in the directory indicated for exporting could be overwritten without warning. Do not call this function concurrently with new data being captured into the buffer (i.e. when the DAQ is in imaging mode) as buffer contents may change in an undesired fashion during export. Descriptors such as image dimensions (height & width) or data type are not exported in the raw .bin file; the user must associate these descriptors manually if needed. 2 or 4-byte data types are exported in big-endian format. This function will return program flow to the calling application while invoking a background task to complete the export operation. Use axRegisterExportCallback() to monitor the export progress.

◆ axGetCompressedJPEGInfo()

AxErr __cdecl axGetCompressedJPEGInfo ( AOChandle  session,
int64_t  requested_frame_number,
uint32_t *  returned_frame_number,
uint32_t *  required_buffer_size 
)

Get un-decompressed size information on a compressed JPEG frame in the Main Image Buffer (A frame is 256 A-scans, unsynchronized with Image_sync signal).

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]requested_frame_numberThe frame number for which information is desired. This can be a unique frame number or it can be set to -1 to get info on the most recently enqueued frame in the buffer.
[out]returned_frame_numberWill be populated with the unique frame number. This will be equal to the "requested_frame_number" parameter unless that parameter is set to -1 to get info on the most recent frame.
[out]required_buffer_sizeWill be populated with the required size (in bytes) of a user buffer that must be allocated before JPEG retrieval using axRequestCompressedJPEG.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

axGetCompressedJPEGInfo() gets information on a JPEG compressed frame in the Main Image Buffer before a request is made to retrieve the JPEG data into a user buffer. A call to axGetCompressedJPEGInfo() is intended to precede a call to axRequestCompressedJPEG() and provides several arguments to axRequestCompressedJPEG() (e.g. output_buf_len, requested_frame_number) and identifies "stale" images (for avoiding redundant memory copies if calling axRequestCompressedJPEG using the same requested frame number on consecutive calls).

◆ axGetDataRate()

AxErr __cdecl axGetDataRate ( AOChandle  session,
double *  datarate_Mbps 
)

Get data transfer rate on the active interface.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[out]datarate_MbpsThe estimated data transfer rate for the most recently enqueued image data in in megabits/second.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

◆ axGetErrorString()

void __cdecl axGetErrorString ( AxErr  errorcode,
char *  message_out 
)

Get a description of a specific AxErr error code.

Parameters
[in]errorcodeAn AxErr error code returned from another function in the AxsunOCTCapture API.
[out]message_outA pointer to a pre-allocated output buffer of characters with size at least 512 bytes into which a nul-terminated description for errorcode will be copied.

axGetErrorString() can be called at any time; creation of a valid capture session is not required. It is unsafe to pass a message_out output buffer allocated with fewer than 512 bytes.

Examples
AxsunOCTCapture_example.c, AxsunOCTCapture_example_LoadExport.cpp, AxsunOCTCapture_example_NewImageCallback.cpp, and axScanCmd_example.cpp.

◆ axGetFrameInfoAdv()

AxErr __cdecl axGetFrameInfoAdv ( AOChandle  session,
int64_t  requested_frame_number,
uint32_t *  returned_frame_number,
int32_t *  height,
int32_t *  width,
AxDataType data_type_out,
uint32_t *  required_buffer_size 
)

Get information on a frame in the Main Image Buffer (A frame is 256 A-scans, unsynchronized with Image_sync signal).

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]requested_frame_numberThe frame number for which information is desired. This can be a unique frame number or it can be set to -1 to get info on the most recently enqueued frame in the buffer.
[out]returned_frame_numberWill be populated with the unique frame number. This will be equal to the "requested_frame_number" parameter unless that parameter is set to -1 to get info on the most recent frame.
[out]heightWill be populated with the height of the requested frame (in pixels).
[out]widthWill be populated with the width of the requested frame (in pixels).
[out]data_type_outWill be populated with the data type of the requested frame (see AxDataType enum definition)
[out]required_buffer_sizeWill be populated with the required size (in bytes) of a user buffer that must be allocated before frame retrieval using axRequestFrameAdv.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

axGetFrameInfoAdv() gets information on a frame in the Main Image Buffer before a more computationally expensive request is made to retrieve the frame data. A call to axGetFrameInfoAdv() is intended to precede a call to axRequestFrameAdv() and provides several arguments to axRequestFrameAdv() (e.g. output_buf_len, requested_frame_number) and identifies "stale" images (for avoiding the wasted computation resources incurred by calling axRequestFrameAdv using the same requested frame number on consecutive calls).

◆ axGetImageInfo()

AxErr __cdecl axGetImageInfo ( AOChandle  session,
uint32_t  requested_image,
image_info_t image_info 
)

Get information on an image in the Main Image Buffer.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]requested_imageThe image number for which information is desired. This can be a unique image number > 1, or it can be 0 to get info on the most recently enqueued image in the buffer.
[out]image_infoA image_info_t struct which will be populated with information about the requested image.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

axGetImageInfo() gets information on an image in the Main Image Buffer before a more computationally expensive request is made to retrieve or display the image. A call to axGetImageInfo() is intended to precede a call to axRequestImage() and the returned image_info provides several arguments to that subsequent function call (e.g. output_buf_len, requested_image) and identifies "stale" images (for avoiding the wasted computation resources incurred by calling axRequestImage() using the same requested image number on consecutive calls).

Examples
AxsunOCTCapture_example.c, and AxsunOCTCapture_example_LoadExport.cpp.

◆ axGetImageInfoAdv()

AxErr __cdecl axGetImageInfoAdv ( AOChandle  session,
int64_t  requested_image_number,
uint32_t *  returned_image_number,
int32_t *  height,
int32_t *  width,
AxDataType data_type_out,
uint32_t *  required_buffer_size,
uint8_t *  force_trig,
uint8_t *  trig_too_fast 
)

Advanced function for getting information on an image in the Main Image Buffer.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]requested_image_numberThe image number for which information is desired. This can be a unique image number > 1, or it can be set < 1 to get info on the most recently enqueued image in the buffer.
[out]returned_image_numberWill be populated with the unique image number. This will be equal to the "requested_image_number" parameter unless that parameter is set < 1 to get info on the most recent image.
[out]heightWill be populated with the height of the requested image (in pixels).
[out]widthWill be populated with the width of the requested image (in pixels).
[out]data_type_outWill be populated with the data type of the requested image (see AxDataType enum definition)
[out]required_buffer_sizeWill be populated with the required size (in bytes) of a user buffer that must be allocated before image retrieval using axRequestImageAdv or axRequestImage.
[out]force_trigWill be populated with 1 if requested image was acquired in Force Trigger mode, or 0 otherwise. See description associated with axSetTrigTimeout function.
[out]trig_too_fastWill be populated with 1 if Image_sync trigger period is too short, or 0 otherwise.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

axGetImageInfoAdv() gets information on an image in the Main Image Buffer before a more computationally expensive request is made to retrieve or display the image. A call to axGetImageInfoAdv() is intended to precede a call to axRequestImageAdv() and provides several arguments to axRequestImageAdv() (e.g. output_buf_len, requested_image_number) and identifies "stale" images (for avoiding the wasted computation resources incurred by calling axRequestImageAdv() using the same requested image number on consecutive calls).

Deprecated:
This function may be removed in future versions. Use axGetImageInfo() instead. (DEPRECATED in v3.4.0)

◆ axGetImageRate()

AxErr __cdecl axGetImageRate ( AOChandle  session,
int32_t *  images_per_second 
)

Get the rate of new images being enqueued in the main image buffer.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[out]images_per_secondThe estimated rate for the most recently enqueued image data in images/second.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

◆ axGetLibBuildCfg()

int32_t __cdecl axGetLibBuildCfg ( void  )

Get the build configuration of the library.

Returns
= a bitfield with information about the build configuration options used to compile the loaded library. \ Bit 0: = 0 for 'debug' configuration or = 1 for 'release' configuration \ Bit 1: (for internal use only) \ Bit 2: = 0 for non-verbose mode or = 1 for verbose logging mode

◆ axGetLibBuildDateTime()

int32_t __cdecl axGetLibBuildDateTime ( char *  datetime_str)

Get a string describing the time and date that the library was built.

Parameters
[out]datetime_strA pointer to a pre-allocated output buffer of characters with size at least 100 bytes into which a nul-terminated date & time string will be copied.
Returns
The number of characters (bytes) written into the datetime_str buffer.

It is unsafe to pass a datetime_str output buffer allocated with fewer than 100 bytes.

◆ axGetLibVersion()

void __cdecl axGetLibVersion ( int32_t *  major,
int32_t *  minor,
int32_t *  patch,
int32_t *  build,
char *  version_str 
)

Get the library version.

Parameters
[out]majorVersion number major element.
[out]minorVersion number minor element.
[out]patchVersion number patch element.
[out]buildVersion number build element.
[out]version_strA pointer to a pre-allocated output buffer of characters with size at least 16 bytes into which a nul-terminated version string will be copied.

It is unsafe to pass a version_str output buffer allocated with fewer than 16 bytes.

◆ axGetMessage()

AxErr __cdecl axGetMessage ( AOChandle  session,
char *  message_out 
)

Get a description of the capture session's interface status.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[out]message_outA pointer to a pre-allocated buffer of characters with size at least 256 bytes into which a nul-terminated message string will be copied.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

axGetMessage() can be called any time after creation of a valid capture session and will describe the status of the capture interface. A capture session without a valid capture interface will support only review of previously saved and re-loaded data using axSaveFile() and axLoadFile(). It is unsafe to pass an output buffer allocated with fewer than 256 bytes.

Examples
AxsunOCTCapture_example.c, and AxsunOCTCapture_example_NewImageCallback.cpp.

◆ axGetPCIeDriverVersion()

const char *__cdecl axGetPCIeDriverVersion ( )

Get the version of the PCIe device driver & library which must be installed to use the PCIe interface.

Returns
A nul-terminated string containing the name of the PCIe library with version number.

◆ axGetSelectedInterface()

AxErr __cdecl axGetSelectedInterface ( AOChandle  session,
AxInterface selected_interface 
)

Queries the currently selected data interface (Ethernet, PCIe, or none) for the capture session.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[out]selected_interfaceThe interface currently initialized successfully for this session.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

Use axGetMessage() for additional description.

◆ axGetStatus()

AxErr __cdecl axGetStatus ( AOChandle  session,
uint32_t *  imaging,
uint32_t *  last_packet_in,
uint32_t *  last_frame_in,
uint32_t *  last_image_in,
uint32_t *  dropped_packets,
uint32_t *  frames_since_sync 
)

Get imaging mode status and Main Image Buffer statistics.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[out]imagingInterpreted as a bit-field: bit 0 set indicates imaging is active, bit 1 set indicates burst recording is active, bit 2 set indicates loading from disk is active.
[out]last_packet_inWill be populated with the unique packet number most recently enqueued into the Main Image Buffer.
[out]last_frame_inWill be populated with the unique frame number most recently enqueued into the Main Image Buffer.
[out]last_image_inWill be populated with the unique image number most recently enqueued into the Main Image Buffer.
[out]dropped_packetsWill be populated with the number of packets dropped since the last imaging mode reset.
[out]frames_since_syncWill be populated with the number of frames enqueued since the last Image_sync pulse was received. When this number reaches the configured trigger timeout, the driver will transition to Force Trigger mode.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.
Examples
AxsunOCTCapture_example.c, AxsunOCTCapture_example_LoadExport.cpp, and AxsunOCTCapture_example_NewImageCallback.cpp.

◆ axHideWindow()

AxErr __cdecl axHideWindow ( AOChandle  session,
int32_t  which_window,
uint32_t  state 
)

Hide or unhide the OpenGL image display window. (Windows OS only)

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]which_windowSelects which OpenGL window is targeted for this state change.
[in]stateThe desired window visibility state and Z-order selected from:
  • 0: visible (no change to Z-order),
  • 1: hidden
  • 2: visible (Z-order set to top; no change to Top-Most status),
  • 3: visible (Z-order set to bottom; removes any Top-Most status),
  • 4: visible (removes Top-Most status),
  • 5: visible (sets Top-Most status)
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

OpenGL display windows created with axSetupDisplay() have Top-Most status by default. See https://docs.microsoft.com for explanation of Windows OS Z-order behavior.

Examples
AxsunOCTCapture_example_NewImageCallback.cpp.

◆ axImagingCntrlPCIe()

AxErr __cdecl axImagingCntrlPCIe ( AOChandle  session,
int16_t  number_of_images 
)

Control the image streaming behavior of the Axsun PCIe DAQ between Live Imaging, Burst Recording, and Imaging Off states. (Windows OS only)

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]number_of_imagesSet this argument to zero (0) for Imaging Off; set it to (-1) for Live Imaging (no record), or set it to any positive value between 1 and 32767 to request the desired number of images in a Burst Record operation.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

axImagingCntrlPCIe() controls the DMA-based transfer of images from the Axsun DAQ via the PCIe interface. Note that this function does NOT control the laser and therefore the laser emission (along with its sweep trigger and k-clocks) must be enabled separately. This function takes a single parameter to select between three states: Live Imaging, Burst Record, or Imaging Off. In Live Imaging mode, the DAQ will acquire and transmit images indefinitely. In Burst Record mode (a sub-mode of Live Imaging mode), the DAQ will acquire and transmit the finite number of images requested and then automatically transition itself to the Imaging Off state.

Examples
AxsunOCTCapture_example.c, and AxsunOCTCapture_example_NewImageCallback.cpp.

◆ axLinkWindows()

AxErr __cdecl axLinkWindows ( AOChandle  session,
int32_t  which_window,
AxWindowLinkage  linkage,
uintptr_t  linked_handle 
)

Change the linkage of the OpenGL display window to another window (i.e. parent or owner). (Windows OS only)

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]which_windowSelects which OpenGL window is targeted for this change.
[in]linkageSelects the desired linkage behavior.
[in]linked_handleThe window handle (HWND) of an existing window to which the OpenGL window is bound as a child or owned window. Set this to NULL to remove linkage to an existing window.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

If another window has been linked either in the initial call to axSetupDisplay() or by a call to axLinkWindows(), it will become the parent or owner of the OpenGL display window. A child window will be drawn inside the rectangular client area of its parent. An owned window can be drawn outside the client area of its owner, but it will minimize/restore with its owner and always be drawn on top of its owner. Free windows are unconstrained by the behaviors of other windows. More explanation of Windows OS parent/child and owner/owned relationships is available on https://docs.microsoft.com.

◆ axLoadFile()

AxErr __cdecl axLoadFile ( AOChandle  session,
const char *  path_file,
int32_t *  packets_read 
)

Load contents from file on disk into Main Image Buffer.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]path_fileFull directory and filename from which to load data (UTF8-encoded).
[out]packets_readWill be populated with the number of packets successfully loaded from disk.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

Note that a subsequent call to axGetStatus is useful for determining the number of frames and images loaded into the Main Image Buffer by this function. A call to axResizeBuffer() can be used to clear the Main Image Buffer prior to loading. This function should be called only when images are NOT currently being enqueued into the buffer by a connected DAQ board.

Examples
AxsunOCTCapture_example_LoadExport.cpp.

◆ axLoadUserColormap()

AxErr __cdecl axLoadUserColormap ( AOChandle  session,
int32_t  which_window,
uint8_t *  user_colormap_in 
)

Load a user-defined AxColormap for images displayed in an OpenGL window. (Windows OS only)

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]which_windowSelects which OpenGL window is targeted for this behavior change.
[in]user_colormap_inThe colormap array to be loaded.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

To display a user-defined color map loaded using this function, the "user" AxColormap must be selected with axSelectColormap(). The colormap format is a 768-byte array composed of 256 R,G,B triads: (R0, G0, B0), (R1, G1, B1), (R2, G2, B2), ..., (R255, G255, B255).

◆ axPipelineMode()

AxErr __cdecl axPipelineMode ( AOChandle  session,
AxPipelineMode  mode,
AxChannelMode  channels 
)

Configures FPGA registers to output the desired data type & location from the processing pipeline via the PCIe interface.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]modeThe desired pipeline mode according to the numbered pipeline diagram shown as in the Operator's Manual.
[in]channelsThe desired channel selection mode (see AxChannelMode enum)
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

Note that this function does not subsequently query the DAQ hardware to confirm the write was actually successful. A return value of NO_AxERROR only indicates the software's request was made successfully. Call axReadFPGAreg() to confirm hardware register value if desired.

Examples
AxsunOCTCapture_example.c, and AxsunOCTCapture_example_NewImageCallback.cpp.

◆ axReadFPGAreg()

AxErr __cdecl axReadFPGAreg ( AOChandle  session,
uint16_t  regnum,
uint16_t *  regval 
)

Read a FPGA register on the Axsun DAQ via the PCIe interface.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]regnumThe unique register number to which the read operation is directed.
[out]regvalWill be populated with the register value fetched from the FPGA.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

axReadFPGAreg is functionally equivalent to the AxsunOCTControl.dll library function "GetFPGARegister" used when connected to the DAQ via Ethernet or USB.

◆ axRegisterDAQCallback()

AxErr __cdecl axRegisterDAQCallback ( AOChandle  session,
AxCallbackFunction_t  callback_function,
void *  user_data 
)

Registers a callback function to be executed upon a change in the DAQ imaging state (e.g. transition to live, record, idle).

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]callback_functionA user-supplied function to be called. Pass NULL to un-register a callback function.
[in]user_dataAn arbitrary structure to be made available inside the callback function (or NULL if unused).
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

The supplied callback function will be executed when the DAQ image state changes, or when axReportImagingState() is called. The uint32_t argument available in the registered AxCallbackFunction_t will convey the DAQ imaging state per the AxDAQEvent enum.

Examples
AxsunOCTCapture_example_NewImageCallback.cpp.

◆ axRegisterExportCallback()

AxErr __cdecl axRegisterExportCallback ( AOChandle  session,
AxCallbackFunction_t  callback_function,
void *  user_data 
)

Registers a callback function to be executed each time an image is exported using axExportImages(), axExportImagesAdv(), or axExportImagesAsync().

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]callback_functionA user-supplied function to be called. Pass NULL to un-register a callback function.
[in]user_dataAn arbitrary structure to be made available inside the callback function (or NULL if unused).
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

The supplied callback function will be executed when an image is exported. This provides client software with the ability to monitor the export status, update a progress bar, etc. The int32_t argument available in the registered AxCallbackFunction_t will convey the image number of the exported image if positive-valued, or can be cast to an AxErr value if negative valued (indicating an error has occurred).

Examples
AxsunOCTCapture_example_LoadExport.cpp.

◆ axRegisterNewImageCallback()

AxErr __cdecl axRegisterNewImageCallback ( AOChandle  session,
AxNewImageCallbackFunction_t  callback_function,
void *  user_data 
)

Registers a callback function to be executed each time a new image is enqueued in the Main Image Buffer, whether captured from DAQ hardware or loaded from disk.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]callback_functionA user-supplied function to be called. Pass NULL to un-register a callback function.
[in]user_dataAn arbitrary structure to be made available inside the callback function (or NULL if unused).
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

This function enables event-driven program flow in the client application, as an alternative to polling the Main Image Buffer for new images using axGetImageInfo(). The data argument available in the registered AxNewImageCallbackFunction_t will convey the unique image number of the newly enqueued image.

Examples
AxsunOCTCapture_example_NewImageCallback.cpp.

◆ axRegisterScannerConnectCallback()

AxErr __cdecl axRegisterScannerConnectCallback ( AxConnectScannerCallbackFunction_t  callback_function,
void *  userData 
)

Registers a callback function to be executed following a scanner (DAQmx) device connection or disconnection event. (Windows OS only)

Parameters
[in]callback_functionA user-supplied function to be called. Pass NULL to un-register a callback function.
[in]userDataAn arbitrary structure to be made available inside the callback function (or NULL if unused).
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

The supplied callback function will be executed by a background thread when a new DAQmx device is detected or when an existing device is disconnected. Within the callback function, access is provided to arbitrary user data passed as a void* parameter to this function.

Examples
axScanCmd_example.cpp.

◆ axReportImagingState()

AxErr __cdecl axReportImagingState ( AOChandle  session)

Programmatically executes the pre-registered callback function to indicate the current DAQ imaging state.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

Before calling this function, register your custom callback function using axRegisterDAQCallback(). This function aids event-driven program flow in the client application, as an alternative to polling the 'imaging' parameter in axGetStatus().

◆ axRequestCompressedJPEG()

AxErr __cdecl axRequestCompressedJPEG ( AOChandle  session,
int64_t  requested_frame_number,
uint8_t *  JPEG_data_out,
axpacket_t metadata_out,
uint32_t  output_buf_len 
)

Retrieve an un-decompressed JPEG frame from the Main Image Buffer (A frame is 256 A-scans, unsynchronized with Image_sync signal).

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]requested_frame_numberThe frame number requested for retrieval. This can be a unique image number or it can be set to -1 to request the most recently enqueued frame in the buffer.
[out]JPEG_data_outA pre-allocated buffer into which the retrieved JPEG frame is copied for subsequent user interaction. Buffer size must be at least as large as indicated by a preceding call to axGetCompressedJPEGInfo ("required_buffer_size").
[out]metadata_outA pre-allocated buffer of sizeof(axpacket_t) bytes into which frame metadata is copied.
[in]output_buf_lenThe pre-allocated length in bytes of the JPEG_data_out buffer.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

axRequestCompressedJPEG() requests the retrieval (into a pre-allocated buffer defined by the user) of un-decompressed JPEG information. This JPEG can subsequently be saved as a file and/or decompressed by the user's preferred JPEG decompression library or utility. A call to axRequestCompressedJPEG() is intended to follow a call to axGetCompressedJPEGInfo(), which provides several arguments to axRequestCompressedJPEG() (e.g. output_buf_len, requested_frame_number) and identifies "stale" images (for avoiding redundant memory copies if calling axRequestCompressedJPEG using the same requested frame number on consecutive calls).

◆ axRequestFrameAdv()

AxErr __cdecl axRequestFrameAdv ( AOChandle  session,
int64_t  requested_frame_number,
uint8_t *  frame_data_out,
axpacket_t metadata_out,
int32_t *  height,
int32_t *  width,
AxDataType data_type_out,
uint32_t  output_buf_len 
)

Retrieve a frame from the Main Image Buffer (A frame is 256 A-scans, unsynchronized with Image_sync signal).

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]requested_frame_numberThe frame number requested for retrieval. This can be a unique image number or it can be set to -1 to request the most recently enqueued frame in the buffer.
[out]frame_data_outA pre-allocated buffer into which the retrieved frame is copied for subsequent user interaction. Buffer size must be at least as large as indicated by a preceding call to axGetFrameInfoAdv ("required_buffer_size").
[out]metadata_outA pre-allocated buffer of sizeof(axpacket_t) bytes into which metadata is copied.
[out]heightWill be populated with the height of the requested frame (in pixels).
[out]widthWill be populated with the width of the requested frame (in pixels).
[out]data_type_outWill be populated with the data type of the requested frame (see AxDataType enum definition)
[in]output_buf_lenThe pre-allocated length in bytes of the frame_data_out buffer.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

axRequestFrameAdv() requests the retrieval (into a pre-allocated buffer defined by the user) of a frame from the Main Image Buffer. A call to axRequestFrameAdv() is intended to follow a call to axGetFrameInfoAdv(), which provides several arguments to axRequestFrameAdv() (e.g. output_buf_len, requested_frame_number) and identifies "stale" images (for avoiding the wasted computation resources incurred by calling axRequestFrameAdv using the same requested frame number on consecutive calls). OpenGL display of frames is currently unsupported.

◆ axRequestImage()

AxErr __cdecl axRequestImage ( AOChandle  session,
uint32_t  requested_image,
request_prefs_t  prefs,
uint32_t  output_buf_len,
uint8_t *  image_data_out,
image_info_t image_info 
)

Retrieve and/or display an image from the Main Image Buffer.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]requested_imageThe image number requested for retrieval or display. This must be a unique image number returned from a prior call to axGetImageInfo() or extracted from the new_image_callback_data_t in a New Image Callback invocation. For the most recently enqueued image in the buffer, use a value = 0 as the requested_image argument in axGetImageInfo().
[in]prefsA structure containing preferences related to image averaging, request mode, image cropping, and other behaviors.
[in]output_buf_lenThe size in bytes of the pre-allocated image_data_out buffer into which this function will copy the image. Don't lie, or crashes could ensue.
[out]image_data_outA pre-allocated buffer into which the retrieved image is copied for subsequent user interaction. Buffer size must be at least as large as indicated by a preceding call to axGetImageInfo() or axGetImageInfoAdv() (i.e. the required_buffer_size) unless accomodations are made manually for image cropping or downsampling in the request prefs.
[out]image_infoAn image_info_t struct which will be populated with information about the retreived and/or displayed image. NOTE: height, width, and size_bytes values may be different from prior call to axGetImageInfo() if the request prefs include cropping or downsampling.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

axRequestImage() requests the retrieval (via copy into a pre-allocated buffer defined by the user) or direct display (via OpenGL rendering) of an image from the Main Image Buffer.

Examples
AxsunOCTCapture_example.c, AxsunOCTCapture_example_LoadExport.cpp, and AxsunOCTCapture_example_NewImageCallback.cpp.

◆ axRequestImageAdv()

AxErr __cdecl axRequestImageAdv ( AOChandle  session,
int64_t  requested_image_number,
uint8_t *  image_data_out,
axpacket_t metadata_out,
int32_t *  height,
int32_t *  width,
AxDataType data_type_out,
uint32_t  output_buf_len,
request_prefs_t  prefs,
uint8_t *  force_trig,
uint8_t *  trig_too_fast 
)

Advanced function for retrieving and/or displaying an image from the Main Image Buffer.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]requested_image_numberThe image number requested for retrieval and/or display. This can be a unique image number > 1 or it can be set to -1 to request the most recently enqueued image in the buffer.
[out]image_data_outA pre-allocated buffer into which the retrieved image is copied for subsequent user interaction. Buffer size must be at least as large as indicated by a preceding call to axGetImageInfo or axGetImageInfoAdv ("required_buffer_size"). Can be NULL if req_mode parameter is set to DISPLAY_ONLY.
[out]metadata_outA pre-allocated buffer of sizeof(axpacket_t) bytes into which pertinent image metadata is copied.
[out]heightWill be populated with the height of the requested image (in pixels).
[out]widthWill be populated with the width of the requested image (in pixels).
[out]data_type_outWill be populated with the data type of the requested image (see AxDataType enum definition)
[in]output_buf_lenThe pre-allocated length in bytes of the image_data_out buffer. Can be 0 if req_mode parameter is set to DISPLAY_ONLY.
[in]prefsA structure containing preferences related to image averaging, request mode, image cropping, and other behaviors.
[out]force_trigWill be populated with 1 if requested image was acquired in Force Trigger mode, or 0 otherwise. See description associated with axSetTrigTimeout function.
[out]trig_too_fastWill be populated with 1 if Image_sync trigger period is too short, or 0 otherwise.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

axRequestImageAdv() requests the retrieval (into a pre-allocated buffer defined by the user) and/or display (directly rendered into OpenGL window) of an image from the Main Image Buffer. A call to axRequestImageAdv() is intended to follow a call to axGetImageInfo(), which provides several arguments to axRequestImageAdv() (output_buf_len, requested_image_number) and identifies "stale" images (for avoiding the wasted computation resources incurred by calling axRequestImageAdv() using the same requested image number on consecutive calls).

Deprecated:
This function may be removed in future versions. Use axRequestImage() or axDisplayImage() instead. (DEPRECATED in v3.4.0)

◆ axRequestImagePointer()

AxErr __cdecl axRequestImagePointer ( AOChandle  session,
uint32_t  requested_image,
image_info_t image_info,
span_t part1,
span_t part2 
)

Retrieve a pointer to an image in the Main Image Buffer (non-compressed images only).

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]requested_imageThe image number for which to retrieve a pointer. This must be a unique image number returned from a prior call to axGetImageInfo() or extracted from the new_image_callback_data_t in a New Image Callback invocation. For the most recently enqueued image in the buffer, use a value = 0 as the requested_image argument in axGetImageInfo().
[out]image_infoAn image_info_t struct which will be populated with information about the image for which a pointer is retrieved.
[out]part1A span_t struct which will be populated with the start address and size in bytes of the requested image.
[out]part2For images whose contents happen to wrap from the end around to the start of the (circular) Main Image Buffer, this argument will be populated with the start address and size of the second part of the image and the part1 argument will contain the start address and size of the first part of the image. These two parts can then be concantenated by the user. For images which are contiguous in the buffer (unaffected by the buffer circularity) the members of part2 will be zero.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

The traditional axRequestImage() function retrieves the image by copying it from the Main Image Buffer into a pre-allocated buffer owned by the user. axRequestImagePointer() provides const pointer access to image data directly in the Main Image Buffer in order to accommodate GUI frameworks whose "image type" class constructors must perform their own deep copies. This function helps avoid the inefficiency of an additional copy (into an intermediary user buffer) between the Main Image Buffer (owned by the AxsunOCTCapture library) and the eventual ownership of the framework's "image-type" class. Cropping, averaging, decompressing, or other image manipulation features are unavailable via this function; use axRequestImage() instead. NOTE: The image at the retreived pointer(s) is only valid so long as the Main Image Buffer has not been cleared, resized, or overwritten with newly enqueued images (e.g. acquired from DAQ or loaded from file).

◆ axResizeBuffer()

AxErr __cdecl axResizeBuffer ( AOChandle  session,
float  capacity_MB 
)

Clears and resets the Main Image Buffer, optionally with a new buffer size.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]capacity_MBThe desired size of the new buffer in MB. A value of 0 resets (clears) the buffer using the previously configured size.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

This function is useful for preventing retrieval of images from prior imaging sequences which have not yet been overwritten by the most recent sequence. Careful management of buffer status (i.e. number of images enqueued) returned using axGetStatus() will avoid this situation, making the use of this function optional. This function should not be called when images are currently being enqueued into the buffer by a connected DAQ board or while loading a file from disk.

◆ axSaveFile()

AxErr __cdecl axSaveFile ( AOChandle  session,
const char *  path_file,
uint8_t  full_buffer,
int32_t *  packets_written 
)

Save contents of Main Image Buffer to disk.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]path_fileFull directory and filename at which to create new save file (UTF8-encoded).
[in]full_bufferSet to 0 for saving only data captured during the most recent imaging sequence (e.g. a burst record) or set to 1 to save the full buffer.
[out]packets_writtenWill be populated with the number of packets successfully saved to disk.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

Note that a preexisting file at the location indicated for saving will be overwritten without warning. This function should be called only when images are NOT currently being enqueued into the buffer by a connected DAQ board.

◆ axScanCmd()

AxErr __cdecl axScanCmd ( AxScannerCommand  scan_command,
double  misc_scalar,
const scan_params_t scan_parameters,
ext_pattern_t external_scan_pattern,
void *  RFU 
)

Control analog output waveform generation for 2 channel (X-Y) scanners. (Windows OS only)

Parameters
[in]scan_commandThe desired scanner function selected from available commands in the AxScannerCommand enum. See below for notes on available scanner commands.
[in]misc_scalarA general purpose scalar value. Valid when scan_command = WAIT_BURST, SET_SAMPLE_CLOCK, GET_DEVICE_SERIALNO, SELECT_DEVICE, and others. (See below for usage.)
[in]scan_parametersA structure defining the basic geometry of a rectangular raster scan pattern generated by the library (parameter valid when scan_command = SET_RECT_PATTERN or STOP_AT_POSITION, otherwise set to NULL).
[in]external_scan_patternA structure defining the user-generated scan pattern and associated arrays to be loaded (parameter valid when scan_command = LOAD_EXT_PATTERN, otherwise set to NULL).
[in,out]RFUReserved for future use, set to NULL.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code. Some scan commands return positive integers as noted in their description.

Scan patterns are configured based on voltage values at the output pins of the analog output generation device. Converting a voltage value to an optical beam position must incorporate external linear and non-linear factors such as the type of scanner & amplifier/controller, the opto-mechanical layout, lens distortion, etc. The active scan pattern (an array of interleaved X and Y voltages) can be generated by the library based on user-configurable high-level geometric parameters (i.e. range and origin) to define a rectangular raster scan area, or generated externally by the user and then loaded directly via array format. The rectangular raster scan pattern generated by the library consists of linear ramp functions (sawtooth wave with 100% duty cycle) along the X and Y scan dimensions. When scanning, the "fast" X voltage is updated for each clock pulse and the "slow" Y voltage is updated after each full period of the X waveform.

SETUP and HARDWARE CONNECTIONS:

  • supports NI USB-6211, USB-6001, USB-6008, or USB-6343 hardware (including OEM style) according to the following matrix.
  • requires installation of NI-DAQmx device driver software. (http://sine.ni.com/nips/cds/view/p/lang/en/nid/10181)
  • make the following terminal connections according to the functionality desired and the board type used:
FUNCTION USB-6211 USB-6343 USB-6001/6008 GROUND TYPE
X scan waveform output AO 0 AO 0 <n/a> A GND
Y scan waveform output AO 1 AO 1 <n/a> A GND
Auxiliary analog DC output <n/a> AO 2 AO 0 A GND
Image_sync pulse output PFI 5 PFI 13 <n/a> D GND
Ext. sample clock input PFI 0 PFI 8 <n/a> D GND
Square wave output PFI 4 PFI 12 <n/a> D GND
Auxiliary digital output PFI 6 PFI 2 P 1.2 D GND

AVAILABLE SCANNER COMMANDS:

  • axScanCmd(INIT_SCAN, ...) Initialize hardware and allocate scanner control resources. (DEPRECATED)

    Scanner control resources are lazy-initialized automatically on the first call to any axScanCmd() command type, so this INIT_SCAN command is no longer needed. Hardware resources are initialized automatically when a supported device is detected (may take up to 10 seconds for device to be recognized after connecting). Use SET_MAX_VOLTAGE command once a device is connected in order to set its maximum voltage limits for analog output waveforms.

  • axScanCmd(DESTROY_SCAN, ...) Destroy and deallocate scanner control resources.

    Resources previously allocated with other axScanCmd(...) function calls are automatically deallocated by axStopSession() when terminating a main Axsun OCT Capture session. Call this command to explicitly deallocate scanner resources if a main capture session was not used.

  • axScanCmd(SET_RECT_PATTERN, ..., scan_parameters, ...) Use scan_parameters to configure a rectangular raster scan pattern.

    The basic geometry defined in the scan_parameters structure is used to generate the active 1D (line) and 2D (raster) scan patterns for subsequent analog output generation, overwriting active scan patterns previously generated with this command or loaded with axScanCmd(LOAD_EXT_PATTERN,...). Contents of the scan_parameters structure are copied internally and the pointer to this structure need not remain valid following return from this command.

  • axScanCmd(LOAD_EXT_PATTERN, ..., external_scan_pattern, ...) Use external_scan_pattern to load an externally generated scan pattern.

    An arbitrary user-generated scan pattern can be loaded for subsequent analog output generation, overwriting active scan patterns previously loaded with this command or generated with axScanCmd(SET_RECT_PATTERN,...). Contents of the external_scan_pattern structure and associated arrays are copied internally and the pointer to this structure and its associated arrays need not remain valid following return from this command.

  • axScanCmd(CONTINUOUS_LINE_SCAN, ...) Start continuous line scanning based on configured scan pattern.

    Starts the analog output generation for the active 1D linear scan, repeating it continuously until commanded otherwise. The Image_sync pulse frequency is derived from the X_increment configured when the active scan pattern was set or loaded.

  • axScanCmd(CONTINUOUS_RASTER_SCAN, ...) Start continuous raster scanning based on configured scan pattern.

    Starts the analog output generation for the active 2D raster scan, repeating it continuously until commanded otherwise. The Image_sync pulse frequency is derived from the X_increment configured when the active scan pattern was set or loaded..

  • axScanCmd(STOP_AT_POSITION, ..., scan_parameters, ...) Move to a configured position and stop scanning.

    Stops the Image_sync pulse and sets a constant (non-scanning) analog output at the voltages given in the X_shift and Y_shift fields of the scan_parameters argument. This command does not alter or overwrite the active scan parameters or patterns previously configured using axScanCmd(SET_RECT_PATTERN,...).

  • axScanCmd(SETUP_BURST_RASTER, ...) Prepare a burst raster scan by pre-loading buffers and waiting at the start position.

    Uploads the active raster scan pattern to device memory and sets a constant analog output at the pattern's initial voltage, but waits to start scanning until a subsequent call to axScanCmd(START_BURST_RASTER,...).

  • axScanCmd(START_BURST_RASTER, ...) Start a burst raster scan with minimum latency.

    Starts analog output and Image_sync pulse generation for a burst raster scan. Must be preceded by a call to axScanCmd(SETUP_BURST_RASTER,...). The raster scan starts with minimal latency and is executed once.

  • axScanCmd(WAIT_BURST, misc_scalar, ...) Wait for a burst raster scan to complete.

    Waits for a burst raster scan operation to compete. The misc_scalar parameter sets the timeout (in seconds) to wait before returning an error. A timeout of -1 waits indefinitely, a timeout of 0 returns immediately with an error if the raster scan is still active or no error if it is complete.

  • axScanCmd(SET_SAMPLE_CLOCK, misc_scalar, ...) Changes between external and internal sample clock.

    The misc_scalar parameter sets the desired sample clock for subsequent analog output generation. The default value of 0 uses the external sample clock from the pin according to the table above, a non-zero value uses a 100 kHz sample clock generated internally by the device. Active scanning operations must be restarted for changes to take effect.

  • axScanCmd(GET_DEVICE_SERIALNO, misc_scalar, ...) Returns a device serial number (if AxErr return value > 0, type-cast it to int).

    A list of N connected devices is maintained internally by the library. The misc_scalar parameter sets the device index (from 0 to N-1) on which to query the device serial number. If the index is higher than N-1, function will return AxErr::DAQMX_DEVICE_NOT_FOUND.

  • axScanCmd(SELECT_DEVICE, misc_scalar, ...) Selects the active device.

    A list of N connected devices is maintained internally by the library. The device occupying the first position (index 0) is considered the "active device" to which other axScanCmd() commands are directed. A positive-valued misc_scalar parameter sets the new "active device" (indexed from 0 to N-1) to be moved into the first position in the list. A negative-valued misc_scalar parameter is interpreted as a device serial number. If a matching device is found, it is set as the "active device" and moved into the first position in the list. If the misc_scalar is higher than N-1, function will return AxErr::DAQMX_DEVICE_NOT_FOUND. If the misc_scalar is less than 0 and the requested device serial number is not found, function will return AxErr::DAQMX_DEVICE_NOT_FOUND.

  • axScanCmd(COUNT_DEVICES, ...) Returns the number of connected DAQmx devices (if AxErr return value > 0, type-cast it to int).

    Counts the number of DAQmx devices currently connected, including both supported and unsupported devices.

  • axScanCmd(SET_MAX_VOLTAGE, ...) Sets the maximum analog waveform voltage a device is allowed to output.

    A device's maximum analog waveform output is set to +/- 10.0 V by default. Use the misc_scalar parameter to set a new maximum value from 0.0 V to 10.0 V on the active device. The minimum voltage will be set to -misc_scalar. This feature is a safeguard against unintentional over-driving of connected scanners; subsequent commands to start scanning will return an error if the programmed scan pattern exceeds the configured voltage limit. This command does not apply to the general purpose DC analog output functionality provided by some devices.

  • axScanCmd(SET_DIGITAL_OUTPUT, misc_scalar, ...) Controls the general purpose digital output.

    Sets the device's general purpose digital output to low/false if misc_scalar = 0 or high/true if misc_scalar = 1.

  • axScanCmd(SET_SQUAREWAVE_OUTPUT, misc_scalar, ...) Controls the general purpose square wave synthesizer.

    Sets the device's general purpose square wave synthesizer to output at a frequency given by misc_scalar in Hz. Use misc_scalar = 0 to turn the squarewave output off.

  • axScanCmd(SET_XSINE_YRAMP_PATTERN, ..., scan_parameters, ...) Configures a raster scan pattern with sinusoidal waveform on the X dimension and linear ramp waveform on the Y dimension.

    Usage is similar to axScanCmd(SET_RECT_PATTERN, ...).

  • axScanCmd(SET_AUX_DC_ANALOG_OUTPUT, misc_scalar, ...) Controls the general purpose DC analog output voltage.

    Sets the device's general purpose DC analog output to a voltage given by misc_scalar in Volts.

  • axScanCmd(SET_AUX_DC_ANALOG_MAX, misc_scalar, ...) Controls the general purpose DC analog output voltage maximum limit.

    Sets the device's maximum general purpose DC analog output to a voltage given by misc_scalar in Volts. This feature is a safeguard against unintentional over-driving of this output terminal; subsequent commands to SET_AUX_DC_ANALOG_OUTPUT will return an error if the requested voltage exceeds the configured limit.

  • axScanCmd(SET_AUX_DC_ANALOG_MIN, misc_scalar, ...) Controls the general purpose DC analog output voltage minimum limit.

    Sets the device's minimum general purpose DC analog output to a voltage given by misc_scalar in Volts. This feature is a safeguard against unintentional over-driving of this output terminal; subsequent commands to SET_AUX_DC_ANALOG_OUTPUT will return an error if the requested voltage exceeds the configured limit.

  • axScanCmd(GET_DEVICE_MODEL_NUMBER, misc_scalar, ...) Returns a device's numeric model number (if AxErr return value > 0, type-cast it to int).

    A list of N connected devices is maintained internally by the library. The misc_scalar parameter sets the device index (from 0 to N-1) on which to query the device model number. If the index is higher than N-1, function will return AxErr::DAQMX_DEVICE_NOT_FOUND.

  • axScanCmd(SET_XSINE_YSINE_PATTERN, ..., scan_parameters, ...) Configures a raster scan pattern with sinusoidal waveforms on the X and Y dimensions.

    Usage is similar to axScanCmd(SET_RECT_PATTERN, ...).

Examples
axScanCmd_example.cpp.

◆ axScanConvert()

AxErr __cdecl axScanConvert ( AOChandle  session,
int32_t  which_window,
uint8_t  convert,
float  inner_radius,
float  outer_radius,
float  crop_inner,
float  crop_outer 
)

Change the polar -> rectangular scan conversion behavior of images displayed in an OpenGL window. (Windows OS only)

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]which_windowSelects which OpenGL window is targeted for this behavior change.
[in]convertThe desired scan conversion behavior (disabled = 0, enabled = 1).
[in]inner_radiusA value on the interval [0..1] which defines the inner edge of the annulus onto which an image's r = 0 data is rendered. (0 = center, 1 = outer edge of uncropped display window)
[in]outer_radiusA value on the interval [0..1] which defines the outer edge of the annulus onto which an image's r = Rmax data is rendered. (0 = center, 1 = outer edge of uncropped display window)
[in]crop_innerA value on the interval [-1..1] which defines the fraction of total image cropped prior to scan conversion in the radial direction from r = 0 outward.
[in]crop_outerA value on the interval [0..2] which defines the fraction of total image cropped prior to scan conversion in the radial direction from r = Rmax inward.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

Polar-to-rectangular scan conversion is useful for displaying images on a cartesian (x,y) display when acquired with a rotational probe or catheter in polar (r,theta) coordinates. For maximized field of view, inner_radius and crop_inner should be set to 0 and outer_radius and crop_outer should be set to 1. Adjusting crop_inner and crop_outer by an equivalent amount will achieve a 'digital Z-offset' radial shifting effect.

◆ axSelectColormap()

AxErr __cdecl axSelectColormap ( AOChandle  session,
int32_t  which_window,
AxColormap  colors 
)

Select the color scheme of images displayed in an OpenGL window. (Windows OS only)

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]which_windowSelects which OpenGL window is targeted for this style change.
[in]colorsThe desired color scheme can be SEPIA, grayscale, inverted GREYSCALE, or a user-defined scheme loaded using axLoadUserColormap (see AxColormap enum).
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

◆ axSelectInterface()

AxErr __cdecl axSelectInterface ( AOChandle  session,
AxInterface  which_interface 
)

Select the data interface (Ethernet, PCIe, or none) for the capture session.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]which_interfaceThe desired interface type to initialize for this session.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

This function will replace/reset an existing interface which was already setup from a previous call to this function. A capture session can only have one associated interface at a time.

Examples
AxsunOCTCapture_example.c, and AxsunOCTCapture_example_NewImageCallback.cpp.

◆ axSelectInterpolation()

AxErr __cdecl axSelectInterpolation ( AOChandle  session,
int32_t  which_window,
uint8_t  interpolation 
)

Change the OpenGL display interpolation mode. (Windows OS only)

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]which_windowSelects which OpenGL window is targeted for this mode change.
[in]interpolationThe desired interpolation mode (bilinear = 0, nearest neighbor = 1).
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

◆ axSetTrigTimeout()

AxErr __cdecl axSetTrigTimeout ( AOChandle  session,
uint32_t  framesUntilForceTrig 
)

Control the behavior of Force Trigger mode.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]framesUntilForceTrigThe number of frames for which the driver will wait for a Image_sync signal before timing out and entering Force Trigger mode. Defaults to 24 frames at session creation. Values outside the range of [2,100] will be automatically coerced into this range.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

The trigger timeout defines the number of consecutive frames for which the driver will wait for a Image_sync signal prior to transitioning into Force Trigger mode. Once in Force Trigger mode, the driver will return the most recently captured frame (256 A-scans) with no synchronization with the Image_sync signal (which is either too slow or absent altogether). The driver will automatically exit Force Trigger mode and re-synchronize with the Image_sync signal as soon as two consecutive Image_sync signals are detected within the timeout period. Set the trigger timeout based on the expected Image_sync signal period of your scanner and the system A-scan rate. For example, assume an effective A-scan rate of 100,000 Hz and a Image_sync period of 33 milliseconds (i.e. a B-scan period determined by the frequency of a scanner running at 30 fps). The trigger timeout is defined in number of frames (consisting of 256 A-scans each), hence the frame time for a 100kHz system is 2.56 milliseconds (=256/100000). A trigger timeout setting of at least 13 frames equaling 33.28 milliseconds (= 2.56 ms * 13) is required to avoid experiencing premature Force Trigger timeout. Setting a trigger timeout several frames larger than the minimum is recommended; however, setting it too high will delay or prevent the transition to Force Trigger mode when desired (e.g. when a Image_sync signal is absent). Remember that the A-scan subsampling feature on the DAQ reduces the effective A-scan rate of the system and could impact the trigger timeout calculation.

Examples
AxsunOCTCapture_example_NewImageCallback.cpp.

◆ axSetupDisplay()

AxErr __cdecl axSetupDisplay ( AOChandle  session,
uint8_t  window_style,
int32_t  w_left,
int32_t  w_top,
int32_t  w_width,
int32_t  w_height,
uintptr_t  linked_window_handle 
)

Setup an OpenGL display window for direct rendering of image data. (Windows OS only)

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]window_styleThe window style: either a floating window with border (=0) or a fixed borderless window (=1).
[in]w_leftThe initial left edge of the window in display coordinates. Also see axUpdateView().
[in]w_topThe initial top edge of the window in display coordinates. Also see axUpdateView().
[in]w_widthThe initial width of the window. Also see axUpdateView().
[in]w_heightThe initial height of the window. Also see axUpdateView().
[in]linked_window_handleThe window handle (HWND) of an existing window to which the OpenGL window is linked in a child or owned relationship. Set this to 0 for creating an OpenGL window with no linked window behavior.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

Any resources allocated or windows created with axSetupDisplay() are automatically deallocated by axStopSession() when terminating the Axsun OCT Capture Session. Arguments set the initial style, size & location, and linked behavior of the OpenGL window at creation but these can be subsequently changed according to the axUpdateWindowStyle(), axUpdateView(), and axLinkedWindow() functions. The window is hidden by default after the session is created. Call axHideWindow() to subsequently show the window. A new window is created every time this function is successfully called; windows are indexed with the "which_window" argument (starting at which_window = 1) in related functions targeting window behavior or appearance.

Examples
AxsunOCTCapture_example.c, and AxsunOCTCapture_example_NewImageCallback.cpp.

◆ axStartSession()

AxErr __cdecl axStartSession ( AOChandle session,
float  capacity_MB 
)

Start an Axsun DAQ imaging session by allocating memory for the Main Image Buffer.

Parameters
[out]sessionPointer to session's opaque handle which will be created by this function and used as an argument for all subsequent function calls specific to this session.
[in]capacity_MBThe desired size (in megabytes) to allocate for the Main Image Buffer.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

axStartSession() is the first method called in a typical implementation of the AxsunOCTCapture API. Sessions started with axStartSession() must be closed with axStopSession() before the client application exits or else resources will be left allocated.

Examples
AxsunOCTCapture_example.c, AxsunOCTCapture_example_LoadExport.cpp, and AxsunOCTCapture_example_NewImageCallback.cpp.

◆ axStopSession()

AxErr __cdecl axStopSession ( AOChandle  session)

Stop a capture session and deallocate all resources, including Main Image Buffer and interfaces.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

axStopSession() is the last function called in a typical implementation using the AxsunOCTCapture API. A session started with axStartSession() must be closed with axStopSession() before the client application exits.

Examples
AxsunOCTCapture_example.c, AxsunOCTCapture_example_LoadExport.cpp, and AxsunOCTCapture_example_NewImageCallback.cpp.

◆ axUpdateView()

AxErr __cdecl axUpdateView ( AOChandle  session,
int32_t  which_window,
int32_t  w_left,
int32_t  w_top,
int32_t  w_width,
int32_t  w_height 
)

Change the OpenGL window size and position. (Windows OS only)

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]which_windowSelects which OpenGL window is targeted for this style change.
[in]w_leftThe left edge of the window in display coordinates (applies to borderless window only).
[in]w_topThe top edge of the window in display coordinates (applies to borderless window only).
[in]w_widthThe width of the window in pixels.
[in]w_heightThe height of the window in pixels.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

Window width and height parameters outside the range [32,4000] will be coerced. The w_left and w_top parameters are ignored when the window style is floating with a border (see axSetupDisplay() and axUpdateWindowStyle()). Windows with this traditional bordered style can be dragged with the mouse cursor to a desired position.

◆ axUpdateWindowStyle()

AxErr __cdecl axUpdateWindowStyle ( AOChandle  session,
int32_t  which_window,
uint8_t  window_style 
)

Change the OpenGL display window style. (Windows OS only)

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]which_windowSelects which OpenGL window is targeted for this style change.
[in]window_styleThe window style: either a floating window with border (=0) or a fixed borderless window (=1).
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

◆ axWriteFPGAarray()

AxErr __cdecl axWriteFPGAarray ( AOChandle  session,
uint16_t  regnum,
uint16_t *  regvals,
int32_t  number_of_words 
)

Write multiple FPGA registers on the Axsun DAQ via the PCIe interface.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]regnumThe unique register number to which the write operation is directed.
[in]regvalsPointer to an array containing 16-bit values to be written.
[in]number_of_wordsThe number of 16-bit register values pointed to by regvals.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure.

◆ axWriteFPGAreg()

AxErr __cdecl axWriteFPGAreg ( AOChandle  session,
uint16_t  regnum,
uint16_t  regval 
)

Write a FPGA register on the Axsun DAQ via the PCIe interface.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]regnumThe unique register number to which the write operation is directed.
[in]regvalThe desired 16-bit value to write.
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

Note that this function does not subsequently query the DAQ hardware to confirm the write was actually successful. A return value of NO_AxERROR only indicates the software's request was made successfully. Call axReadFPGAreg() to confirm hardware register value if desired. FPGA registers are 16-bits wide and all 16-bits must be written atomically. To write individual bits in a register use the axWriteFPGAregBIT() function. axWriteFPGAreg() is functionally equivalent to the AxsunOCTControl.dll library function "SetFPGARegister()" used when connected to the DAQ via Ethernet or USB.

◆ axWriteFPGAregBIT()

AxErr __cdecl axWriteFPGAregBIT ( AOChandle  session,
uint16_t  regnum,
uint8_t  bitnum,
uint8_t  bitval 
)

Write a single bit in an FPGA register on the Axsun DAQ via the PCIe interface.

Parameters
[in]sessionThe opaque handle to the session created with axStartSession().
[in]regnumThe unique register number to which the write operation is directed.
[in]bitnumThe bit number within the desired register. The 16 bits in the register are indexed from 0 (LSB) to 15 (MSB).
[in]bitvalThe value to write (0 = clear bit, 1 = set bit)
Returns
AxErr = NO_AxERROR for success or other AxErr error code on failure. Call axGetErrorString() for a description of an AxErr error code.

Note that this function does not subsequently query the DAQ hardware to confirm the write was actually successful. A return value of NO_AxERROR only indicates the software's request was made successfully. Call axReadFPGAreg() to confirm hardware register value if desired.