HF_IDS_Cam: fast video capture with ImageJ for real-time analysis

Table des matières Installation  ..................................................................................................................................................1  Camera main functions  ..............................................................................................................................1  Tips to optimize video acquisition parameters  ...........................................................................................2  Keyboard shortcuts  ....................................................................................................................................3  Synchronization of the camera with other devices (advanced use)  ...........................................................3  Introduction  .............................................................................................................................................3  Building the input box  .............................................................................................................................3  Instructions to use the input box  .............................................................................................................4  First input (BNC-1: DSR)  ....................................................................................................................4  Second input (BNC-2: CTS)  .................................................................................................................5  Troubleshooting  .........................................................................................................................................5  References  ..................................................................................................................................................5


Introduction
The evolution of video cameras, especially the transition from analog to digital, allowed for a large increase in acquisition frame rates.In a decade, the latter increased from 50-60 frames per second (fps) to above 1000 fps at high resolution.The field of biology has greatly benefited from this development, and the use of such fast cameras is now essential.However, recording speed remains a key issue in studying fast dynamic phenomena.The most concerned research fields certainly are cardiology and neurology, both using fluorescence microscopy to follow the spread of action potentials and fast variations of ionic concentrations in tissues.The kinetic of such phenomena is about tens of milliseconds, but experiments often require several minutes of video recording.Thus, a common problem is the storage of these heavy videos files.An alternative to storage and offline processing is the real-time analysis of the video flow.The well-known image analysis software ImageJ [1] is very effective in this use.
Micromanager software [2], based on ImageJ libraries made video acquisition from a wide range of digital video cameras possible.However, its efficiency is limited for high-speed video acquisitions (e.g., recording speed indication are not always reliable and subsampling modes are not managed, which limits camera speed performances).Therefore, in order to combine fast video recording, analytical power, and ease of use, we developed HF_IDS_Cam, an ImageJ/µManager plugin for video capture from cost-effective and high-performance IDS (Imaging Development Systems) video cameras.HF_IDS_Cam, written in Java, allows for video acquisition at high spatial and tonal resolutions, from low to very high frame rates (above 1000 fps), thus allowing for a very wide range of biological applications and studies (neurodegenerative diseases, cardiac arrhythmias, animal or cell tracking, plants growth, etc.).Moreover, it has been designed to communicate through a serial port to synchronize the camera with other devices (electric stimulators, fast switch perfusion systems, lasers, etc.) a serial port to synchronize the camera with other devices (electric stimulators, fast switch perfusion systems, lasers, etc.)

Materials and Methods
The plug-in for ImageJ was designed to use the drivers from IDS.The Software-Development-Kit (SDK) of the camera only supports C++.However, plug-ins for ImageJ must be developed in Java, so JNA-4.2.1 libraries were used for the communication between the plug-in and the SDK.With Java, code can be developed so that it is independent of the platform and directly compatible with 32 bit and 64 bit operating systems.The general workflow of the HF_IDS_Cam is presented in Figure 1.

Image Acquisition Features and Outputs
The video flow from the camera is directly displayed in ImageJ.As shown in Figure 1, the camera must be selected at program start.At the same time, a log window supplies pieces of information about the camera and its initialization.A dialog box opens, allowing the user to define pixel size and select pixel depth-up to 16 bit-to record fluorescence signals.The user can also use binning and subsampling modes if the camera is compatible.Binning modes allow the user to decrease spatial resolution to increase the maximum acquisition frame rate and the signal amplitude.The subsampling mode can be used to decrease the spatial resolution of the image to reduce its size.Through this dialog box, serial ports can be activated to capture synchronization, and analog signals can be input from other devices (see online information to capture trigger signal at http://pccv.univ-tours.fr/ImageJ/HF_IDS_Cam/).The video flow is then displayed in a traditional ImageJ window.The control panel allows for modification of several parameters of video capture, including signal gain, frame rate, pixel clock, exposure time, brightness, AOI size, and position.Selection of an AOI allows for the limitation of the video reading area so that the frame rate can be increased and the amount of data recorded can be decreased.Size and position adjustment of the AOI are possible during video capture.More detailed explanations of each control are provided in the user guide available online at http://pccv.univ-tours.fr/ImageJ/HF_IDS_Cam/.

Real-Time Video Analysis
During video acquisition, all ImageJ native functions can be used to make manual analysis (e.g., pixel value calibration, thresholding, contrast and brightness adjustments, lookup tables, and pseudo colors, real-time computing of histogram, line profiles, and image calculation).Moreover, the video capture by the HF_IDS_Cam is fully multi-threaded, taking advantage of multicore CPUs, which is useful for the simultaneous analysis of the video by scripts or another ImageJ plug-ins.For instance, the presented method has been successfully used to record contraction of stimulated cardiac myocytes at a sampling rate of 900 Hz with the IDS UI-1220 video camera [3].HF_IDS_Cam has been developed in order to facilitate the synchronization of scripts or macros with each incoming image of the video flow.For that, when a new image is sent by the camera, a value is modified in the IJPrefs file of ImageJ.The expected analysis can thus be performed only one time for each frame, avoiding CPU overload.The approximate CPU (Intel Xeon E3-1241) consumption for a video (1936 × 136 pixel) acquisition at 1000 Hz is 20%, thus leaving 80% of resources for real-time analysis.A more detailed explanation and tips for writing macros and easily synchronizing them with video acquisition are provided online in the user guide.

Synchronizations
The interfacing with serial ports also allows for the easy interaction of analysis with input synchronization and analog signal from other devices (Figure 2).When a synchronization signal arrives on the serial port, the pending image is tagged and one or several actions can be executed by macro.For example, as shown in Figure 2, on each synchronization signal, the mean fluorescence of the rectangular selection is recorded for one second and plotted versus time.The code used to generate the results of Figure 2 is available in a Github repository (https://github.com/PCCV/HF_IDS_Cam).

Figure 2.
Example of online video analysis of fast calcium oscillations in a cardiac myocyte electrically stimulated.This type of analysis enables, for example, real-time measurement of the calcium transient features (e.g., amplitude, duration, rise, and decay time), so the effects of drugs can be directly observed and recorded without having to wait for the end of the experiment.It also avoids having to record the video signal for the entire duration of the experiment.

Limitations and Conclusions
Herein, the described software simplifies simple video analysis with ImageJ native functions and more elaborated analysis with macros, scripts, and plug-ins.Even though this HF_IDS_Cam works under MacOS, the drivers for IDS cameras have been developed only for Windows and Linux, which restricts its use to these two operating systems.However, it is useful for all researchers working with video flows or images, and for teachers and students learning video signal processing and analysis, as it provides a cost-effective solution.