The FCS (Fluorescence Correlation Spectroscopy) tool allows export of photons intensity vectors correlations (G(τ)), outputted during post-processing, to binary files, with convenient plotting and visualization capabilities. This guide provides an in-depth exploration of the binary file structure, offering a comprehensive understanding of how exported data is formatted and can be leveraged.
Here a detailed explanation of the exported binary data file structure:
The first 4 bytes of the file must be FCS1
. This serves as a validation check to ensure the correct format of the file. If the check fails, the script prints “Invalid data file” and exits.
Following the header, metadata is stored in the file. This includes:
JSON length (4 bytes)
: an unsigned integer representing the length of the JSON metadata.JSON metadata
: this is a variable-length string that contains information about the data, including enabled channels, channels correlations, number of acquisitions, bin width, acquisition time, and additional notes written by the user. This information is printed to the console.After the metadata, the subsequent section, of variable length, contains essential data regarding G(τ) correlations for each pair of correlated channels and the lag index (a vector of tau values used in correlation calculations). The length of this section depends on the number of correlations analyzed, which can range from 1 to 8 channels, resulting in a potential maximum of 64 correlations.
pair of correlated channels
(e.g., (4,8)).mean of all G(τ)
values calculated for the correlated channel pair.G(τ) vectors
computed for the correlated channel pair (the number of G(τ) vectors corresponds to the number of acquisitions performed. For instance, if 5 acquisitions were conducted, the resulting vector will contain 5 G(τ) vectors, with each vector derived from a separate acquisition).The script files are automatically downloaded along with the intensity and fcs .bin files once the acquisition and fcs post-processing is complete and a file name has been chosen. Follow one of the guides below if you wish to use the Python or Matlab script:
Python script:
Open the terminal and navigate to the directory where the saved files are located (it is advisable to save and group them in a folder):
cd YOUR_DOWNLOADED_DATA_ROOT_FOLDER
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
python YOUR_SCRIPT_NAME.py
Matlab script:
Simply open your MATLAB command window prompt and, after navigating to the folder containing the script, type the name of the script to launch it.
For more details about the project follow these links:
Distributed under the MIT License.
FLIM LABS: info@flimlabs.com
Project Link: FCS (Fluorescence Correlation Spectroscopy)