sidchop / brainconn

Brainconn - an R package for visualising brain connectivity data in 2D and interactive 3D
https://sidchop.github.io/brainconn/articles/brainconn.html
Other
41 stars 6 forks source link

Making a 11 by 11 custom atlas #17

Closed sidchop closed 3 years ago

sidchop commented 3 years ago

Email from Tajwar Sultana (PhD student):

"Using "brainconn" for pictorial representation of effective connectivity between brain regions.

In our project, we are finding effective connectivity between 11 brain regions. The ROI names and their MNI coordinates are:

PCC [0 -46 23]

mPFC [3 50 -7]

Left Hippocampus (lHC) [-28 -23 -11]

Right Hippocampus (rHC) [28 -17 -14]

Left Amygdala (lAMG) [-24 -4 -19]

Right Amygdala (rAMG) [20 -5 -17]

dACC [-6 32 26]

Left Insular (lINS) [-36 14 5]

Right Insular (rINS) [36 14 5]

lDLPFC [-45 44 -1]

rDLPFC [45 44 -1]

I want to know which atlas to use in brainconn function for our 11 x 11 matrix? For example, in schaefer300_n7, there are 300 ROIs and it will accept matrix with 300 rows only. So if we use this atlas then where its ROIs information can be found and will we provide sparse matrix with our respective region's data in it?"

Response:

Thanks for reaching out. To use brainconn with a custom 11x11 atlas, you have to create a custom atlas. (see the end of this vignette: https://sidchop.github.io/brainconn/articles/brainconn.html)

Here is some code that will do this for you in r:

#load brainconn
library(brainconn)

#create custom atlas
ROI.Name <- c("PCC", "mPFC", "lHC", "rHC", "lAMG", "rAMG", "dACC", "lINS", "rINS", "lDLPFC", "rDLPFC")
x.mni <- as.integer(c(0, 3, -28, 28, -24, 20, -6, -36, 36, -45, 45))
y.mni <- as.integer(c(-46, 50, -23,-17, -4,-5,32,14,14,44,44))
z.mni <- as.integer(c(23,-7,-11,-14,-19,-17,26,5,5,-1,-1))
network <- c("PCC", "mPFC", "lHC", "rHC", "lAMG", "rAMG", "dACC", "lINS", "rINS", "lDLPFC", "rDLPFC")
custom_atlas <- data.frame(ROI.Name, x.mni, y.mni,z.mni, network)

#check atlas meets brainconn specifications
check_atlas(custom_atlas)

#create a random 11 by 11 bimary matrix (you would enter your own dcm weights here)
r <- c <- 11
random_matrix <- matrix(rbinom(r*c,1,0.5),r,c)

#plot brain
brainconn(custom_atlas, conmat = random_matrix)

The output of this code: unnamed