The Intensity Tracing tool allows seamless export of photons counts analyzed data 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 IT02
. 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, bin width, acquisition time, and laser period. This information is printed to the console.After the metadata, the script enters a loop to read and process data in chunks of variable length, depending on the number of active channels. Each chunk represents a data record containing:
Timestamp (8 bytes)
: A double representing the photons’ data acquisition time in seconds.Channel Values (variable length)
: variable number of unsigned integers (4 bytes each) representing photon counts for each active channel at the corresponding timestamp.The script files are automatically downloaded along with the acquisition .bin file once the acquisition 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: FLIM LABS - Intensity Tracing