Skip to contents

Run separate_trajectories() with many different frame gaps to help determine what value to use

Usage

visualize_frame_gap_choice(obj_name, loops = 20, ...)

Arguments

obj_name

The input viewr object; a tibble or data.frame with attribute pathviewr_steps that includes "viewr"

loops

How many total frame gap entries to consider. Each loop will increase the max_fram_gap argument in separate_trajectories by 1.

...

Additional arguments

Value

A plot and a tibble, each of which shows the total number of trajectories that result from using the specified range of max_frame_gap values.

Details

The input viewr object (obj_name) should likely be an object that has passed through the select_x_percent() step.

Author

Melissa S. Armstrong and Vikram B. Baliga

Examples

library(pathviewr)

## Import the example Motive data included in the package
motive_data <-
  read_motive_csv(system.file("extdata", "pathviewr_motive_example_data.csv",
                             package = 'pathviewr'))

motive_selected <-
  motive_data %>%
  relabel_viewr_axes() %>%
  gather_tunnel_data() %>%
  trim_tunnel_outliers() %>%
  rotate_tunnel() %>%
  get_velocity() %>%
  select_x_percent(desired_percent = 50)

visualize_frame_gap_choice(motive_selected, loops = 10)

#> [[1]]
#> # A tibble: 10 × 3
#>    frame_gap_allowed trajectory_count file_id        
#>                <dbl>            <dbl> <chr>          
#>  1                 1               15 motive_selected
#>  2                 2               13 motive_selected
#>  3                 3               13 motive_selected
#>  4                 4               13 motive_selected
#>  5                 5               13 motive_selected
#>  6                 6               13 motive_selected
#>  7                 7               13 motive_selected
#>  8                 8               13 motive_selected
#>  9                 9               13 motive_selected
#> 10                10               13 motive_selected
#> 
#> [[2]]
#> NULL
#>