| ggbrain_layer_outline {ggbrain} | R Documentation |
R6 class for a single layer of a ggbrain panel using outline geom
Description
R6 class for a single layer of a ggbrain panel using outline geom
R6 class for a single layer of a ggbrain panel using outline geom
Details
Note that this class is exported only for power users and rarely needs to be called directly
in typical use of the package. Instead, look at geom_outline().
Value
a ggbrain_layer_outline R6 class with fields related to a brain visual layer (relates to geom_outline)
Super class
ggbrain::ggbrain_layer -> ggbrain_layer_outline
Active bindings
mappingthe ggplot2 aesthetic mapping between the data columns and the display
outlinecontrols color of outline draw around non-NA (valid) voxels
outline_scalea scale_fill_* object containing the ggplot2 outline color scale for this layer
sizecontrols size of outline drawn around non-NA (valid) voxels
dil_erocontrols the number of pixels to dilate (> 0) or erode (< 0) the outline
Methods
Public methods
Inherited methods
ggbrain::ggbrain_layer$add_to_gg()ggbrain::ggbrain_layer$get_data()ggbrain::ggbrain_layer$is_empty()ggbrain::ggbrain_layer$plot()ggbrain::ggbrain_layer$set_breaks()ggbrain::ggbrain_layer$set_limits()ggbrain::ggbrain_layer$set_neg_breaks()ggbrain::ggbrain_layer$set_neg_limits()ggbrain::ggbrain_layer$set_pos_breaks()ggbrain::ggbrain_layer$set_pos_limits()
Method new()
create a new ggbrain_layer object
Usage
ggbrain_layer_outline$new( name = NULL, definition = NULL, limits = NULL, breaks = integer_breaks(), show_legend = TRUE, interpolate = NULL, unify_scales = TRUE, alpha = NULL, mapping = ggplot2::aes(outline = NULL, fill = NULL), outline = NULL, outline_scale = NULL, size = NULL, blur_edge = NULL, fill_holes = NULL, remove_specks = NULL, trim_threads = NULL, dil_ero = NULL, data = NULL )
Arguments
namethe name of this layer, used for referencing in layer and panel modifications
definitionan optional character string defining the image or contrast that should be used to lookup data from a ggbrain_slices object. This is mostly used internally by the ggbrain + syntax to allow layers to be defined without data in advance of the plot.
limitsif provided, sets the upper and lower bounds on the scale
breaksif provided, a function to draw the breaks on the color scale
show_legendif TRUE, show the scale on the plot legend
interpolatepasses to geom_raster and controls whether the fill is interpolated over continuous space
unify_scalesif TRUE, when this layer is reused across panels, unify the scales to match
alphaa number between 0 and 1 that sets the alpha transparency of this layer. Default: 1
mappingthe aesthetic mapping of the layer data to the display. Should be an aes() object and supports
outline(color of outline around clusters). Default isaes(outline=value), which maps the numeric value of the layer data to the outline color of the squares at around spatial regions. For labeled data, you might useaes(fill=<label_col_name>).outlineA character string indicating the color used to outline all non-NA pixels in this layer. This is used in distinction to
mapping=aes(outline=<variable>).outline_scalea ggplot scale object used for mapping the value column as the outline color for the layer.
sizecontrols the thickness of outlines
blur_edgethe standard deviation (sigma) of a Gaussian kernel applied to the edge of this layer to smooth it. This makes the layer less jagged in appearance and is akin to antialiasing.
fill_holesthe size of holes (in pixels) inside clusters to be filled by nearest neighbor imputation prior to display
remove_specksthe size of specks (in pixels) to be removed from each slice prior to display
trim_threadsthe minimum number of neighboring pixels (including diagonals) that must be present to keep a pixel
dil_erothe number of pixels to dilate (> 0) or erode (<0) the outline.
datathe data.frame containing image data for this layer. Must contain "dim1", "dim2", and "value" as columns
Details
To set mapping, you must provide a ggplot2 aes() object. A geom_outline() layer requires
an outline aesthetic mapping, which controls the color of outlines drawn around regions.
note that the ggbrain_layer_outline class maps onto *_fill fields
Method clone()
The objects of this class are cloneable with this method.
Usage
ggbrain_layer_outline$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.