def _compute_depth(dip, fname_bem, fname_trans, subject, subjects_dir):
 trans = _get_trans(fname_trans)[0]
 bem = read_bem_solution(fname_bem)
 surf = _bem_find_surface(bem, 'inner_skull')
 points = surf['rr']
 points = apply_trans(trans['trans'], points)
 depth = _compute_nearest(points, dip.pos, return_dists=True)[1][0]
 return np.ravel(depth)

def _compute_depth ( dip , fname_bem , fname_trans , subject , subjects_dir ) : trans = _get_trans ( fname_trans ) [ 0 ] bem = read_bem_solution ( fname_bem ) surf = _bem_find_surface ( bem , 'inner_skull' ) points = surf [ 'rr' ] points = apply_trans ( trans [ 'trans' ] , points ) depth = _compute_nearest ( points , dip . pos , return_dists = True ) [ 1 ] [ 0 ] return np . ravel ( depth )
compute dipole depth .