BFModule.BufferAcquisition.clsSeqAcquisition#
- class BFModule.BufferAcquisition.clsSeqAcquisition#
Bases:
clsCircularAcquisition
This class provides the ability to acquire a sequence of images using a BitFlow interface board.
Inheritance Diagram:
- __init__(self: BFModule.BufferAcquisition.clsSeqAcquisition) None #
Methods
AqCleanup
(self)Frees all resources used by the acquisition process.
AqControl
(self, cmd, options)Controls the circular acquisition system.
AqSetup
(self, arg0)Sets up the board for acquisition into a circular buffer queue.
BufferCleanup
(self)Unmap the allocated frame buffers.
BufferSetup
(self, numBuffers[, xoffset, ...])Sets up the board for sequence or circular acquisition by allocating buffer memory and setting registers on the board based on the attached camera file at the time Setup is called.
BufferSetupUser
(*args, **kwargs)Overloaded function.
CXPReadData
(*args, **kwargs)Overloaded function.
CXPReadReg
(*args, **kwargs)Overloaded function.
CXPWriteData
(*args, **kwargs)Overloaded function.
CXPWriteReg
(*args, **kwargs)Overloaded function.
Close
(self)Closes the access to the board and frees all associated resources.
GetAcqStatus
(self)Get the values of the Acquisition status flags.
GetBoardInfo
(self, arg0)Returns information about the board.
GetBoardNumber
(self)Returns the board number of the opened board only valid if opened by board number.
GetCaptureStatus
(self)Outputs the number of frames that have been captured and missed at the moment the function is called.
GetExposureControl
(self)Retrieve the current configuration of the New Timing Generator (NTG) or the Timing Sequencer (TS), which is used to create waveforms to control the line/frame rate and exposure time of cameras.
GetTriggerMode
(self)Gets the trigger mode being used by the board.
GetTriggerPolarity
(self)Gets the trigger polarity being used by the board.
Open
(*args, **kwargs)Overloaded function.
ReadImageFiles
(self, fileName[, NumImages])Reads image files from disk into memory, that were saved with the WriteBuffer and WriteBuffers methods.
RegFieldWidth
(self, arg0)Get the Field Width, in bytes, of the given register index - Linux only
RegId
(self, RegName)Return the frame grabber register ID from its name.
RegName
(self, RegId)Return the frame grabber register name from the given register ID.
RegPeek
(self, RegId)Peek (read) the value of the frame grabber register with ID RegId .
RegPoke
(self, RegId, Value)Poke (write) Value to the frame grabber register with ID RegId .
SWTrigger
(self)Issues a software trigger to the board.
SetExposureControl
(self, arg0)Configure the New Timing Generator (NTG) or the Timing Sequencer (TS), which is used to create waveforms to control the line/frame rate and exposure time of cameras.
SetTriggerMode
(self, triggerMode, ...)Sets the trigger mode for the acquisition engine.
WaitForFrame
(self, timeout)Waits until there is a newly filled buffer.
WaitSequenceDone
(self, arg0)Does an efficient wait for the sequence to be completely captured.
WriteBuffer
(self, fileName, bufferNumber[, ...])Writes one buffer to a file on disk in the BMP, TIFF or RAW file format.
WriteBuffers
(self, fileName, bufferNumber, ...)Writes multiple buffers to a file on disk in the BMP, TIFF or RAW file format.
__init__
(self)getProperties
(self)Returns a BoardProperties object which holds information about the opened framegrabber.
Attributes
Check if Acquisition is setup.
Check if the board is open.
Check if the buffers are setup.
Check if the board is a BitFlow Gen 2 board or not.
- AqCleanup(self: BFModule.BufferAcquisition.clsCircularAcquisition) None #
Frees all resources used by the acquisition process. Makes sure the board is in a stable state.
- Return type:
void
- Raises:
RuntimeError – Board not open.
RuntimeError – Buffers not allocated.
RuntimeError – Acquisition has not been setup.
RuntimeError – Error cleaning up acquisition.
- AqControl(self: BFModule.BufferAcquisition.clsSeqAcquisition, cmd: AcqCommands, options: AcqControlOptions) None #
Controls the circular acquisition system.
- Parameters:
cmd (AcqCommands) – Acquisition command to issue.
options (AcqControlOptions) – Acquisition options.
- Return type:
void
- Raises:
RuntimeError – Board not open.
RuntimeError – Buffers not allocated.
RuntimeError – Acquisition has not been setup.
ValueError – Unknown command parameter being passed to function.
ValueError – Invalid sequence of control commands was used.
RuntimeError – Timed out trying to execute the command.
RuntimeError – Error executing control command.
- AqSetup(self: BFModule.BufferAcquisition.clsCircularAcquisition, arg0: int) None #
Sets up the board for acquisition into a circular buffer queue.
- Parameters:
options (SetupOptions) – Acquisition Setup Options. Options may be OR’ed together. Note: not implemented in Linux.
- Return type:
void
- Raises:
RuntimeError – Board not open.
RuntimeError – Buffers not allocated.
RuntimeError – Error setting up Acquisition.
- BufferCleanup(self: BFModule.BufferAcquisition.clsBufferedAcquisition) None #
Unmap the allocated frame buffers.
- BufferSetup(self: BFModule.BufferAcquisition.clsBufferedAcquisition, numBuffers: int, xoffset: int = 0, yoffset: int = 0, xsize: int = 0, ysize: int = 0) list #
Sets up the board for sequence or circular acquisition by allocating buffer memory and setting registers on the board based on the attached camera file at the time Setup is called.
- Parameters:
numBuffers (int) – Number of buffers to allocate.
xoffset (int) – (Linux only) - Number of pixels to skip at line start (Optional parameter).
yoffset (int) – (Linux only) - Number of rows to skip at frame start (Optional parameter).
xsize (int) – (Linux only) - valid pixels within camera line (Optional parameter).
ysize (int) – (Linux only) - valid rows within frame buffer (Optional parameter).
- Return type:
- Returns:
List of numpy::ndarray.
- BufferSetupUser(*args, **kwargs)#
Overloaded function.
BufferSetupUser(self: BFModule.BufferAcquisition.clsBufferedAcquisition, bufArray: numpy.ndarray[numpy.uint8], numBuffers: int, xoffset: int = 0, yoffset: int = 0, xsize: int = 0, ysize: int = 0) -> list
Sets up the board for sequence or circular acquisition of 8-bit images with buffer memory allocated by the user. The user passes in a list of byte arrays into the method. Sets registers on the board based on the attached camera file at the time Setup is called.
- Parameters:
bufArray (numpy.ndarray) - Numpy array to acquire the images into. Shape of ndarray should be {NumBuffers, YSize, XSize, NumChannels}, dtype = numpy.uint8.
numBuffers (int) - Number of buffers to allocate.
xoffset (int) - (Linux only) Number of pixels to skip at line start (Optional parameter).
yoffset (int) - (Linux only) - Number of rows to skip at frame start (Optional parameter).
xsize (int) - (Linux only) - valid pixels within camera line (Optional parameter).
ysize (int) - (Linux only) - valid rows within frame buffer (Optional parameter).
- Return Type:
py::list
- Returns:
List of numpy::ndarray of the user allocated memory.
BufferSetupUser(self: BFModule.BufferAcquisition.clsBufferedAcquisition, bufArray: numpy.ndarray[numpy.uint16], numBuffers: int, xoffset: int = 0, yoffset: int = 0, xsize: int = 0, ysize: int = 0) -> list
Sets up the board for sequence or circular acquisition of 10-, 12-, or 16-bit images with buffer memory allocated by the user. The user passes in a list of byte arrays into the method. Sets registers on the board based on the attached camera file at the time Setup is called.
- Parameters:
bufArray (numpy.ndarray) - Numpy array to acquire the images into. Shape of ndarray should be {NumBuffers, YSize, XSize, NumChannels}, dtype = numpy.uint16.
numBuffers (int) - Number of buffers to allocate.
xoffset (int) - (Linux only) Number of pixels to skip at line start (Optional parameter).
yoffset (int) - (Linux only) - Number of rows to skip at frame start (Optional parameter).
xsize (int) - (Linux only) - valid pixels within camera line (Optional parameter).
ysize (int) - (Linux only) - valid rows within frame buffer (Optional parameter).
- Return Type:
py::list
- Returns:
List of numpy::ndarray of the user allocated memory.
- CXPReadData(*args, **kwargs)#
Overloaded function.
CXPReadData(self: BFModule.BufferAcquisition.clsBufferedAcquisition, address: int, bytes: int) -> list[int]
Read from CXP data space (buffer size should be multiple of 4) on the Master Link.
- Parameters:
- Return Type:
- Returns:
Value of the specified register.
- Raises:
ValueError
The board is not a CXP device.RuntimeError
Timed out waiting for acknowledgement.RuntimeError
Error code in acknowledgement from camera.
CXPReadData(self: BFModule.BufferAcquisition.clsBufferedAcquisition, link: int, address: int, bytes: int) -> list[int]
Read from CXP data space (buffer size should be multiple of 4) on the link specified.
- Parameters:
- Return Type:
- Returns:
Value of the specified register.
- Raises:
ValueError
The board is not a CXP device.RuntimeError
Timed out waiting for acknowledgement.RuntimeError
Error code in acknowledgement from camera.
- CXPReadReg(*args, **kwargs)#
Overloaded function.
CXPReadReg(self: BFModule.BufferAcquisition.clsBufferedAcquisition, address: int) -> int
Read the value of a single CoaXPress register on the master link.
- Parameters:
address (
int
) - The byte address of the first register to be read.
- Return Type:
- Returns:
Value of the specified register.
- Raises:
ValueError
The board is not a CXP device.RuntimeError
Timed out waiting for acknowledgement.RuntimeError
Error code in acknowledgement from camera.
CXPReadReg(self: BFModule.BufferAcquisition.clsBufferedAcquisition, link: int, address: int) -> int
Read the value of a single CoaXPress register on the link specified.
- Parameters:
- Return Type:
- Returns:
Value of the specified register.
- Raises:
ValueError
The board is not a CXP device.RuntimeError
Timed out waiting for acknowledgement.RuntimeError
Error code in acknowledgement from camera.
- CXPWriteData(*args, **kwargs)#
Overloaded function.
CXPWriteData(self: BFModule.BufferAcquisition.clsBufferedAcquisition, address: int, data: list[int]) -> None
Write to CXP data space on the master link.
- Parameters:
- Return Type:
void
- Raises:
ValueError
The board is not a CXP device.RuntimeError
Timed out waiting for acknowledgement.RuntimeError
Error code in acknowledgement from camera.
CXPWriteData(self: BFModule.BufferAcquisition.clsBufferedAcquisition, link: int, address: int, data: list[int]) -> None
Write to CXP data space on the link specified.
- Parameters:
- Return Type:
void
- Raises:
ValueError
The board is not a CXP device.RuntimeError
Timed out waiting for acknowledgement.RuntimeError
Error code in acknowledgement from camera.
- CXPWriteReg(*args, **kwargs)#
Overloaded function.
CXPWriteReg(self: BFModule.BufferAcquisition.clsBufferedAcquisition, address: int, value: int) -> None
Write the value of a single CoaXPress register on the Master link.
- Parameters:
- Return Type:
void
- Raises:
ValueError
The board is not a CXP device.RuntimeError
Timed out waiting for acknowledgement.RuntimeError
Error code in acknowledgement from camera.
CXPWriteReg(self: BFModule.BufferAcquisition.clsBufferedAcquisition, link: int, address: int, value: int) -> None
Write the value of a single CoaXPress register on the link specified.
- Parameters:
- Return Type:
void
- Raises:
ValueError
The board is not a CXP device.RuntimeError
Timed out waiting for acknowledgement.RuntimeError
Error code in acknowledgement from camera.
- Close(self: BFModule.BufferAcquisition.clsBufferedAcquisition) None #
Closes the access to the board and frees all associated resources.
- GetAcqStatus(self: BFModule.BufferAcquisition.clsBufferedAcquisition) BFModule.BufferAcquisition.AcqStatus #
Get the values of the Acquisition status flags.
- Return type:
- GetBoardInfo(self: BFModule.BufferAcquisition.clsBufferedAcquisition, arg0: enumInquireParams) int #
Returns information about the board.
- Parameters:
brdInqVariable (InquireParams) – The parameter to find the value of.
- Return type:
- Returns:
Value for the inquired parameter.
- GetBoardNumber(self: BFModule.BufferAcquisition.clsBufferedAcquisition) int #
Returns the board number of the opened board only valid if opened by board number.
- Return type:
- Returns:
Board number
- GetCaptureStatus(self: BFModule.BufferAcquisition.clsBufferedAcquisition) list[int] #
Outputs the number of frames that have been captured and missed at the moment the function is called.
- Return type:
- Returns:
a list of 2 elements containing the number of Captured frames at index 0, and the number of missed frames at index 1.
- GetExposureControl(self: BFModule.BufferAcquisition.clsBufferedAcquisition) ExposureControl #
Retrieve the current configuration of the New Timing Generator (NTG) or the Timing Sequencer (TS), which is used to create waveforms to control the line/frame rate and exposure time of cameras.
- Return type:
- Returns:
The current NTG or TS configuration.
- GetTriggerMode(self: BFModule.BufferAcquisition.clsBufferedAcquisition) TriggerModes #
Gets the trigger mode being used by the board.
- Return type:
- Returns:
The trigger mode being used by the board.
- GetTriggerPolarity(self: BFModule.BufferAcquisition.clsBufferedAcquisition) TriggerPolarity #
Gets the trigger polarity being used by the board.
- Returns:
TriggerPolarity - The trigger polarity being used by the board.
- Open(*args, **kwargs)#
Overloaded function.
Open(self: BFModule.BufferAcquisition.clsBufferedAcquisition, CLonly: bool = False, modeFlag: BFModule.BufferAcquisition.BoardOpenOptions = <BoardOpenOptions.Initialize: 1>) -> None
Display the available boards and open the selected board for access
- Parameters:
CLonly (
bool
) - Only display available CameraLink boards. (Optional)modeFlag (
BoardOpenOptions
) - Board access mode flags. (Optional)
- Return Type:
void
- Raises:
RuntimeError
- Failed to get number of boards.RuntimeError
- Failed to get board information.RuntimeError
- Failed to open board.RuntimeError
- Failed to initialize board.
Open(self: BFModule.BufferAcquisition.clsBufferedAcquisition, sNdx: int, modeFlags: BFModule.BufferAcquisition.BoardOpenOptions = <BoardOpenOptions.Initialize: 1>) -> None
Opens a board for access with the given Options.
- Parameters:
sNdx (
int
) - /dev/video<Ndx> access.modeFlag (
BoardOpenOptions
) - Board access mode flags. (Optional)
- Return Type:
void
- Raises:
RuntimeError
- Failed to get number of boards.RuntimeError
- Failed to get board information.RuntimeError
- Failed to open board.RuntimeError
- Failed to initialize board.
Open(self: BFModule.BufferAcquisition.clsBufferedAcquisition, sNdx: int, camFileName: str, modeFlags: BFModule.BufferAcquisition.BoardOpenOptions = <BoardOpenOptions.Initialize: 1>) -> None
Opens a board for access with the given Options, and load the given camera file. The environment variable BITFLOW_INSTALL_DIRS must be set if path does not contain a ‘/’. If path contains a ‘/’ then the fileName is relative to the current directory. If path begins with ‘/’ then it is absolute. If the path contains a ‘/’ then the file name is case sensitive.
- Parameters:
sNdx (
int
) - /dev/video<Ndx> access.camFileName (
str
) - [path][mode@]fileNamemodeFlag (
BoardOpenOptions
) - Board access mode flags. (Optional)
- Return Type:
void
- Raises:
RuntimeError
- Failed to get number of boards.RuntimeError
- Failed to get board information.RuntimeError
- Failed to open board.RuntimeError
- Failed to initialize board.
- ReadImageFiles(self: BFModule.BufferAcquisition.clsBufferedAcquisition, fileName: str, NumImages: int = 1) None #
Reads image files from disk into memory, that were saved with the WriteBuffer and WriteBuffers methods.
- Parameters:
- Return type:
void.
- Raises:
RuntimeError – Board not open.
RuntimeError – Buffers not allocated.
ValueError – Number of images greater than the number of buffers allocated.
ValueError – Unsupported Image file extension. Currently supported formats: TIFF.
RuntimeError – Unable to open TIFF file.
RuntimeError – Image file dimensions don’t match the Buffer dimensions.
RuntimeError – Unable to open TIFF file.
- RegFieldWidth(self: BFModule.BufferAcquisition.clsBufferedAcquisition, arg0: int) int #
Get the Field Width, in bytes, of the given register index - Linux only
- Parameters:
RegId (int) – The ID of the frame grabber register whose field width is to be returned.
- Returns:
int - Field width in bytes of the register corresponding to the register ID. -1 if invalid register index.
- RegId(self: BFModule.BufferAcquisition.clsBufferedAcquisition, RegName: str) int #
Return the frame grabber register ID from its name.
The ID is used in conjunction with the BFRegPeek and BFRegPoke methods. The ID of any given register may change betwee releases, but the RegName will always remain the same. The ID returned by this function can be converted back into the register name, RegName using the BFRegName function.
The ID value will be static for any given release of the BitFlow SDK, but may change with even a minor release.
- Parameters:
RegName (str) – The name of the desired frame grabber register. This value is case sensitive.
- Returns:
int - The ID of the named register, RegName.
- RegName(self: BFModule.BufferAcquisition.clsBufferedAcquisition, RegId: int) str #
Return the frame grabber register name from the given register ID.
This function iteratively retrieves the string name of every frame grabber register available on the currently open board. The name and ID pairing used by this function is the same used by BFRegId, and valid values of RegId may be used with BFRegPeek and BFRegPoke functions, as well. The ID value will be static for any given release of the BitFlow SDK, but may change with even a minor release.
- Parameters:
RegId (int) – The ID of the frame grabber register whose name is to be returned.
- Returns:
string - The string name corresponding to the register ID, or an empty string.
- RegPeek(self: BFModule.BufferAcquisition.clsBufferedAcquisition, RegId: int) int #
Peek (read) the value of the frame grabber register with ID RegId . Retrieve the ID of a named register using BFRegId.
- Parameters:
RegId (int) – The ID of the frame grabber register to peek.
- Returns:
int - The value peeked from the specified frame grabber register, RegId . Undefined, if RegId does not match an available register.
- RegPoke(self: BFModule.BufferAcquisition.clsBufferedAcquisition, RegId: int, Value: int) None #
Poke (write) Value to the frame grabber register with ID RegId . Retrieve the ID of a named register using BFRegId.
- SWTrigger(self: BFModule.BufferAcquisition.clsBufferedAcquisition) None #
Issues a software trigger to the board.
- SetExposureControl(self: BFModule.BufferAcquisition.clsBufferedAcquisition, arg0: ExposureControl) None #
Configure the New Timing Generator (NTG) or the Timing Sequencer (TS), which is used to create waveforms to control the line/frame rate and exposure time of cameras.
- Parameters:
exp (ExposureControl) – The
ExposureControl
struct.- Return type:
void
- SetTriggerMode(self: BFModule.BufferAcquisition.clsBufferedAcquisition, triggerMode: int, triggerPolarity: int) None #
Sets the trigger mode for the acquisition engine.
- Parameters:
triggerMode (TriggerModes) – The trigger mode to setup for acquisition.
triggerPolarity (TriggerPolarity) – Determines the polarity of the when the trigger should occur, on a rising or falling egde.
- Return type:
void
- WaitForFrame(self: BFModule.BufferAcquisition.clsCircularAcquisition, timeout: int) BFModule.BufferAcquisition.BufferInfo #
Waits until there is a newly filled buffer. Returns when the buffer is filled, stopped, aborted, error occurs or when the clean up function is called.
- Params int timeout:
Timeout value in milliseconds.
- Return type:
- Returns:
BufferInfo object which contains information about the latest acquired buffer.
- Raises:
RuntimeError – Board not open.
RuntimeError – Buffers not allocated.
RuntimeError – Acquisition has not been setup.
RuntimeError – Circular acquisition has been stopped.
RuntimeError – Circular acquisition has been aborted.
RuntimeError – Wait for multiple objects timed out.
RuntimeError – Wait for multiple objects failed.
RuntimeError – The queue is empty.
- WaitSequenceDone(self: BFModule.BufferAcquisition.clsSeqAcquisition, arg0: int) None #
Does an efficient wait for the sequence to be completely captured.
- WriteBuffer(self: BFModule.BufferAcquisition.clsBufferedAcquisition, fileName: str, bufferNumber: int, writeBufferOptions: int = 0) None #
Writes one buffer to a file on disk in the BMP, TIFF or RAW file format.
- Parameters:
fileName (str) – The file name to be saved to disk. The file name should be the full path along with the the file extension.
bufferNumber (int) – The number of the buffer to be written to disk.
writeBufferOptions (WriteOptions) – The options for saving a buffer to disk. The WriteOptions may be OR’ed together. (Does not work on Linux. Only saving TIF files is supported.)
- Return type:
void
- Raises:
RuntimeError – Board not open.
RuntimeError – Buffers not allocated.
IndexError – Buffer Number greater than the number of buffers allocated.
ValueError – Invalid argument.
- WriteBuffers(self: BFModule.BufferAcquisition.clsBufferedAcquisition, fileName: str, bufferNumber: int, StartNum: int, writeBufferOptions: int = 0) None #
Writes multiple buffers to a file on disk in the BMP, TIFF or RAW file format.
- Parameters:
fileName (str) – The file name to be saved to disk. The file name should be the full path along with the the file extension.
bufferNumber (int) – The number of the buffer to be written to disk.
StartNum (int) – Specifies the first number to start the file names with. If StartNum = 5, the first file name will be “XXXX00000005.BMP”, but contain image data from buffer 0.
writeBufferOptions (WriteOptions) – The options for saving a buffer to disk. The WriteOptions may be OR’ed together. (Does not work on Linux. Only saving TIF files is supported.)
- Return type:
void
- Raises:
RuntimeError – Board not open.
RuntimeError – Buffers not allocated.
IndexError – Buffer Number greater than the number of buffers allocated.
ValueError – Invalid argument.
- getProperties(self: BFModule.BufferAcquisition.clsBufferedAcquisition) BFModule.BufferAcquisition.BoardProperties #
Returns a BoardProperties object which holds information about the opened framegrabber.
- Returns:
BoardProperties.
- property isAqSetup#
Check if Acquisition is setup.
- Return type:
- Returns:
TRUE if the acquisition has been setup, FALSE otherwise
- property isBoardOpen#
Check if the board is open.
- Return type:
- Returns:
TRUE if the board is open, FALSE otherwise
- property isBufSetup#
Check if the buffers are setup.
- Return type:
- Returns:
TRUE if the buffers are setup, FALSE otherwise