visualSelect: Edit ring borders visually

Description Usage Arguments Details Value Author(s) Examples

Description

This function can delete existing ring borders and add new borders visually.

Usage

1
visualSelect(ring.data, del = NULL, del.u = NULL, del.l = NULL, add = FALSE)

Arguments

ring.data

A matrix or array produced by autoDetect.

del

A numeric vector giving the border numbers to be deleted.

del.u

A numeric vector giving the border numbers to be deleted on the upper path.

del.l

A numeric vector giving the border numbers to be deleted on the lower path.

add

A logical value indicating whether to re-add ring borders visually.

Details

This function is used to delete existing ring borders, or to add new borders by interactively clicking on the image segments.

If the user creates only one path (incline = FALSE), the argument del is used to delete ring borders. If the user creates two paths (incline = TRUE), arguments del.u and del.l are used to delete ring borders.

If add = TRUE, graphical windows where image segments are plotted will be activated sequentially. When a graphical window is activated, the user can add new borders by left-clicking the mouse along the path. This visual selection process can be terminated by clicking the right button and selecting ‘Stop’ from the menu, or from the ‘Stop’ button on the top-left corner of the graphical window (depending on the R version).

Once the user terminates the visual selection process, the current graphical window will be closed automatically, and the graphical window of the following segment is activated. When all graphical windows are closed, this function will re-open graphical windows and plot new borders.

This function can perform both operations (deletion and addition) in one call. A deletion of borders takes precedence over addition.

Value

A matrix or array representing the tree ring image.

Author(s)

Jingning Shi

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
img.path <- system.file("001.png", package = "MtreeRing")

## Read and plot the image:
t1 <- imgInput(img = img.path, dpi = 1200)

## Split a long core sample into 3 pieces to
## get better display performance and use the
## watershed algorithm to detect ring borders:
t2 <- autoDetect(ring.data = t1, seg = 3, method = 'watershed')

## Do not modify t2, but create a new array object t3. 
## Delete some borders without adding new borders:
t3 <- visualSelect(ring.data = t2, del = c(1, 3, 5, 19:21), add = FALSE)

JingningShi/GifRepo documentation built on May 14, 2019, 10:59 p.m.