Learn R Programming

ANTsR (version 1.0)

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 = centroids, brain )

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

Value

None

Examples

Run this code
# NOT RUN {
brain<-renderSurfaceFunction( surfimg =list( mymni[[1]] ) , alphasurf=0.1 , smoothsval = 1.5  )
plotBasicNetwork( centroids = centroids, brain )
# more complete example 
  mnit<-getANTsRData("mni")
  mnit<-antsImageRead(mnit,3)
  mnia<-getANTsRData("mnia")
  mnia<-antsImageRead(mnia,3)
  ThresholdImage(3,mnit,mnit,1,max(mnit))
  ImageMath(3,mnit,"FillHoles",mnit)
  cnt<-getCentroids( mnia, clustparam = 50 )
  aalcnt<-cnt$centroids[1:90,]
  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<-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 )
  par3d(userMatrix = id ) 
  dd<-make3ViewPNG(  rid, id, rid2,  paste('network1',sep='') )
  par3d(userMatrix = id ) 
# }

Run the code above in your browser using DataLab