aba_slice_anno_boundaries: Generate array annotation boundary segments for ggplot2

Description Usage Arguments Value Examples

View source: R/aba.R

Description

Generate array annotation boundary segments for ggplot2

Usage

1
aba_slice_anno_boundaries(anno, slice_num, plane = "coronal")

Arguments

anno

A 3-d annotation array like that generated by aba_get_annotation_array()

slice_num

A number indicating which slice to use.

plane

Which plane to return. Options are "coronal", "saggital", and "horizontal". Default is "coronal"

Value

a data.frame of segment coordinates with x, xend, y, and yend.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(dplyr)
library(ggplot2)

boundary_df <- aba_get_annotation_array() %>%
  aba_symmetrize_matrix("min") %>%
  aba_melt_3d("atlas_id") %>%
  filter(atlas_id != 0) %>%
  aba_slice_anno_boundaries(30, "coronal")

ggplot(boundary_df) +
  geom_segment(aes(x = x, xend = xend,
                   y = y, yend = yend)) +
  scale_y_reverse()

hypercompetent/xstitch documentation built on July 22, 2019, 10:11 p.m.