clean_patterns: Automatically recognize, clean and label the pixels of a...

Description Usage Arguments Details Value Author(s) Examples

View source: R/clean.R

Description

The function clean_patterns implements a k-means clustering-based automatic cleaning of the continuous dorsal pattern of a female brown anole lizard traced from the ImageJ software.

Usage

1
clean_patterns(data, kmeans = TRUE, seed = 123, outliers = TRUE)

Arguments

data

a data.table or data.frame: an input data should have two columns x and y in that order, indicating the x-coordinates and the y-coordinates, respectively. The columns should be of type "numeric".

kmeans

logical, whether to use k-means clustering to eliminate a reference pixel, if any. Defaults to TRUE. See the details below.

seed

a single value, interpreted as an integer with the default set to 123.

outliers

logical, whether to eliminate potential outliers in the x-coordinate even after removing the 1cm reference line with k-means clustering. Defaults to TRUE.

Details

clean_patterns implements a k-means clustering-based automatic cleaning of the continuous dorsal pattern of a female brown anole lizard, Anolis sagrei, traced from ImageJ, an open source image processing program designed for scientific multidimensional images. The function efficiently

Value

Returns a data.table object with the following three columns:

x, y

the xy-coordinate of a pixel; type "numeric"

loc

the location label of a pixel, one of LEFT, RIGHT, MID; type "character"

Author(s)

Seong Hyun Hwang, Rachel Myoung Moon

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# load the sample dorsal pattern image
data(anole)

# plot of the pattern shows it contains the reference pixel
plot(anole$x, anole$y)

# remove the reference pixel, possible outliers and ambiguities
cleaned <- clean_patterns(anole)

# check the plot again
plot(cleaned$x, cleaned$y)

patternator documentation built on May 2, 2019, 6:12 a.m.