#NEWLINE# @ on_trait_change ( 'subjects_dir,subject' ) #NEWLINE# def _subject_changed( self ) : #NEWLINE# #INDENT# subject = self . subject #NEWLINE# subjects_dir = self . subjects_dir #NEWLINE# if ( ( not subjects_dir ) or ( not subject ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# path = head_bem_fname . format ( subjects_dir = subjects_dir , subject = subject ) #NEWLINE# self . bem . file = path #NEWLINE# path = fid_fname . format ( subjects_dir = subjects_dir , subject = path ) #NEWLINE# if os . path . exists ( path ) : #NEWLINE# #INDENT# self . fid_file = path #NEWLINE# self . lock_fiducials = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# path = fid_fname_general . format ( subjects_dir = subjects_dir , subject = subject , head = '*' ) #NEWLINE# fnames = glob ( path ) #NEWLINE# if fnames : #NEWLINE# #INDENT# path = fnames [ 0 ] #NEWLINE# self . fid . file = path #NEWLINE# self . lock_fiducials = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . fid . reset_traits ( [ 'file' ] ) #NEWLINE# self . lock_fiducials = False #NEWLINE# #UNINDENT# #UNINDENT# self . reset_fiducials ( )