Filters API#

napari_flim_phasor_plotter.filters.make_time_mask(image, laser_frequency)#

Create a time mask from the image histogram maximum onwards

Parameters:
  • image (array) – The flim timelapse image

  • laser_frequency (float) – Frequency of the pulsed laser (in MHz)

Returns:

time_mask – Time mask

Return type:

boolean array

napari_flim_phasor_plotter.filters.make_space_mask_from_manual_threshold(image, threshold)#

Create a space mask from the summed intensity image over time, keeping pixels whose value is above threshold.

Parameters:
  • image (array) – The flim timelapse image

  • threshold (float) – An integer threshold value.

Returns:

space_mask – A boolean mask representing pixels to keep.

Return type:

boolean array

napari_flim_phasor_plotter.filters.apply_median_filter(image, n=1)#

Apply a median filter to the image.

Parameters:
  • image (array) – The image to filter.

  • n (int, optional) – The number of times to apply the median filter, by default 1. This is useful for reducing noise in the image.

Returns:

image_filt – The filtered image with the same shape as the input image.

Return type:

array

napari_flim_phasor_plotter.filters.apply_binning(flim_image: napari.types.ImageData, bin_size: int = 2, binning_3D: bool = True) napari.types.ImageData#

Apply binning to TCSPC FLIM image.

Parameters:
  • flim_image (array) – The FLIM data with dimensions (ut, time, z, y, x). microtime must be the first dimention. time and z are optional.

  • bin_size (int, optional) – size of binning kernel, by default 2

  • binning_3D (bool, optional) – if True, applies a 3D binning kernel, if False, applies a 2D binning kernel to each slice, by default True

Returns:

image_binned – The binned FLIM data

Return type:

array