Package: pathviewr 1.1.7

Vikram B. Baliga

pathviewr: Wrangle, Analyze, and Visualize Animal Movement Data

Tools to import, clean, and visualize movement data, particularly from motion capture systems such as Optitrack's 'Motive', the Straw Lab's 'Flydra', or from other sources. We provide functions to remove artifacts, standardize tunnel position and tunnel axes, select a region of interest, isolate specific trajectories, fill gaps in trajectory data, and calculate 3D and per-axis velocity. For experiments of visual guidance, we also provide functions that use subject position to estimate perception of visual stimuli.

Authors:Vikram B. Baliga [aut, cre], Melissa S. Armstrong [aut], Eric R. Press [aut], Anne-Sophie Bonnet-Lebrun [rev], Marco Sciaini [rev]

pathviewr.pdf |pathviewr.html
pathviewr/json (API)

# Install pathviewr in R:
install.packages('pathviewr', repos = c('', ''))

Peer review:

Bug tracker:



47 exports 7 stars 1.45 score 45 dependencies 483 downloads

Last updated 1 years agofrom:e591cb88815bc706e6415472d2c6846cf639ad8c (via master)



Basics of data import and cleaning in pathviewr

Rendered fromdata-import-cleaning.Rmdusingknitr::rmarkdownon Jun 02 2024.

Last update: 2021-04-19
Started: 2020-07-27

Estimating visual perceptions from tracking data

Rendered fromvisual-perception-functions.Rmdusingknitr::rmarkdownon Jun 02 2024.

Last update: 2022-08-21
Started: 2020-09-21

Managing frame gaps with pathviewr

Rendered frommanaging-frame-gaps.Rmdusingknitr::rmarkdownon Jun 02 2024.

Last update: 2022-08-18
Started: 2020-09-02

Readme and manuals

Help Manual

Help pageTopics
Convert data from another format into a viewr objectas_viewr
Bind viewr objectsbind_viewr_objects
Calculate minimum distance to lateral and end walls in a box-shaped experimental tunnelcalc_min_dist_box
Calculate minimum distance to lateral and end walls in a V-shaped experimental tunnelcalc_min_dist_v
Remove file_sub_traj entries that do not span the full region of interestclean_by_span
All-in-one function to clean imported objectsclean_viewr
Batch clean viewr filesclean_viewr_batch
Convert degrees to radiansdeg_2_rad
Remove trajectories entirely, based on velocity thresholdsexclude_by_velocity
Interpolate gaps within trajectoriesfill_traj_gaps
Find the "elbow" of a curve.find_curve_elbow
Gather data columns into key-value pairsgather_tunnel_data
Compute an angle in 2D spaceget_2d_angle
Compute an angle in 3D spaceget_3d_angle
Compute the cross product of two 3D vectorsget_3d_cross_prod
Compute distance between a point and a lineget_dist_point_line
Retain trajectories that span a selected region of interestget_full_trajectories
Extract header info from imported viewr objectget_header_viewr
Estimate the spatial frequency of visual stimuli from the subject's perspective in an experimental tunnel.get_sf
Recompute trajectory-specific velocitiesget_traj_velocities
Get instantaneous velocity for subjectsget_velocity
Estimate visual angles from a subject's perspective in an experimental tunnelget_vis_angle
Batch import and clean filesimport_and_clean_batch
Import + clean_viewr()import_and_clean_viewr
Batch import of files for either Motive or Flydra (but not a mix of both)import_batch
Inserts treatment and experiment informationinsert_treatments
Plot trajectories and density plots of position by subjectplot_by_subject
Plot each trajectory within a viewr objectplot_viewr_trajectories
Quick version of separate_trajectories()quick_separate_trajectories
Convert radians to degreesrad_2_deg
Import data from a MAT file exported from Flydra softwareread_flydra_mat
Import data from a CSV exported from Optitrack's Motive softwareread_motive_csv
"Center" the tunnel data, i.e. translation but no rotationredefine_tunnel_center
Relabel the dimensions as length, width, and heightrelabel_viewr_axes
Remove any duplicates or aliased frames within trajectoriesremove_duplicate_frames
Remove any rows which show sharp shifts in velocity that are likely due to tracking errorsremove_vel_anomalies
Rename subjects in the data via pattern detectionrename_viewr_characters
Rescale position data within a 'viewr' objectrescale_tunnel_data
Remove subjects by trajectory numberrm_by_trajnum
Rotate a tunnel so that perches are approximately alignedrotate_tunnel
Bin data along a specified axissection_tunnel_by
Select a region of interest within the tunnelselect_x_percent
Separate rows of data into separately labeled trajectories.separate_trajectories
Redefine frames and time stamps on a per-trajectory basisset_traj_frametime
Rotate and center a tunnel based on landmarksstandardize_tunnel
Trim out artifacts and other outliers from the extremes of the tunneltrim_tunnel_outliers
Visualize the consequence of using various max_frame_gap valuesvisualize_frame_gap_choice