flim.sort

Performs 3D data sorting of positions and timing.

Syntax

fli = photonscore.flim.sort(x, x_min, x_max, x_bins, y, dt)
fli = photonscore.flim.sort(x, x_min, x_max, x_bins, ...
                            y, y_min, y_max, y_bins, dt)

Description

photonscore.flim.sort builds a 2D histogram of the positions x and y in the half-closed intervals [x_min, x_max) and [x_min, x_max) with the number of bins defined by x_bins and y_bins. If the histogramming options for y are not provided those for x are used, e.g. y_min = x_min, y_max = x_max and y_bins = x_bins. The values of dt are ordered from smaller to larger.

To illustrate the operation of the sorting function consider the dataset of 2×2 positional bins marked with the colors and corresponding dt values:

FLIM Sort

After applying photonscore.flim.sort the resulting image (histogram) and the corresponding time values would look like shown here:

FLIM Sort

The benefit of this data organization is an ability to extract very fast fluorescence decays for corresponding positions.

Parameters

x, y

Vectors of 16-bit unsigned integer values to form the intensity image.

x_min, x_max, x_bins

Numeric values defining the histogram interval for values x.

y_min, y_may, y_bins

Numeric values defining the histogram interval for values y.

dt

Vectors of of 16-bit unsigned integer values of the decay.

Return values

fli structure with the following fields:

  • image x_bins×y_bins matrix of integer values holding number of counts of the bin.
  • time is the vector of sorted numeric values of dt parameter.

Example

To reproduce the results depicted above one can use the following code fragment:

>> x  = uint16([2 1 2 2 1 1 2 2 1 1 2 2 1 1 1 2 1 2 1]);
>> y  = uint16([2 1 1 2 1 2 1 2 2 1 1 2 2 1 2 2 2 1 2]);
>> dt = uint16([1 2 7 4 7 3 1 6 3 2 4 5 8 9 2 5 7 1 2]);
>> fl = photonscore.flim.sort(x, 1, 3, 2, y, dt);

Evaluating the results would yield:

>> fl

fl =

  struct with fields:

    image: [2×2 int32]
     time: [19×1 uint16]

>> fl.image'

ans =

  2×2 int32 matrix

   4   4
   6   5

>> fl.time'

ans =

  1×19 uint16 row vector

   2   2   7   9   1   1   4   7   2   2   3   3   7   8   1   4   5   5   6