@verbose
def cross_talk_function(inverse_operator, forward, labels, method='dSPM', lambda2=(1 / 9.0), signed=False, mode='mean', n_svd_comp=1, verbose=None):
 forward = convert_forward_solution(forward, force_fixed=True, surf_ori=True)
 out = _get_matrix_from_inverse_operator(inverse_operator, forward, labels=labels, method=method, lambda2=lambda2, mode=mode, n_svd_comp=n_svd_comp)
 (invmat, label_singvals) = out
 leadfield = _pick_leadfield(forward['sol']['data'], forward, inverse_operator['info']['ch_names'])
 ctfs = np.dot(invmat, leadfield)
 ctfs = np.vstack((ctfs, ctfs.sum(axis=0)))
 if (not signed):
  ctfs = np.abs(ctfs, out=ctfs)
 vertno = [ss['vertno'] for ss in inverse_operator['src']]
 stc_ctf = SourceEstimate(ctfs.T, vertno, tmin=0.0, tstep=1.0)
 stc_ctf.subject = _subject_from_inverse(inverse_operator)
 return stc_ctf

@ verbose def cross_talk_function ( inverse_operator , forward , labels , method = 'dSPM' , lambda2 = ( 1 / 9.0 ) , signed = False , mode = 'mean' , n_svd_comp = 1 , verbose = None ) : forward = convert_forward_solution ( forward , force_fixed = True , surf_ori = True ) out = _get_matrix_from_inverse_operator ( inverse_operator , forward , labels = labels , method = method , lambda2 = lambda2 , mode = mode , n_svd_comp = n_svd_comp ) ( invmat , label_singvals ) = out leadfield = _pick_leadfield ( forward [ 'sol' ] [ 'data' ] , forward , inverse_operator [ 'info' ] [ 'ch_names' ] ) ctfs = np . dot ( invmat , leadfield ) ctfs = np . vstack ( ( ctfs , ctfs . sum ( axis = 0 ) ) ) if ( not signed ) : ctfs = np . abs ( ctfs , out = ctfs ) vertno = [ ss [ 'vertno' ] for ss in inverse_operator [ 'src' ] ] stc_ctf = SourceEstimate ( ctfs . T , vertno , tmin = 0.0 , tstep = 1.0 ) stc_ctf . subject = _subject_from_inverse ( inverse_operator ) return stc_ctf
compute cross-talk functions for linear estimators .