#NEWLINE# @ classmethod #NEWLINE# def _cache( cls , filename , subject , xfmname , **kwargs ) : #NEWLINE# #INDENT# from .. import db #NEWLINE# masks = [ ] #NEWLINE# xfm = db . get_xfm ( subject , xfmname , xfmtype = 'coord' ) #NEWLINE# pia = db . get_surf ( subject , 'pia' , merge = False , nudge = False ) #NEWLINE# wm = db . get_surf ( subject , 'wm' , merge = False , nudge = False ) #NEWLINE# for ( ( wpts , polys ) , ( ppts , _ ) ) in zip ( pia , wm ) : #NEWLINE# #INDENT# masks . append ( cls . _getmask ( xfm ( ppts ) , xfm ( wpts ) , polys , xfm . shape , ** kwargs ) ) #NEWLINE# #UNINDENT# _savecache ( filename , masks [ 0 ] , masks [ 1 ] , xfm . shape ) #NEWLINE# return cls ( masks [ 0 ] , masks [ 1 ] , xfm . shape )