brainconn plots and returns a ggraph object of plotted brain connectivity matrix..

brainconn(
  atlas,
  background = "ICBM152",
  view = "top",
  conmat = NULL,
  node.size = 4,
  node.color = "network",
  all.nodes = FALSE,
  edge.color = "black",
  edge.alpha = 0.8,
  edge.width = 1,
  edge.color.weighted = FALSE,
  labels = FALSE,
  show.legend = TRUE,
  thr = NULL,
  uthr = NULL,
  scale.edge.width = NULL,
  label.size = 1.5,
  background.alpha = 1
)

Arguments

background

'ICBM152', currently the only background option

view

A sting to choose the view. Can be any of these: c("ortho", "top", "bottom", "left", "right")

conmat

A adjacency matrix. Can be binary, weights, directed or undirected. see example_* data.

node.size

A integer that determines the diameter of the nodes. Can also be a vector of integers with a length equal to the number of ROIs in the atlas

node.color

A string that sets the node color. e.g. "blue". If set to "network", then nodes will be colored according to the network column of the atlas

all.nodes

if TRUE, then all nodes will be shown be hemisphere without ticks. If FALSE, then only nodes with connecting edges will be shown.

edge.color

A string that sets the edge color. e.g. "blue".

edge.alpha

Number between 0-1 to set the transparency of the edges.

edge.width

Number to set the width of the edges.

edge.color.weighted

A boolean that applies when the conmat is weighted. if TRUE, then edges will be colored according to the weight FALSE, the edges will be sized according to weight.

labels

if TRUE, ROI labels for all visible nodes will be shown. If FALSE, then no labes will be shown.

show.legend

if TRUE, legend will be shown. If FALSE, then no legend will be shown.

thr

a optional value to set a threshold on the conmat (e.g. edges with a weighted value lower than the one set here will not be shown)

uthr

a optional value to set a upper threshold on the conmat (e.g. edges with a weighted value higher than the one set here will not be shown)

scale.edge.width

If edge.color.weighted=FALSE, you can use this rescale the edge.width according to weight. e.g. scale.edge.width = c(1,3)

label.size

If labels=TRUE then, label.size can can be set as in integer to control the size of the labels.

background.alpha

Number between 0-1 to set the transparency of the background.

Value

a ggraph object

Author

Sidhant Chopra

Examples

library(brainconn) x <- example_unweighted_undirected brainconn(atlas ="schaefer300_n7", conmat=x, node.size = 3, view="ortho")
#> Coordinate system already present. Adding new coordinate system, which will replace the existing one.