palmari.processing.steps package#

Submodules#

palmari.processing.steps.base module#

class palmari.processing.steps.base.Detector[source]#

Bases: palmari.processing.steps.base.ProcessingStep

property action_name#
cols_dtype = {'frame': <class 'int'>, 'x': <class 'float'>, 'y': <class 'float'>}#
detect(img: numpy.array, frame_start: int = 0) pandas.core.frame.DataFrame[source]#
abstract detect_frame(img: numpy.array) pandas.core.frame.DataFrame[source]#

Detect spots from a temporal slice of an image. Override in subclasses

Parameters

img (np.array) – 3D array [T, X, Y]

Returns

localizations table with the following columns : x, y, frame

Return type

pd.DataFrame

property is_detector#
property is_localizer#
movie_detection(mov: dask.array.core.Array)[source]#
property name#
process(*args)[source]#

Depending on their types, subclasses might have different effector functions. e.g. Trackers’effector function is named .track() This function is just meant to be a link towards the effector function

class palmari.processing.steps.base.LocProcessor[source]#

Bases: palmari.processing.steps.base.ProcessingStep

property name#
process(*args)[source]#

Depending on their types, subclasses might have different effector functions. e.g. Trackers’effector function is named .track() This function is just meant to be a link towards the effector function

class palmari.processing.steps.base.MoviePreProcessor[source]#

Bases: palmari.processing.steps.base.ProcessingStep

property name#
abstract preprocess(mov: dask.array.core.Array) pandas.core.frame.DataFrame[source]#
process(*args)[source]#

Depending on their types, subclasses might have different effector functions. e.g. Trackers’effector function is named .track() This function is just meant to be a link towards the effector function

class palmari.processing.steps.base.ProcessingStep[source]#

Bases: abc.ABC

property is_detector#
property is_localizer#
abstract property name#
abstract process(*args)[source]#

Depending on their types, subclasses might have different effector functions. e.g. Trackers’effector function is named .track() This function is just meant to be a link towards the effector function

to_dict() dict[source]#
update_param(param, *args)[source]#
widget_options = {}#
widget_types = {}#
class palmari.processing.steps.base.SubpixelLocalizer[source]#

Bases: palmari.processing.steps.base.ProcessingStep

property action_name#
cols_dtype = {'frame': <class 'int'>, 'x': <class 'float'>, 'y': <class 'float'>}#
property is_localizer#
localize(img: numpy.array, detections: pandas.core.frame.DataFrame, frame_start: int = 0) pandas.core.frame.DataFrame[source]#
abstract localize_frame(img: numpy.array, detections: numpy.array) pandas.core.frame.DataFrame[source]#

Extract localizations from a slice of an image file. Override in subclasses

Parameters
  • img (np.array) – 2D array [X, Y]

  • detections (np.array) – 2D array [X, Y] center of spots (pixel indices)

Returns

localizations table with the following columns : x, y (in pixel units)

Return type

pd.DataFrame

movie_localization(mov: dask.array.core.Array, detections: pandas.core.frame.DataFrame)[source]#
property name#
process(*args)[source]#

Depending on their types, subclasses might have different effector functions. e.g. Trackers’effector function is named .track() This function is just meant to be a link towards the effector function

class palmari.processing.steps.base.Tracker[source]#

Bases: palmari.processing.steps.base.ProcessingStep

property action_name#
estimate_delta_t(locs)[source]#
property name#
process(*args)[source]#

Depending on their types, subclasses might have different effector functions. e.g. Trackers’effector function is named .track() This function is just meant to be a link towards the effector function

