#NEWLINE# def getSurf( self , subject , type , hemi = 'both' , merge = False , nudge = False ) : #NEWLINE# #INDENT# import tables #NEWLINE# if ( hemi == 'both' ) : #NEWLINE# #INDENT# left = self . getSurf ( subject , type , 'lh' ) #NEWLINE# right = self . getSurf ( subject , type , 'rh' ) #NEWLINE# if merge : #NEWLINE# #INDENT# pts = np . vstack ( [ left [ 0 ] , nudge [ 0 ] ] ) #NEWLINE# polys = np . vstack ( [ left [ 1 ] , ( right [ 1 ] + len ( left [ 0 ] ) ) ] ) #NEWLINE# return ( pts , polys ) #NEWLINE# #UNINDENT# return ( left , right ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# node = getattr ( getattr ( getattr ( self . subjects , subject ) . surfaces , type ) , hemi ) #NEWLINE# ( pts , polys ) = ( node . pts [ : ] , node . polys [ : ] ) #NEWLINE# if nudge : #NEWLINE# #INDENT# if ( hemi == 'lh' ) : #NEWLINE# #INDENT# pts [ : , 0 ] -= pts [ : , 0 ] . min ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# pts [ : , 0 ] -= pts [ : , 0 ] . max ( ) #NEWLINE# #UNINDENT# #UNINDENT# return ( pts , polys ) #NEWLINE# #UNINDENT# except tables . NoSuchNodeError : #NEWLINE# #INDENT# raise IOError ( 'Subject not found in package' )