#NEWLINE# def get_surfinfo( self , subject , type = 'curvature' , recache = False , **kwargs ) : #NEWLINE# #INDENT# 'Return auxillary surface information from the filestore. Surface info is defined as \n        anatomical information specific to a subject in surface space. A Vertex class will be returned\n        as necessary. Info not found in the filestore will be automatically generated.\n\n        See documentation in cortex.surfinfo for auto-generation code\n\n        Parameters\n        ----------\n        subject: str\n            Subject name for which to return info\n        type: str\n            Type of surface info returned, IE. curvature, distortion, sulcaldepth, etc.\n        recache: bool\n            Regenerate the information\n\n        Returns\n        -------\n        verts : Vertex class\n            If the surface information has "left" and "right" entries, a Vertex class is returned\n\n        - OR -\n        \n        npz : npzfile\n            Otherwise, an npz object is returned. Remember to close it!\n        ' #NEWLINE# opts = '' #NEWLINE# if ( len ( kwargs ) > 0 ) : #NEWLINE# #INDENT# opts = ( '[%s]' % ',' . join ( [ ( '%s=%s' % i ) for i in kwargs . items ( ) ] ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . auxfile . get_surf ( subject , 'fiducial' ) #NEWLINE# surfifile = os . path . join ( self . get_cache ( subject ) , ( '%s%s.npz' % ( type , opts ) ) ) #NEWLINE# #UNINDENT# except ( AttributeError , IOError ) : #NEWLINE# #INDENT# surfiform = self . get_paths ( subject ) [ 'surfinfo' ] #NEWLINE# surfifile = surfiform . format ( type = type , opts = opts ) #NEWLINE# if ( not os . path . exists ( os . path . join ( self . filestore , subject , 'surface-info' ) ) ) : #NEWLINE# #INDENT# os . makedirs ( os . path . join ( self . filestore , subject , 'surface-info' ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( ( not os . path . exists ( surfifile ) ) or recache ) : #NEWLINE# #INDENT# print ( ( 'Generating %s surface info...' % type ) ) #NEWLINE# from . import surfinfo #NEWLINE# getattr ( surfinfo , type ) ( surfifile , subject , ** kwargs ) #NEWLINE# #UNINDENT# npz = np . load ( surfifile ) #NEWLINE# if ( ( 'left' in npz ) and ( 'right' in npz ) ) : #NEWLINE# #INDENT# from . dataset import Vertex #NEWLINE# verts = np . hstack ( [ npz [ 'left' ] , npz [ 'right' ] ] ) #NEWLINE# npz . close ( ) #NEWLINE# return Vertex ( verts , subject ) #NEWLINE# #UNINDENT# return npz