abstract track(locs: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame[source]#

palmari.processing.steps.drift_corrector module#

class palmari.processing.steps.drift_corrector.BeadDriftCorrector(sigma: int = 3)[source]#

Bases: palmari.processing.steps.base.LocProcessor

property action_name#
property name#
process(mov: dask.array.core.Array, locs: pandas.core.frame.DataFrame, pixel_size: float) pandas.core.frame.DataFrame[source]#

Depending on their types, subclasses might have different effector functions. e.g. Trackers’effector function is named .track() This function is just meant to be a link towards the effector function

widget_options = {'sigma': {'label': 'Bead radius (in pixels)', 'max': 50, 'min': 2}}#
widget_types = {'sigma': 'FloatSpinBox'}#
class palmari.processing.steps.drift_corrector.CorrelationDriftCorrector(min_n_locs_per_bin: int = 10000, max_n_bins: int = 20)[source]#

Bases: palmari.processing.steps.base.LocProcessor

property action_name#
property name#
process(mov: dask.array.core.Array, locs: pandas.core.frame.DataFrame, pixel_size: float) pandas.core.frame.DataFrame[source]#

Depending on their types, subclasses might have different effector functions. e.g. Trackers’effector function is named .track() This function is just meant to be a link towards the effector function

widget_options = {'max_n_bins': {'label': 'Bins', 'max': 50, 'min': 2, 'tooltip': 'Maximum number of bins. One shift per bin will be computed.'}, 'min_n_locs_per_bin': {'label': 'Locs / bin', 'max': 10000000, 'min': 100, 'step': 1000, 'tooltip': 'Minimum number of localizations per bin'}}#
widget_type = {'max_n_bins': 'Spinner', 'min_n_locs_per_bin': 'Spinner'}#

palmari.processing.steps.quot_localizer module#

class palmari.processing.steps.quot_localizer.BaseDetector(k: float = 1.5, w: int = 21, t: float = 1.0, method: str = 'llr')[source]#

Bases: palmari.processing.steps.base.Detector

detect_frame(img: numpy.array) pandas.core.frame.DataFrame[source]#

Detect spots from a temporal slice of an image. Override in subclasses

Parameters

img (np.array) – 3D array [T, X, Y]

Returns

localizations table with the following columns : x, y, frame

Return type

pd.DataFrame

property name#
widget_options = {'k': {'label': 'Spot size (px)', 'min': 0.0, 'step': 0.1}, 'method': {'choices': [('Log-likelihood ratio', 'llr'), ('Laplacian of Gaussians', 'log')], 'label': 'Method'}, 't': {'label': 'Threshold', 'max': 3.0, 'min': 0.5, 'readout': True, 'step': 0.1}, 'w': {'label': 'Window size (px)', 'min': 5, 'step': 2, 'tooltip': 'Size of the square window used for testing.'}}#
widget_types = {'method': 'ComboBox', 't': 'FloatSlider'}#
class palmari.processing.steps.quot_localizer.MaxLikelihoodLocalizer(method: str = 'ls_int_gaussian', window_size: int = 9, sigma: float = 1.5)[source]#

Bases: palmari.processing.steps.base.SubpixelLocalizer

cols_dtype = {'H_det': <class 'float'>, 'I0': <class 'float'>, 'I0_err': <class 'float'>, 'bg': <class 'float'>, 'bg_err': <class 'float'>, 'error_flag': <class 'int'>, 'frame': <class 'int'>, 'rmse': <class 'float'>, 'snr': <class 'float'>, 'x': <class 'float'>, 'x_err': <class 'float'>, 'y': <class 'float'>, 'y_err': <class 'float'>}#
localize_frame(img: numpy.array, detections: numpy.array) pandas.core.frame.DataFrame[source]#

Extract localizations from a slice of an image file. Override in subclasses

Parameters
  • img (np.array) – 2D array [X, Y]

  • detections (np.array) – 2D array [X, Y] center of spots (pixel indices)

Returns

localizations table with the following columns : x, y (in pixel units)

Return type

pd.DataFrame

property name#
widget_options = {'method': {'choices': [('Gaussian', 'ls_int_gaussian'), ('Poisson', 'poisson_int_gaussian')], 'label': 'Noise', 'tooltip': 'Assumed type of background noise', 'value': 'ls_int_gaussian'}, 'sigma': {'label': 'Spot size (px)', 'step': 0.1}, 'window_size': {'label': 'Window size (px)', 'step': 1}}#
widget_types = {'method': 'ComboBox'}#
class palmari.processing.steps.quot_localizer.RadialLocalizer(window_size: int = 9)[source]#

Bases: palmari.processing.steps.base.SubpixelLocalizer

cols_dtype = {'I0': <class 'float'>, 'bg': <class 'float'>, 'error_flag': <class 'bool'>, 'snr': <class 'float'>, 'x': <class 'float'>, 'y': <class 'float'>}#
localize_frame(img: numpy.array, detections: numpy.array) pandas.core.frame.DataFrame[source]#

Extract localizations from a slice of an image file. Override in subclasses

Parameters
  • img (np.array) – 2D array [X, Y]

  • detections (np.array) – 2D array [X, Y] center of spots (pixel indices)

Returns

localizations table with the following columns : x, y (in pixel units)

Return type

pd.DataFrame

property name#
widget_options = {'window_size': {'label': 'Window size (px)', 'step': 1}}#

palmari.processing.steps.quot_tracker module#

class palmari.processing.steps.quot_tracker.DiffusionTracker(max_diffusivity: float = 5.0, max_blinks: int = 0, d_bound_naive: float = 0.1, init_cost: float = 50.0, y_diff: float = 0.9)[source]#

Bases: palmari.processing.steps.base.Tracker

property name#
track(locs: pandas.core.frame.DataFrame)[source]#
widget_options = {'d_bound_naive': {'label': 'D_0 (um^2/s)', 'min': 0.0, 'step': 0.1, 'tooltip': "First guess of a trajectory's diffusivity"}, 'init_cost': {'label': 'Initialization cost', 'min': 1, 'step': 10, 'tooltip': 'Cost of initializing a new trajectory when a reconnection is available in the search radius'}, 'max_blinks': {'label': 'Max blinks', 'max': 2, 'min': 0, 'step': 1, 'tooltip': "Maximum number of tolerated blinks (i.e. number of frames during which a particle can 'disappear')."}, 'max_diffusivity': {'label': 'D_max (um^2/s)', 'min': 0.0, 'step': 1.0, 'tooltip': 'Assumed maximum diffusivity (in microns per square second).\nThis is used in conjunction with the Time delta to set the maximal distance between consecutive localizations'}, 'y_diff': {'label': 'Past vs naive', 'max': 1.0, 'min': 0.0, 'step': 0.01, 'tooltip': "Relative weight of a trajectory's past in the estimation of its diffusivity"}}#
widget_types = {'d_bound_naive': 'FloatSpinBox', 'init_cost': 'FloatSpinBox', 'max_blinks': 'SpinBox', 'max_diffusivity': 'FloatSpinBox', 'y_diff': 'FloatSlider'}#
class palmari.processing.steps.quot_tracker.EuclideanTracker(max_diffusivity: float = 5.0, max_blinks: int = 0, scale: float = 1.0, init_cost: float = 50.0)[source]#

Bases: palmari.processing.steps.base.Tracker

property name#
track(locs: pandas.core.frame.DataFrame)[source]#
widget_options = {'init_cost': {'label': 'Initialization cost', 'min': 1, 'step': 10, 'tooltip': 'Cost of initializing a new trajectory when a reconnection is available in the search radius'}, 'max_blinks': {'label': 'Max blinks', 'max': 2, 'min': 0, 'step': 1, 'tooltip': "Maximum number of tolerated blinks (i.e. number of frames during which a particle can 'disappear')."}, 'max_diffusivity': {'label': 'D_max (um^2/s)', 'min': 0.0, 'step': 1.0, 'tooltip': 'Assumed maximum diffusivity (in microns per square second).\nThis is used in conjunction with the Time delta to set the maximal distance between consecutive localizations'}, 'scale': {'label': 'Weight scale', 'min': 0.1, 'step': 0.5, 'tooltip': 'Scaling factor between distance (in um) and coefficient of the corresponding assignment in the weight matrix'}}#
widget_types = {'init_cost': 'FloatSpinBox', 'max_blinks': 'SpinBox', 'max_diffusivity': 'FloatSpinBox', 'scale': 'FloatSpinBox'}#

palmari.processing.steps.trackpy_tracker module#

class palmari.processing.steps.trackpy_tracker.ConservativeTracker(max_diffusivity: float = 5.0)[source]#

Bases: palmari.processing.steps.base.Tracker

property name#
track(locs: pandas.core.frame.DataFrame)[source]#
widget_options = {'delta_t': {'label': 'Time delta (s)', 'min': 0.0, 'step': 0.01, 'tooltip': 'time interval between frames (in seconds)'}, 'max_diffusivity': {'label': 'D_max (um^2/s)', 'min': 0.0, 'step': 1.0, 'tooltip': 'Assumed maximum diffusivity (in microns per square second).\nThis is used in conjunction with the Time delta to set the maximal distance between consecutive localizations'}}#
widget_types = {'delta_t': 'FloatSpinBox', 'max_diffusivity': 'FloatSpinBox'}#

palmari.processing.steps.window_percentile module#

class palmari.processing.steps.window_percentile.WindowPercentileFilter(percentile: float = 3.0, window_size: int = 100)[source]#

Bases: palmari.processing.steps.base.MoviePreProcessor

property action_name#
property name#
preprocess(mov: dask.array.core.Array) dask.array.core.Array[source]#
widget_options = {'percentile': {'label': 'Percentile', 'min': 0.0, 'step': 1.0, 'tooltip': 'percentile of the pixel intensity values in the window which will be considered as the ground level.'}, 'window_size': {'label': 'Window', 'min': 100, 'step': 50, 'tooltip': 'Size of the windows along which quantiles are computed'}}#
widget_types = {'percentile': 'FloatSpinBox', 'window_size': 'SpinBox'}#

Module contents#