#NEWLINE# def _on_pick( self , picker ) : #NEWLINE# #INDENT# if self . locked : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# self . picker = picker #NEWLINE# n_pos = len ( picker . picked_positions ) #NEWLINE# if ( n_pos == 0 ) : #NEWLINE# #INDENT# logger . debug ( 'GUI: picked empty location' ) #NEWLINE# return #NEWLINE# #UNINDENT# if ( picker . actor is self . hsp_obj . surf . actor . actor ) : #NEWLINE# #INDENT# idxs = [ ] #NEWLINE# idx = None #NEWLINE# pt = [ picker . pick_position ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . hsp_obj . surf . actor . actor in picker . actors ) : #NEWLINE# #INDENT# idxs = [ i for i in range ( n_pos ) if ( picker . actors [ i ] is self . hsp_obj . surf . actor . actor ) ] #NEWLINE# idx = idxs [ ( - 1 ) ] #NEWLINE# pt = [ picker . picked_positions [ idx ] ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . debug ( 'GUI: picked object other than MRI' ) #NEWLINE# #UNINDENT# #UNINDENT# def round_( x ) : #NEWLINE# #INDENT# return round ( x , 3 ) #NEWLINE# #UNINDENT# poss = [ map ( round_ , pos ) for pos in picker . picked_positions ] #NEWLINE# pos = map ( round_ , picker . pick_position ) #NEWLINE# msg = [ ( 'Pick Event: %i picked_positions:' % n_pos ) ] #NEWLINE# line = str ( pos ) #NEWLINE# if ( idx is None ) : #NEWLINE# #INDENT# line += ' <-pick_position' #NEWLINE# #UNINDENT# msg . append ( line ) #NEWLINE# for ( i , pos ) in enumerate ( poss ) : #NEWLINE# #INDENT# line = str ( pos ) #NEWLINE# if ( i == idx ) : #NEWLINE# #INDENT# line += ' <- MRI mesh' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( i in idxs ) : #NEWLINE# #INDENT# line += ' (<- also MRI mesh)' #NEWLINE# #UNINDENT# #UNINDENT# msg . append ( line ) #NEWLINE# #UNINDENT# logger . debug ( os . linesep . join ( msg ) ) #NEWLINE# if ( self . set == 'Nasion' ) : #NEWLINE# #INDENT# self . nasion = pt #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . set == 'LPA' ) : #NEWLINE# #INDENT# self . lpa = pt #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . set == 'RPA' ) : #NEWLINE# #INDENT# self . rpa = pt #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( ( 'set = %r' % self . set ) )