Learn R Programming

webmorphR (version 0.1.1)

draw_tem: Draw template

Description

Visualise a template on an image.

Usage

draw_tem(
  stimuli,
  pt.color = wm_opts("pt.color"),
  pt.alpha = 0.75,
  pt.size = NULL,
  pt.shape = c("circle", "cross", "index"),
  line.color = wm_opts("line.color"),
  line.alpha = 0.5,
  line.size = NULL,
  bg = "image"
)

Arguments

stimuli

list of stimuli

pt.color, line.color

line or point color, see color_conv()

pt.alpha, line.alpha

transparency (0-1), ignored if color is a hex value with transparency. Set alpha to 0 to omit lines or points.

pt.size, line.size

size in pixels (scales to image size if NULL)

pt.shape

the shape of the points ("circle", "cross", "index")

bg

background color ("image" uses the original image)

Value

list of stimuli with template images

Details

Visualising the index of each point isn't great yet and will overlay

See Also

Template functions auto_delin(), average_tem(), centroid(), change_lines(), delin(), features(), get_point(), remove_tem(), require_tems(), same_tems(), squash_tem(), subset_tem(), tem_def(), viz_tem_def()

Visualisation functions as_ggplot(), gglabel(), label(), mlabel(), plot.stimlist(), plot.stim(), plot_rows(), plot_stim()

Examples

Run this code
# NOT RUN {
# get an image with 2 different templates
stimuli <- demo_tems("frl|fpp106")

# default template
draw_tem(stimuli)

# }
# NOT RUN {
# custom template
draw_tem(stimuli, 
         pt.shape = "cross",
         pt.color = "red", 
         pt.alpha = 1,
         pt.size = 15,
         line.color = rgb(0, 0, 0),
         line.alpha = 0.5,
         line.size = 5)

# indexed template
draw_tem(stimuli, 
         pt.shape = "index",
         pt.size = 15, 
         pt.alpha = 1,
         line.alpha = 0)
# }

Run the code above in your browser using DataLab