Skip to contents

This function loads a CSV containing tracking data. Given a particular body-part, axis, and level of smoothing, the function plots the trajectory of the body-part along that axis.

Usage

plot_filter_graphs(
  csv_or_path,
  p_cutoff,
  reference_distance = NA,
  manual_scale_factor = NA,
  fps = 2000,
  fixed_baseline = 1,
  y_threshold = 0.1,
  savgol_window_length = 25,
  savgol_filter_smoothing_multiplier = 3,
  median_window_length = 25,
  average_window_length = 25,
  body_part = "center",
  axis = "y"
)

Arguments

csv_or_path

Either a csv loaded as an R object, or the full path to that CSV.

p_cutoff

The confidence value at which all tracked points below this threshold are replaced by linear interpolation between two higher-confidence points.

reference_distance

The 'real-world-length' between your reference objects (can be in mm, cm, etc). If you indicate a manual_scale_factor, this setting will be overrided by that factor.

manual_scale_factor

The 'real-world-length' to pixel conversion factor (i.e. millimeters/pixel). If you are using two reference points, you can ignore this parameter.

fps

The frames per second of your CSV.

fixed_baseline

The height (in units of choice) above the lowest y-axis position of the paw, used to determine the baseline for activity. the y_threshold parameter is used to set a baseline for this level of activity.

y_threshold

The threshold (in units of choice) above the fixed baseline at which the start and end time-points of activity are determined.

savgol_window_length

The rolling window length of Savitzky-Golay filter smoothing to apply to your tracking trajectory.

median_window_length

The rolling window length of median filter smoothing to apply to your tracking trajectory.

average_window_length

The rolling window length of average filter smoothing to apply to your tracking trajectory.

body_part

The body_part you wish to plot.

axis

The axis you wish to plot.

Value

A figure with panels (each indicating the plotted track under a given filter and level and smoothing).