ggbrain_slices {ggbrain}R Documentation

R6 class for managing slice data for ggbrain plots

Description

R6 class for managing slice data for ggbrain plots

R6 class for managing slice data for ggbrain plots

Active bindings

slice_index

read-only access to the slice_index containing the slice numbers

coord_input

the input string used to lookup the slices

coord_label

the calculated x, y, or z coordinate of the relevant slice

slice_number

the slice number along the relevant axis of the 3D image matrix

slice_data

a nested list of data.frames where each element contains all data relevant to that slice and the list elements within are each a given image

slice_matrix

the slice data in matrix form

slice_labels

a data.frame for each slice containing the coordinates of labels available to be drawn

layer_names

a character vector of layer names within each slice

Methods

Public methods


Method new()

create a ggbrain_slices object based

Usage
ggbrain_slices$new(slice_df = NULL)
Arguments
slice_df

a data.frame generated by ggbrain_images$get_slices()

Details

If this becomes a user-facing/exported class, we may want a more friendly constructor


Method compute_contrasts()

computes contrasts of the sliced image data

Usage
ggbrain_slices$compute_contrasts(contrast_list = NULL)
Arguments
contrast_list

a named list or character vector containing contrasts to be computed. The names of the list form the contrast names, while the values should be character strings that use standard R syntax for logical tests, subsetting, and arithmetic


Method as_tibble()

convert the slices object into a data.frame with list-columns for slice data elements

Usage
ggbrain_slices$as_tibble()

Method get_ranges()

calculates the numeric ranges of each image/contrast in this object, across all constituent slices. This is useful for setting scale limits that are shared across panels

Usage
ggbrain_slices$get_ranges(slice_indices = NULL)
Arguments
slice_indices

an optional integer vector of slice indices to be used as a subset in the calculation

Returns

a tibble keyed by 'layer' with overall low and high values, as well as split by pos/neg


Method get_uvals()

returns a data.frame with the unique values for each label layer, across all constituent slices

Usage
ggbrain_slices$get_uvals(slice_indices = NULL)
Arguments
slice_indices

an optional integer vector of slice indices to be used as a subset in the calculation


Method clone()

The objects of this class are cloneable with this method.

Usage
ggbrain_slices$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

Michael Hallquist


[Package ggbrain version 0.8.1 Index]