#NEWLINE# def get_mask( self , subject , xfmname , type = 'thick' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . auxfile . get_mask ( subject , type , type ) #NEWLINE# #UNINDENT# except ( AttributeError , IOError ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# fname = self . get_paths ( subject ) [ 'masks' ] . format ( xfmname = xfmname , type = type ) #NEWLINE# try : #NEWLINE# #INDENT# import nibabel #NEWLINE# nib = nibabel . load ( fname ) #NEWLINE# return ( nib . get_data ( ) . T != 0 ) #NEWLINE# #UNINDENT# except IOError : #NEWLINE# #INDENT# print ( 'Mask not found, generating...' ) #NEWLINE# from . utils import get_cortical_mask #NEWLINE# mask = get_cortical_mask ( subject , xfmname , type ) #NEWLINE# self . save_mask ( subject , xfmname , type , mask ) #NEWLINE# return mask