tttrlib
A library for time-tagged time resolved data
|
#include <CLSMImage.h>
Public Member Functions | |
std::shared_ptr< TTTR > | get_tttr () |
void | set_tttr (std::shared_ptr< TTTR > v) |
const CLSMSettings * | get_settings () |
size_t | size () |
Get the number of frames in the CLSMImage. | |
void | fill (TTTR *tttr_data=nullptr, std::vector< int > channels=std::vector< int >(), bool clear=true, const std::vector< std::pair< int, int > > µ_time_ranges=std::vector< std::pair< int, int > >()) |
Fills the time-tagged time-resolved (TTTR) indices of the pixels with the indices of the photons that fall within each pixel. | |
void | fill_pixels (TTTR *tttr_data, std::vector< int > channels, bool clear_pixel=true, std::vector< std::pair< int, int > > micro_time_ranges=std::vector< std::pair< int, int > >()) |
Fills the time-tagged time-resolved (TTTR) indices of the pixels with the indices of the channels that fall within each pixel. | |
void | clear () |
Clears the time-tagged time-resolved (TTTR) indices stored in the pixels. | |
void | clear_pixels () |
Clears the time-tagged time-resolved (TTTR) indices stored in the pixels. | |
void | strip (const std::vector< int > &tttr_indices, int offset=0) |
Strips time-tagged time-resolved (TTTR) indices from all pixels in the image. | |
void | get_fcs_image (float **output, int *dim1, int *dim2, int *dim3, int *dim4, std::shared_ptr< TTTR > tttr, CLSMImage *clsm_other=nullptr, std::string correlation_method="default", int n_bins=50, int n_casc=1, bool stack_frames=false, bool normalized_correlation=false, int min_photons=2) |
Computes an image where pixels represent correlation curves. | |
std::vector< CLSMFrame * > | get_frames () |
Retrieves the frames stored in the CLSMImage. | |
void | get_intensity (unsigned short **output, int *dim1, int *dim2, int *dim3) |
Computes an intensity image. | |
void | get_fluorescence_decay (TTTR *tttr_data, unsigned char **output, int *dim1, int *dim2, int *dim3, int *dim4, int micro_time_coarsening=1, bool stack_frames=false) |
Computes an image stack where the value of each pixel corresponds to a histogram of micro times in each pixel. The micro times can be coarsened by integer numbers. | |
void | get_decay_of_pixels (TTTR *tttr_data, uint8_t *mask, int dmask1, int dmask2, int dmask3, unsigned int **output, int *dim1, int *dim2, int tac_coarsening, bool stack_frames) |
Computes micro time histograms for the stacks of images and a selection of pixels. Photons in pixels that are selected by the selection array contribute to the returned array of micro time histograms. | |
void | get_mean_micro_time (TTTR *tttr_data, double **output, int *dim1, int *dim2, int *dim3, double microtime_resolution=-1.0, int minimum_number_of_photons=2, bool stack_frames=false) |
Calculates an image stack where the value of each pixel corresponds to the mean micro time (in units of the micro channel resolution). | |
void | get_phasor (float **output, int *dim1, int *dim2, int *dim3, int *dim4, TTTR *tttr_data, TTTR *tttr_irf=nullptr, double frequency=-1, int minimum_number_of_photons=2, bool stack_frames=false) |
Computes the phasor values for every pixel. | |
void | get_mean_lifetime (TTTR *tttr_data, double **output, int *dim1, int *dim2, int *dim3, int minimum_number_of_photons=3, TTTR *tttr_irf=nullptr, double m0_irf=1.0, double m1_irf=1.0, bool stack_frames=false, std::vector< double > background=std::vector< double >(), double m0_bg=0.0, double m1_bg=0.0, double background_fraction=-1.0) |
Computes an image of average lifetimes. | |
int | to1D (int frame, int line, int pixel) |
Convert three-dimensional coordinates (frame, line, pixel) to a one-dimensional index. | |
std::vector< int > | to3D (int idx) |
Convert a one-dimensional index to three-dimensional coordinates (frame, line, pixel). | |
CLSMPixel * | getPixel (unsigned int idx) |
Get a pointer to a CLSMPixel object based on a one-dimensional index. | |
int | get_n_frames () const |
Get the number of frames in the CLSM image. | |
int | get_n_lines () const |
Get the number of lines per frame in the CLSMImage. | |
int | get_n_pixel () const |
Get the number of pixels per line in a frame of the CLSMImage. | |
void | copy (const CLSMImage &p2, bool fill=false) |
Copy information from another CLSMImage object. | |
void | append (CLSMFrame *frame) |
Append a CLSMFrame to the CLSM image. | |
void | transform (unsigned int *input, int n_input) |
Move the content of the Pixels based on source and target pixel indices. | |
void | rebin (int bin_line, int bin_pixel) |
Rebin a CLSMImage. | |
void | distribute (unsigned int pixel_id, CLSMImage *target, std::vector< int > &target_pixel_ids, std::vector< int > &target_probabilities) |
Distribute the photons of a pixel_id to a set of pixel ids in a target image according to provided probabilities. | |
void | crop (int frame_start, int frame_stop, int line_start, int line_stop, int pixel_start, int pixel_stop) |
Crop the CLSMImage. | |
void | stack_frames () |
Stack frames in the CLSMImage. | |
CLSMImage (const CLSMImage &p2, bool fill=false) | |
Copy constructor for CLSMImage. | |
CLSMImage (std::shared_ptr< TTTR > tttr_data=nullptr, CLSMSettings settings=CLSMSettings(), CLSMImage *source=nullptr, bool fill=true, std::vector< int > channels=std::vector< int >(), std::vector< std::pair< int, int > > micro_time_ranges=std::vector< std::pair< int, int > >()) | |
Constructs a CLSMImage object from TTTR data. | |
virtual | ~CLSMImage () |
Destructor for CLSMImage. | |
CLSMFrame * | operator[] (unsigned int i_frame) |
Accessor for CLSMFrame at the specified index in CLSMImage. | |
double | get_line_duration (int frame=0, int line=0) |
Obtains the duration of a line (in milliseconds) for a specified frame and line. | |
double | get_pixel_duration (int frame=0, int line=0) |
Obtains the duration of a pixel (in milliseconds) for a specified frame and line. | |
Static Public Member Functions | |
static void | compute_ics (double **output, int *dim1, int *dim2, int *dim3, std::shared_ptr< TTTR > tttr_data=nullptr, CLSMImage *clsm=nullptr, double *images=nullptr, int input_frames=-1, int input_lines=-1, int input_pixel=1, std::vector< int > x_range=std::vector< int >({0, -1}), std::vector< int > y_range=std::vector< int >({0, -1}), std::vector< std::pair< int, int > > frames_index_pairs=std::vector< std::pair< int, int > >(), std::string subtract_average="", uint8_t *mask=nullptr, int dmask1=-1, int dmask2=-1, int dmask3=-1) |
Performs an image correlation spectroscopy analysis via FFTs for a set of frames. | |
static void | get_roi (double **output, int *dim1, int *dim2, int *dim3, CLSMImage *clsm=nullptr, std::vector< int > x_range=std::vector< int >({0,-1}), std::vector< int > y_range=std::vector< int >({0,-1}), std::string subtract_average="", double background=0.0, bool clip=false, double clip_max=1e6, double clip_min=-1e6, double *images=nullptr, int n_frames=-1, int n_lines=-1, int n_pixels=1, uint8_t *mask=nullptr, int dmask1=-1, int dmask2=-1, int dmask3=-1, std::vector< int > selected_frames=std::vector< int >()) |
Copies a region of interest (ROI) from the input images, performs background correction, and stores the result in a new array. | |
static std::vector< int > | get_frame_edges (TTTR *tttr=nullptr, int start_event=0, int stop_event=-1, std::vector< int > marker_frame_start=std::vector< int >({4, 6}), int marker_event_type=15, int reading_routine=CLSM_SP8, bool skip_before_first_frame_marker=false, bool skip_after_last_frame_marker=false) |
Retrieves the time-tagged time-resolved (TTTR) indices of frame markers for a Leica SP8 microscope. | |
static std::vector< int > | get_line_edges (TTTR *tttr, int start_event, int stop_event, int marker_line_start=1, int marker_line_stop=2, int marker_event_type=15, int reading_routine=CLSM_SP8) |
Identifies line edges by reading start and stop markers in a time-tagged time-resolved (TTTR) dataset. | |
static std::vector< int > | get_line_edges_by_duration (TTTR *tttr, int start_event, int stop_event, int marker_line_start=1, int line_duration=2, int marker_event_type=15, int reading_routine=CLSM_SP8) |
Identifies line edges by reading a start marker and using line duration as the stop criterion in a time-tagged time-resolved (TTTR) dataset. | |
Public Attributes | |
std::vector< int > | marker_frame |
Vector containing the tttr indices of the frame markers. | |
int | marker_line_start |
Defines the marker for a line start. | |
int | marker_line_stop |
Defines the marker for a line stop. | |
int | marker_event |
The event type used for the marker. | |
std::string | reading_routine = "default" |
bool | skip_before_first_frame_marker = false |
bool | skip_after_last_frame_marker = false |
Protected Member Functions | |
void | create_frames (bool clear_first=true) |
void | create_lines () |
void | determine_number_of_lines () |
Protected Attributes | |
size_t | n_frames = 0 |
The number of frames in an CLSMImage. | |
size_t | n_lines = 0 |
The number of lines per frames. | |
size_t | n_pixel = 0 |
The number if pixels per line. | |
std::shared_ptr< TTTR > | tttr = nullptr |
Pointer to tttr data that used to construct the Image. | |
Friends | |
class | Correlator |
class | CLSMFrame |
class | CLSMLine |
class | CLSMPixel |
CLSMImage::CLSMImage | ( | const CLSMImage & | p2, |
bool | fill = false ) |
|
explicit |
Constructs a CLSMImage object from TTTR data.
Constructs a CLSMImage object from Time-Tagged Time-Resolved (TTTR) data, using specified markers, settings, and optional source CLSMImage.
tttr_data | [in] Pointer to TTTR object containing the raw data. |
settings | [in] CLSMSettings object specifying parameters for image construction. |
source | [in] A CLSMImage object used as a template. All frames and lines are copied, and empty pixels are created. If fill is set to true (default), the content of the pixels is copied. |
fill | [in] If set to true (default), the lines are filled with pixels containing either the photons of the specified channels or the photons from the source CLSMImage instance. |
channels | [in] The channel number of the events used to fill the pixels. |
micro_time_ranges | [in] Vector of pairs specifying the micro time ranges. |
|
inlinevirtual |
void CLSMImage::append | ( | CLSMFrame * | frame | ) |
void CLSMImage::clear | ( | ) |
Clears the time-tagged time-resolved (TTTR) indices stored in the pixels.
|
inline |
Clears the time-tagged time-resolved (TTTR) indices stored in the pixels.
This function is deprecated in favor of 'clear'. It removes the stored TTTR indices from the pixels.
|
static |
Performs an image correlation spectroscopy analysis via FFTs for a set of frames.
This function computes the image correlation for a set of frames, either specified by an array or a CLSMImage object. It can compute image cross-correlation and image auto-correlations based on the type of correlation specified by a vector of pairs.
output | [out] Array that will contain the Image Correlation Spectrscopy analysis (ICS). |
dim1 | [out] Number of frames in the ICS. |
dim2 | [out] Number of lines (line shifts) in the ICS. |
dim3 | [out] Number of pixels (pixel shifts) in the ICS. |
tttr_data | [in] Pointer to TTTR object containing the raw data (optional). |
clsm | [in] Optional pointer to a CLSMImage object. |
images | [in] Optional pointer to an image array. |
input_frames | [in] Number of frames in the image array. |
input_lines | [in] Number of lines in the image array. |
input_pixel | [in] Number of pixels per line in the image array. |
x_range | [in] Defines the region of interest (ROI) in the image (pixel). |
y_range | [in] Defines the ROI in y-direction (lines). |
frames_index_pairs | [in] Vector of integer pairs corresponding to frame numbers used for cross-correlation (default computes auto-correlation). |
subtract_average | [in] Specifies background correction: "stack" subtracts the average over all frames, "frame" subtracts the average of each frame. Default is no correction. |
mask | [in] Stack of images used as a mask to select pixels (optional). |
dmask1 | [in] Number of frames in the mask. |
dmask2 | [in] Number of lines in the mask. |
dmask3 | [in] Number of pixels per line in the mask. |
void CLSMImage::copy | ( | const CLSMImage & | p2, |
bool | fill = false ) |
Copy information from another CLSMImage object.
Copies the information from another CLSMImage object, including pixel indices, if the fill
parameter is set to true (default is false).
p2 | The CLSMImage object from which information is copied. |
fill | If set to true (default is false), the time-tagged time-resolved indices of the pixels are copied. |
|
protected |
|
protected |
void CLSMImage::crop | ( | int | frame_start, |
int | frame_stop, | ||
int | line_start, | ||
int | line_stop, | ||
int | pixel_start, | ||
int | pixel_stop ) |
Crop the CLSMImage.
Crop the image by specifying the range of frames, lines, and pixels to keep.
frame_start | [in] Starting frame index for cropping. |
frame_stop | [in] Stopping frame index for cropping. |
line_start | [in] Starting line index for cropping. |
line_stop | [in] Stopping line index for cropping. |
pixel_start | [in] Starting pixel index for cropping. |
pixel_stop | [in] Stopping pixel index for cropping. |
|
protected |
void CLSMImage::distribute | ( | unsigned int | pixel_id, |
CLSMImage * | target, | ||
std::vector< int > & | target_pixel_ids, | ||
std::vector< int > & | target_probabilities ) |
Distribute the photons of a pixel_id to a set of pixel ids in a target image according to provided probabilities.
This function distributes the photons of a specified pixel_id to a set of pixel_ids in a target CLSMImage based on the provided probabilities.
pixel_id | [in] The source pixel_id whose photons will be distributed. |
target | [in] Pointer to the target CLSMImage. |
target_pixel_ids | [in] Vector of target pixel_ids to which photons will be distributed. |
target_probabilities | [in] Vector of probabilities corresponding to each target pixel_id. |
void CLSMImage::fill | ( | TTTR * | tttr_data = nullptr, |
std::vector< int > | channels = std::vector< int >(), | ||
bool | clear = true, | ||
const std::vector< std::pair< int, int > > & | micro_time_ranges = std::vector< std::pair< int, int > >() ) |
Fills the time-tagged time-resolved (TTTR) indices of the pixels with the indices of the photons that fall within each pixel.
This function processes the TTTR data to associate routing channels with pixels based on specified criteria. The TTTR indices of the channels within each pixel are stored.
tttr_data | Pointer to the TTTR object containing the data to be processed (default is nullptr). |
channels | List of routing channels. Events that have routing channels in this vector are added to pixels of corresponding time. |
clear | If set to true (default), the pixels are cleared before being filled. If set to false, new TTTR indices are added to the pixels. |
micro_time_ranges | List of pairs representing micro-time ranges. If provided, only events within these ranges are considered. |
|
inline |
Fills the time-tagged time-resolved (TTTR) indices of the pixels with the indices of the channels that fall within each pixel.
This function is deprecated in favor of 'fill'. It processes the TTTR data to associate routing channels with pixels based on specified criteria. The TTTR indices of the channels within each pixel are stored.
tttr_data | Pointer to the TTTR object containing the data to be processed. |
channels | List of routing channels. Events that have routing channels in this vector are added to pixels of corresponding time. |
clear_pixel | If set to true (default), the pixels are cleared before being filled. If set to false, new TTTR indices are added to the pixels. |
micro_time_ranges | List of pairs representing micro-time ranges. If provided, only events within these ranges are considered. |
void CLSMImage::get_decay_of_pixels | ( | TTTR * | tttr_data, |
uint8_t * | mask, | ||
int | dmask1, | ||
int | dmask2, | ||
int | dmask3, | ||
unsigned int ** | output, | ||
int * | dim1, | ||
int * | dim2, | ||
int | tac_coarsening, | ||
bool | stack_frames ) |
Computes micro time histograms for the stacks of images and a selection of pixels. Photons in pixels that are selected by the selection array contribute to the returned array of micro time histograms.
This function calculates micro time histograms for selected pixels in the image stack, based on a provided mask. The resulting micro time histograms are stored in the provided output array, and the dimensions of the output array are returned in the output parameters.
tttr_data | Pointer to a TTTR object. |
mask | A stack of images used as a mask to select pixels. |
dmask1 | Number of frames in the mask. |
dmask2 | Number of lines in the mask. |
dmask3 | Number of pixels per line in the mask. |
output | Pointer to the output array of unsigned int that contains the micro time histograms. The array is allocated by the function. |
dim1 | Dimension of the output array, i.e., the number of stacks. |
dim2 | Dimension of the output array, i.e., the number of micro time channels. |
tac_coarsening | Constant used to coarsen the micro times. |
stack_frames | If true, the frames are stacked. |
void CLSMImage::get_fcs_image | ( | float ** | output, |
int * | dim1, | ||
int * | dim2, | ||
int * | dim3, | ||
int * | dim4, | ||
std::shared_ptr< TTTR > | tttr, | ||
CLSMImage * | clsm_other = nullptr, | ||
std::string | correlation_method = "default", | ||
int | n_bins = 50, | ||
int | n_casc = 1, | ||
bool | stack_frames = false, | ||
bool | normalized_correlation = false, | ||
int | min_photons = 2 ) |
Computes an image where pixels represent correlation curves.
This function calculates a correlation image where each pixel corresponds to a correlation curve. The resulting image is determined by the specified parameters and is stored in the provided output array.
output | Pointer to the array that will contain the correlation image. The array is allocated by the function. |
dim1 | Number of correlation curves in the image (frames or time bins). |
dim2 | Number of lines per frame in the correlation image. |
dim3 | Number of pixels per line in the correlation image. |
dim4 | Number of cascades in the correlation image. |
tttr | Shared pointer to the TTTR object containing the data. |
clsm_other | Pointer to another CLSMImage object (default is nullptr). |
correlation_method | Method used for correlation computation (default is "default"). |
n_bins | Number of bins used for correlation computation (default is 50). |
n_casc | Number of cascades in the correlation image (default is 1). |
stack_frames | If true, correlation curves are stacked into a single image (default is false). |
normalized_correlation | If true, correlation curves are normalized (default is false). |
min_photons | Minimum number of photons required for correlation computation (default is 2). |
void CLSMImage::get_fluorescence_decay | ( | TTTR * | tttr_data, |
unsigned char ** | output, | ||
int * | dim1, | ||
int * | dim2, | ||
int * | dim3, | ||
int * | dim4, | ||
int | micro_time_coarsening = 1, | ||
bool | stack_frames = false ) |
Computes an image stack where the value of each pixel corresponds to a histogram of micro times in each pixel. The micro times can be coarsened by integer numbers.
This function calculates an image stack where each pixel represents a histogram of micro times. The resulting image stack is stored in the provided output array, and the dimensions of the image stack are returned in the output parameters.
tttr_data | Pointer to a TTTR object. |
output | Pointer to the output array of unsigned chars that will contain the image stack. The array is allocated by the function. |
dim1 | Number of frames in the image stack. |
dim2 | Number of lines per frame in the image stack. |
dim3 | Number of pixels per line in the image stack. |
dim4 | Number of micro time channels in the histogram. |
micro_time_coarsening | Constant used to coarsen the micro times. The default value is 1, and the micro times are binned without coarsening. |
stack_frames | If true, the frames are stacked. |
|
static |
Retrieves the time-tagged time-resolved (TTTR) indices of frame markers for a Leica SP8 microscope.
This function analyzes a TTTR object to extract frame marker information. The frame markers are identified by specified parameters, and the corresponding TTTR indices are returned as a vector.
tttr | Pointer to the TTTR object that is inspected (default is nullptr). |
start_event | Starting event index for analysis (default is 0). |
stop_event | Stopping event index for analysis (default is -1, indicating the end of the TTTR data). |
marker_frame_start | Vector specifying the frame markers to consider (default is {4, 6}). |
marker_event_type | Event type associated with frame markers (default is 15). |
reading_routine | Type of reading routine, e.g., CLSM_SP8 (default is CLSM_SP8). |
skip_before_first_frame_marker | If true, skip events before the first frame marker (default is false). |
skip_after_last_frame_marker | If true, skip events after the last frame marker (default is false). |
|
inline |
void CLSMImage::get_intensity | ( | unsigned short ** | output, |
int * | dim1, | ||
int * | dim2, | ||
int * | dim3 ) |
Computes an intensity image.
This function calculates an intensity image and stores it in the provided output array. The dimensions of the intensity image are returned in the output parameters.
output | Pointer to the array that will contain the intensity image. The array is allocated by the function. |
dim1 | Number of frames in the intensity image. |
dim2 | Number of lines per frame in the intensity image. |
dim3 | Number of pixels per line in the intensity image. |
|
inline |
Obtains the duration of a line (in milliseconds) for a specified frame and line.
This function calculates the duration of a line in milliseconds for a given frame and line based on the time-tagged time-resolved (TTTR) data and header information.
frame | Number of the frame in the image (default is 0). |
line | Number of the line in the image (default is 0). |
|
static |
Identifies line edges by reading start and stop markers in a time-tagged time-resolved (TTTR) dataset.
This function analyzes a TTTR object to extract line edges based on specified start and stop markers. The corresponding TTTR indices are returned as a vector.
tttr | Pointer to the TTTR object that is inspected. |
start_event | Starting event index for analysis. |
stop_event | Stopping event index for analysis. |
marker_line_start | Marker value indicating the start of a line (default is 1). |
marker_line_stop | Marker value indicating the stop of a line (default is 2). |
marker_event_type | Event type associated with line markers (default is 15). |
reading_routine | Type of reading routine, e.g., CLSM_SP8 (default is CLSM_SP8). |
|
static |
Identifies line edges by reading a start marker and using line duration as the stop criterion in a time-tagged time-resolved (TTTR) dataset.
This function analyzes a TTTR object to extract line edges based on a specified start marker and line duration. The corresponding TTTR indices are returned as a vector.
tttr | Pointer to the TTTR object that is inspected. |
start_event | Starting event index for analysis. |
stop_event | Stopping event index for analysis. |
marker_line_start | Marker value indicating the start of a line (default is 1). |
line_duration | Duration of a line, used as the stop criterion (default is 2). |
marker_event_type | Event type associated with line markers (default is 15). |
reading_routine | Type of reading routine, e.g., CLSM_SP8 (default is CLSM_SP8). |
void CLSMImage::get_mean_lifetime | ( | TTTR * | tttr_data, |
double ** | output, | ||
int * | dim1, | ||
int * | dim2, | ||
int * | dim3, | ||
int | minimum_number_of_photons = 3, | ||
TTTR * | tttr_irf = nullptr, | ||
double | m0_irf = 1.0, | ||
double | m1_irf = 1.0, | ||
bool | stack_frames = false, | ||
std::vector< double > | background = std::vector< double >(), | ||
double | m0_bg = 0.0, | ||
double | m1_bg = 0.0, | ||
double | background_fraction = -1.0 ) |
Computes an image of average lifetimes.
The average lifetimes are computed (not fitted) by the methods of moments (Irvin Isenberg, 1973, Biophysical journal).
Pixels with few photons can be discriminated. Discriminated pixels are filled with zeros.
By default, the fluorescence lifetimes of the pixels are computed in units of nanoseconds.
tttr_data | Pointer to a TTTR object. |
output | Pointer to the output array that will contain the image stack. The array is allocated by the function. |
dim1 | Returns the number of frames. |
dim2 | Returns the number of lines. |
dim3 | Returns the number of pixels per line. |
minimum_number_of_photons | The minimum number of photons in a micro time (default is 3). |
tttr_irf | Pointer to a TTTR object of the Instrument Response Function (IRF) (default is nullptr). |
m0_irf | The zero moment of the IRF (optional, default is 1.0). |
m1_irf | The first moment of the IRF (optional, default is 1.0). |
stack_frames | If true, the frames are stacked (default is false). |
background | Vector of background values (optional, default is an empty vector). |
m0_bg | The zero moment of the background (optional, default is 0.0). |
m1_bg | The first moment of the background (optional, default is 0.0). |
background_fraction | Background fraction used for discrimination (default is -1.0, which disables discrimination). |
void CLSMImage::get_mean_micro_time | ( | TTTR * | tttr_data, |
double ** | output, | ||
int * | dim1, | ||
int * | dim2, | ||
int * | dim3, | ||
double | microtime_resolution = -1.0, | ||
int | minimum_number_of_photons = 2, | ||
bool | stack_frames = false ) |
Calculates an image stack where the value of each pixel corresponds to the mean micro time (in units of the micro channel resolution).
Pixels with few photons can be discriminated. Discriminated pixels will be filled with zeros.
tttr_data | Pointer to a TTTR object. |
output | Pointer to the output array that will contain the image stack. The array is allocated by the function. |
dim1 | Returns the number of frames. |
dim2 | Returns the number of lines. |
dim3 | Returns the number of pixels per line. |
microtime_resolution | Micro channel resolution (default is -1.0, which means it will be obtained from the TTTR object). |
minimum_number_of_photons | The minimum number of photons in a micro time (default is 2). |
stack_frames | If true, the frames are stacked (default is false). If stack frames is set to true, the mean arrival time is computed using the TTTR indices of all pixels (corresponding to the photon-weighted mean arrival time). |
|
inline |
Get the number of frames in the CLSM image.
This member function returns the number of frames in the CLSM image.
|
inline |
|
inline |
void CLSMImage::get_phasor | ( | float ** | output, |
int * | dim1, | ||
int * | dim2, | ||
int * | dim3, | ||
int * | dim4, | ||
TTTR * | tttr_data, | ||
TTTR * | tttr_irf = nullptr, | ||
double | frequency = -1, | ||
int | minimum_number_of_photons = 2, | ||
bool | stack_frames = false ) |
Computes the phasor values for every pixel.
Pixels with few photons can be discriminated. Discriminated pixels will be filled with zeros.
output | Pointer to the output array that will contain the image stack. The array is allocated by the function. |
dim1 | Returns the number of frames. |
dim2 | Returns the number of lines. |
dim3 | Returns the number of pixels per line. |
dim4 | Returns 2 (first is the g phasor value (cos), second the s phasor (sin)). |
tttr_data | Pointer to a TTTR object. |
tttr_irf | Pointer to a TTTR object representing the Instrument Response Function (IRF) (default is nullptr). |
frequency | Modulation frequency for phasor computation (default is -1, which means it will be obtained from the TTTR object). |
minimum_number_of_photons | The minimum number of photons in a micro time (only used if frames are not stacked, default is 2). |
stack_frames | If true, the frames are stacked (default is false). If stack frames is set to true, the mean arrival time is computed using the TTTR indices of all pixels (corresponding to the photon-weighted mean arrival time). |
|
inline |
Obtains the duration of a pixel (in milliseconds) for a specified frame and line.
This function calculates the duration of a pixel in milliseconds for a given frame and line, based on the time-tagged time-resolved (TTTR) data, header information, and the number of pixels per line.
frame | Selected frame number (default is 0). |
line | Selected line number (default is 0). |
|
static |
Copies a region of interest (ROI) from the input images, performs background correction, and stores the result in a new array.
The ROI is defined by specifying ranges for pixels and lines. The function supports various correction options, such as subtracting a constant background value, clipping output values, and correcting by the mean intensity of frames.
output | Pointer to the array that will contain the ROI. The array is allocated by the function. |
dim1 | Number of frames in the output ROI. |
dim2 | Number of lines per frame in the output ROI. |
dim3 | Number of pixels per line in the output ROI. |
clsm | Pointer to a CLSMImage object (default is nullptr). |
x_range | Range (selection) of pixels for the ROI. |
y_range | Range (selection) of lines for the ROI. |
subtract_average | If set to "stack," the mean image of the ROIs computed by averaging over all frames is subtracted from each frame, and the mean intensity of all frames and pixels is added to the pixels. If set to "frame," the average of each frame is subtracted from that frame. Default is no correction. |
background | Constant number subtracted from each pixel. |
clip | If true, values in the ROI are clipped to the range [clip_min, clip_max] (default is false). |
clip_max | Maximum value when output ROIs are clipped. |
clip_min | Minimum value when output ROIs are clipped. |
images | Input array of images used to define ROIs (default is nullptr). |
n_frames | Number of frames in the input array images. |
n_lines | Number of lines in the input array images. |
n_pixels | Number of pixels per line in the input array images. |
mask | Stack of images used to select pixels (default is nullptr). |
dmask1 | Number of frames; if smaller than ROI, the first mask frame is applied to all ROI frames greater than dmask1. |
dmask2 | Number of lines; if smaller than ROI, the outside region is selected, and the mask is applied to all lines smaller than dmask2. |
dmask3 | Number of pixels per line in the mask. |
selected_frames | List of frames used to define the ROIs. If empty, all frames in the input are used. |
|
inline |
|
inline |
|
inline |
Get a pointer to a CLSMPixel object based on a one-dimensional index.
This member function calculates the three-dimensional coordinates (frame, line, pixel) corresponding to a given one-dimensional index and returns a pointer to the corresponding CLSMPixel object.
idx | One-dimensional index to determine the CLSMPixel. |
|
inline |
void CLSMImage::rebin | ( | int | bin_line, |
int | bin_pixel ) |
Rebin a CLSMImage.
Rebinning redistributes photons and macro times in pixels.
Note: Rebinning may alter the distribution of photons and macro times in the image.
bin_line | [in] Binning factor for lines. |
bin_pixel | [in] Binning factor for pixels within lines. |
|
inline |
|
inline |
Get the number of frames in the CLSMImage.
|
inline |
void CLSMImage::strip | ( | const std::vector< int > & | tttr_indices, |
int | offset = 0 ) |
|
inline |
Convert three-dimensional coordinates (frame, line, pixel) to a one-dimensional index.
This inline function calculates a unique one-dimensional index for a given set of three-dimensional coordinates representing a position in an array.
frame | Index of the frame. |
line | Index of the line within the frame. |
pixel | Index of the pixel within the line. |
|
inline |
Convert a one-dimensional index to three-dimensional coordinates (frame, line, pixel).
This inline function calculates the three-dimensional coordinates (frame, line, pixel) corresponding to a given one-dimensional index in an array.
idx | One-dimensional index to be converted. |
void CLSMImage::transform | ( | unsigned int * | input, |
int | n_input ) |
Move the content of the Pixels based on source and target pixel indices.
The input is an interleaved array of source and target pixel indices. A pixel index is a mapping from frames, lines, and pixel combination to an index.
input | [in] Pointer to an interleaved array containing source and target pixel indices. |
n_input | [in] Number of elements in the input array. |
|
friend |
|
friend |
|
friend |
|
friend |
int CLSMImage::marker_event |
The event type used for the marker.
std::vector<int> CLSMImage::marker_frame |
Vector containing the tttr indices of the frame markers.
int CLSMImage::marker_line_start |
Defines the marker for a line start.
int CLSMImage::marker_line_stop |
Defines the marker for a line stop.
|
protected |
The number of frames in an CLSMImage.
|
protected |
The number of lines per frames.
|
protected |
The number if pixels per line.
std::string CLSMImage::reading_routine = "default" |
bool CLSMImage::skip_after_last_frame_marker = false |
bool CLSMImage::skip_before_first_frame_marker = false |
CLSM TTTR data starts can have incomplete frame. Thus skipping data can make sense
|
protected |
Pointer to tttr data that used to construct the Image.