#include <TTTRHeader.h>
|
static nlohmann::json | get_tag (nlohmann::json json_data, const std::string &name, int idx=-1) |
|
static int | find_tag (nlohmann::json &json_data, const std::string &name, int idx=-1) |
|
static void | add_tag (nlohmann::json &json_data, const std::string &name, std::any value, unsigned int type=tyAnsiString, int idx=-1) |
|
static size_t | read_ptu_header (std::FILE *fpin, int &tttr_record_type, nlohmann::json &json_data, bool rewind=true) |
| Reads the header of a PTU file and sets the reading routing.
|
|
static size_t | read_ht3_header (std::FILE *fpin, nlohmann::json &data, bool rewind=true) |
| Reads the header of an HT3 file and sets the reading routing.
|
|
static size_t | read_bh132_header (std::FILE *fpin, nlohmann::json &data, bool rewind=true) |
| Reads the header of a Becker & Hickel SPC132 file and sets the reading routing.
|
|
static size_t | read_cz_confocor3_header (std::FILE *fpin, nlohmann::json &data, bool rewind=true) |
| Reads the header of a Carl Zeiss (CZ) Confocor3 file and sets the reading routing.
|
|
static void | write_spc132_header (std::string fn, TTTRHeader *header, std::string modes="w") |
|
static void | write_ptu_header (std::string fn, TTTRHeader *header, std::string modes="wb") |
|
static void | write_ht3_header (std::string fn, TTTRHeader *header, std::string modes="wb") |
|
◆ TTTRHeader() [1/5]
TTTRHeader::TTTRHeader |
( |
| ) |
|
◆ TTTRHeader() [2/5]
TTTRHeader::TTTRHeader |
( |
int | tttr_container_type | ) |
|
◆ TTTRHeader() [3/5]
◆ TTTRHeader() [4/5]
TTTRHeader::TTTRHeader |
( |
std::FILE * | fpin, |
|
|
int | tttr_container_type = 0, |
|
|
bool | close_file = false ) |
◆ TTTRHeader() [5/5]
TTTRHeader::TTTRHeader |
( |
std::string | fn, |
|
|
int | tttr_container_type = 0 ) |
◆ ~TTTRHeader()
TTTRHeader::~TTTRHeader |
( |
| ) |
|
|
default |
◆ add_tag()
static void TTTRHeader::add_tag |
( |
nlohmann::json & | json_data, |
|
|
const std::string & | name, |
|
|
std::any | value, |
|
|
unsigned int | type = tyAnsiString, |
|
|
int | idx = -1 ) |
|
static |
Add a meta data tag. If the tag already exists the value of the meta data tag is replaced.
- Parameters
-
json_data | |
name | |
value | |
type | |
idx | |
◆ end()
size_t TTTRHeader::end |
( |
| ) |
const |
|
inline |
◆ find_tag()
static int TTTRHeader::find_tag |
( |
nlohmann::json & | json_data, |
|
|
const std::string & | name, |
|
|
int | idx = -1 ) |
|
static |
Find the index of a tag in the JSON data by name type and index
- Parameters
-
- Returns
◆ get_bytes_per_record()
size_t TTTRHeader::get_bytes_per_record |
( |
| ) |
|
|
inline |
Stores the bytes per TTTR record of the associated TTTR file This attribute is changed when a header is read
◆ get_effective_number_of_micro_time_channels()
unsigned int TTTRHeader::get_effective_number_of_micro_time_channels |
( |
| ) |
|
|
inline |
The number of micro time channels that fit between two macro times.
The total (possible) number of TAC channels can exceed the number that fit between two macro time channels. This function returns the effective number, i.e., the number of micro time channels between two macro times. The micro time channels that are outside of this bound should (usually) not be filled.
- Returns
- effective_tac_channels (that fit between to macro times)
◆ get_json()
std::string TTTRHeader::get_json |
( |
std::string | tag_name = "", |
|
|
int | idx = -1, |
|
|
int | indent = 1 ) |
Get a representation of the TTTRHeader meta data as a JSON string
- Parameters
-
tag_name | name of requested tag (if no name is provided) the entire information in the TTTRHeader is returned |
idx | index of the tag |
indent | an integer that controls the indent in the returned JSON string |
- Returns
◆ get_line_duration()
int TTTRHeader::get_line_duration |
( |
| ) |
|
|
inline |
Duration of a line in LSM in units of macro time clock.
◆ get_macro_time_resolution()
double TTTRHeader::get_macro_time_resolution |
( |
| ) |
|
Resolution for the macro time in nanoseconds.
◆ get_micro_time_resolution()
double TTTRHeader::get_micro_time_resolution |
( |
| ) |
|
|
inline |
Resolution for the micro time in nanoseconds.
◆ get_number_of_micro_time_channels()
unsigned int TTTRHeader::get_number_of_micro_time_channels |
( |
| ) |
|
|
inline |
The total (possible) number of micro time channels.
The number of TAC channels (TAC - Time to analog converter) refers to the number of micro time channels.
◆ get_pixel_duration()
int TTTRHeader::get_pixel_duration |
( |
| ) |
|
|
inline |
Duration of a pixel in LSM in units of macro time clock.
◆ get_tag()
static nlohmann::json TTTRHeader::get_tag |
( |
nlohmann::json | json_data, |
|
|
const std::string & | name, |
|
|
int | idx = -1 ) |
|
static |
Get a tag / entry from the meta data list in a JSON dict
- Parameters
-
- Returns
◆ get_tttr_container_type()
int TTTRHeader::get_tttr_container_type |
( |
| ) |
|
|
inline |
The container type
- Returns
◆ get_tttr_record_type()
int TTTRHeader::get_tttr_record_type |
( |
| ) |
|
|
inline |
- Returns
- The TTTR container type of the associated TTTR file as a char
◆ operator[]() [1/2]
nlohmann::json & TTTRHeader::operator[] |
( |
std::size_t | idx | ) |
|
|
inline |
◆ operator[]() [2/2]
const nlohmann::json & TTTRHeader::operator[] |
( |
std::size_t | idx | ) |
const |
|
inline |
◆ read_bh132_header()
static size_t TTTRHeader::read_bh132_header |
( |
std::FILE * | fpin, |
|
|
nlohmann::json & | data, |
|
|
bool | rewind = true ) |
|
static |
Reads the header of a Becker & Hickel SPC132 file and sets the reading routing.
- Parameters
-
fpin | File pointer to the SPC132 file. |
data | Output parameter for JSON data. |
rewind | Flag to indicate whether to rewind the file (default is true). |
- Returns
- The position of the file pointer at the end of the header.
◆ read_cz_confocor3_header()
static size_t TTTRHeader::read_cz_confocor3_header |
( |
std::FILE * | fpin, |
|
|
nlohmann::json & | data, |
|
|
bool | rewind = true ) |
|
static |
Reads the header of a Carl Zeiss (CZ) Confocor3 file and sets the reading routing.
- Parameters
-
fpin | File pointer to the Confocor3 file. |
data | Output parameter for JSON data. |
rewind | Flag to indicate whether to rewind the file (default is true). |
- Returns
- The position of the file pointer at the end of the header.
◆ read_ht3_header()
static size_t TTTRHeader::read_ht3_header |
( |
std::FILE * | fpin, |
|
|
nlohmann::json & | data, |
|
|
bool | rewind = true ) |
|
static |
Reads the header of an HT3 file and sets the reading routing.
- Parameters
-
fpin | File pointer to the HT3 file. |
data | Output parameter for JSON data. |
rewind | Flag to indicate whether to rewind the file (default is true). |
- Returns
- The position of the file pointer at the end of the header.
◆ read_ptu_header()
static size_t TTTRHeader::read_ptu_header |
( |
std::FILE * | fpin, |
|
|
int & | tttr_record_type, |
|
|
nlohmann::json & | json_data, |
|
|
bool | rewind = true ) |
|
static |
Reads the header of a PTU file and sets the reading routing.
- Parameters
-
fpin | File pointer to the PTU file. |
tttr_record_type | Output parameter for the TTTR record type. |
json_data | Output parameter for JSON data. |
rewind | Flag to indicate whether to rewind the file (default is true). |
- Returns
- The position of the file pointer at the end of the header.
◆ set_json()
void TTTRHeader::set_json |
( |
std::string | json_string | ) |
|
|
inline |
Set / update the TTTRHeader meta data using a JSON string
- Parameters
-
◆ set_tttr_container_type()
void TTTRHeader::set_tttr_container_type |
( |
int | v | ) |
|
|
inline |
◆ set_tttr_record_type()
void TTTRHeader::set_tttr_record_type |
( |
int | v | ) |
|
|
inline |
◆ size()
size_t TTTRHeader::size |
( |
| ) |
|
|
inline |
Number of meta data entries
◆ write_ht3_header()
static void TTTRHeader::write_ht3_header |
( |
std::string | fn, |
|
|
TTTRHeader * | header, |
|
|
std::string | modes = "wb" ) |
|
static |
Write a HT3 header to a file
WARNING: If the default write mode is "wb". Existing files are overwritten.
- Parameters
-
fn | filename |
header | pointer to the TTTRHeader object that is written to the file |
modes | the writing modes (default 'wb') |
◆ write_ptu_header()
static void TTTRHeader::write_ptu_header |
( |
std::string | fn, |
|
|
TTTRHeader * | header, |
|
|
std::string | modes = "wb" ) |
|
static |
Write a PTU header to a file
WARNING: If the default write mode is "wb". Existing files are overwritten.
- Parameters
-
fn | filename |
header | pointer to the TTTRHeader object that is written to the file |
modes | the writing modes (default 'wb') |
◆ write_spc132_header()
static void TTTRHeader::write_spc132_header |
( |
std::string | fn, |
|
|
TTTRHeader * | header, |
|
|
std::string | modes = "w" ) |
|
static |
Write a spc132 header to a file
WARNING: If the default write mode is "wb". Existing files are overwritten.
- Parameters
-
fn | filename |
header | pointer to the TTTRHeader object that is written to the file |
modes | the writing modes (default 'w+b') |
◆ TTTR
◆ header_end
size_t TTTRHeader::header_end = 0 |
|
protected |
Marks the end of the header in the file (position in file)
◆ json_data
nlohmann::json TTTRHeader::json_data |
|
protected |
The documentation for this class was generated from the following file: