Learn R Programming

ANTsR (version 0.3.1)

plotBasicNetwork: Simple plotBasicNetwork function.

Description

takes an object output from renderSurfaceFunction and a list of centroids and plots the centroid network over the rendering object

Usage

plotBasicNetwork(centroids, brain, weights = NA, edgecolors = 0,
  nodecolors = "blue", nodetype = "s", scaling = c(0, 0), lwd = 2,
  radius = 3, showOnlyConnectedNodes = TRUE)

Arguments

centroids

input matrix of size number of 3D points ( in rows ) by 3 ( in columns )

brain

input rendering object which is output of renderSurfaceFunction or a function derived from renderSurfaceFunction

weights

edge weights

edgecolors

a color(map) for edges

nodecolors

a color(map) for nodes

nodetype

sphere or other node type

scaling

controls functional range

lwd

line width

radius

for nodes

showOnlyConnectedNodes

boolean

Value

None

Examples

Run this code
# NOT RUN {
# more complete example
  mnit<-getANTsRData("mni")
  mnit<-antsImageRead(mnit)
  mnia<-getANTsRData("mnia")
  mnia<-antsImageRead(mnia)
  mnit<-thresholdImage( mnit, 1, max(mnit) )
  mnit<-iMath(mnit,"FillHoles")
  cnt<-getCentroids( mnia, clustparam = 50 )
  aalcnt<-cnt[1:90,1:3]
  brain<-renderSurfaceFunction( surfimg =list( mnit ) , alphasurf=0.1 ,smoothsval = 1.5 )
  testweights<-matrix( rep( 0, 90*90 ) ,nrow=90)
  testweights[31,37]<-1  # ant cingulate to hipp
  testweights[31,36]<-2  # ant cingulate to post cingulate
  testweights[11,65]<-3  # broca to angular
  plotBasicNetwork( centroids = aalcnt , brain , weights=testweights )
  id<-rgl::par3d('userMatrix')
  rid<-rotate3d( id , -pi/2, 1, 0, 0 )
  rid2<-rotate3d( id , pi/2, 0, 0, 1 )
  rid3<-rotate3d( id , -pi/2, 0, 0, 1 )
  rgl::par3d(userMatrix = id )
  dd<-make3ViewPNG(  rid, id, rid2,  paste('network1',sep='') )
  rgl::par3d(userMatrix = id )
# }

Run the code above in your browser using DataLab