Learn R Programming

BioTrajectory (version 1.1.0)

selFrame: Image Frame Selector and Viewer

Description

This function provides an interactive image frame viewer where the user can navigate through a sequence of images and select a specific one. The viewer uses buttons for navigation (previous and next) and an option to select an image. The function uses the `rp.control` to create a window for the interface, and `grid` for displaying images.

Usage

selFrame(image_files)

Value

The index of the selected image.

Arguments

image_files

A vector of file paths to the images that will be displayed in the viewer.

Details

The function displays a sequence of images from the provided file paths, allowing the user to navigate between them using "Previous" and "Next" buttons. The images are displayed using `grid.raster` from the `grid` package. A "Select" button allows the user to select the current image, and the function returns the index of the selected image.

Examples

Run this code
# \donttest{
# Not run:
path <- system.file('extdata/frames/', package='BioTrajectory')
image_files <- list.files(path, pattern = "\\.png$", full.names = TRUE)
selFrame(image_files)
# }

Run the code above in your browser using DataLab