set_random_images: Randomly select the specified number of images (3 by default,...

Description Usage Arguments Examples

View source: R/global_set_image_paths_and_points.R

Description

Randomly select the specified number of images (3 by default, in any order) and the corresponding points from a larger pool of images. Randomization avoids order bias

Usage

1
set_random_images(image_paths_and_points, number_of_images = 3)

Arguments

image_paths_and_points

List of Lists containing the img and the points for the annotation markers

number_of_images

Integer of the number of images to select from all of the images

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
r2vr_pkg <- "https://cdn.jsdelivr.net/gh/ACEMS/r2vr@experiment"

r2vr_3d_images <- paste0(r2vr_pkg, "/inst/ext/images/3d/")   

img_paths <- paste(
                   r2vr_3d_images,
                   c(
                     "100030039.jpg",
                     "120261897.jpg",
                     "130030287.jpg",
                     "130050093.jpg"
                   ),
                   sep = ""
                   )
                  
img1Points = list(
  list(id = 1, x = 0.236554238200567 , y = -0.645350804079801 , z = -0.726336307823658, isCoral = 0),
  list(id = 2, x = 0.560689468806834 , y = -0.295637517136722 , z = -0.773450565990061, isCoral = 0),
  list(id = 3, x = -0.741564092459525 , y = -0.0768210007796801 , z = -0.66646922705695, isCoral = 0)
)
img_paths_and_points <- list(
  list(img = img_paths[1], img_points = img1Points),
  list(img = img_paths[2], img_points = img1Points),
  list(img = img_paths[3], img_points = img1Points),
  list(img = img_paths[4], img_points = img1Points)
) 

set_random_images(img_paths_and_points)
#' set_random_images(img_paths_and_points, 2)                 
                                                   

MilesMcBain/r2vr documentation built on March 29, 2021, 12:03 p.m.