Skip to contents

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

Usage

plot_univariate_projection(
  csv_or_path,
  manual_scale_factor = NA,
  p_cutoff = 0,
  filter = "none",
  body_part = "center",
  reference_distance,
  fps = 2000,
  savgol_window_length = 11,
  savgol_filter_smoothing_multiplier = 3,
  median_window_length = 11,
  average_window_length = 11,
  shake_threshold = 0.35,
  window_threshold = 0.5,
  fixed_baseline = 0.5,
  y_threshold = 0.1
)

Arguments

csv_or_path

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

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.

p_cutoff

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

filter

The filter chosen to smooth tracked trajectories. Options are "none", "savitzky-golay", "median", or "average" (average recommended)

body_part

The body_part you wish to plot.

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.

fps

The frames per second of your CSV.

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.

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.

Value

A figure with diagnostic panels (indicating unannotated and annotated univariate projections, and estimated horizontal and vertical positions and velocities).