#NEWLINE# def save( self , filename , pack = False ) : #NEWLINE# #INDENT# import tables #NEWLINE# h5 = tables . openFile ( filename , 'a' ) #NEWLINE# _hdf_init ( h5 ) #NEWLINE# for ( name , data ) in self . datasets . items ( ) : #NEWLINE# #INDENT# data . save ( h5 , name = name ) #NEWLINE# #UNINDENT# if pack : #NEWLINE# #INDENT# subjs = set ( ) #NEWLINE# xfms = set ( ) #NEWLINE# masks = set ( ) #NEWLINE# for ( name , data ) in self . datasets . items ( ) : #NEWLINE# #INDENT# subjs . add ( data . subject ) #NEWLINE# xfms . add ( ( data . subject , data . xfmname ) ) #NEWLINE# if data . linear : #NEWLINE# #INDENT# masks . add ( ( data . subject , data . xfmname , data . masktype ) ) #NEWLINE# #UNINDENT# #UNINDENT# _pack_subjs ( h5 , subjs ) #NEWLINE# _pack_xfms ( h5 , xfms ) #NEWLINE# _pack_masks ( h5 , masks ) #NEWLINE# #UNINDENT# h5 . close ( )