@testing.requires_testing_data
def test_min_distance_fit_dipole():
 subject = 'sample'
 raw = read_raw_fif(fname_raw, preload=True)
 picks = pick_types(raw.info, meg=False, eeg=True, exclude='bads')
 info = pick_info(raw.info, picks)
 cov = read_cov(fname_cov)
 cov['data'] = np.eye(cov['data'].shape[0])
 simulated_scalp_map = np.zeros(picks.shape[0])
 simulated_scalp_map[27:34] = 1
 simulated_scalp_map = simulated_scalp_map[:, None]
 evoked = EvokedArray(simulated_scalp_map, info, tmin=0)
 min_dist = 5.0
 bem = read_bem_solution(fname_bem)
 (dip, residual) = fit_dipole(evoked, cov, bem, fname_trans, min_dist=min_dist)
 dist = _compute_depth(dip, fname_bem, fname_trans, subject, subjects_dir)
 assert_true(((min_dist - 0.1) < (dist[0] * 1000.0) < (min_dist + 1.0)))
 assert_raises(ValueError, fit_dipole, evoked, cov, fname_bem, fname_trans, (-1.0))

@ testing . requires_testing_data def test_min_distance_fit_dipole ( ) : subject = 'sample' raw = read_raw_fif ( fname_raw , preload = True ) picks = pick_types ( raw . info , meg = False , eeg = True , exclude = 'bads' ) info = pick_info ( raw . info , picks ) cov = read_cov ( fname_cov ) cov [ 'data' ] = np . eye ( cov [ 'data' ] . shape [ 0 ] ) simulated_scalp_map = np . zeros ( picks . shape [ 0 ] ) simulated_scalp_map [ 27 : 34 ] = 1 simulated_scalp_map = simulated_scalp_map [ : , None ] evoked = EvokedArray ( simulated_scalp_map , info , tmin = 0 ) min_dist = 5.0 bem = read_bem_solution ( fname_bem ) ( dip , residual ) = fit_dipole ( evoked , cov , bem , fname_trans , min_dist = min_dist ) dist = _compute_depth ( dip , fname_bem , fname_trans , subject , subjects_dir ) assert_true ( ( ( min_dist - 0.1 ) < ( dist [ 0 ] * 1000.0 ) < ( min_dist + 1.0 ) ) ) assert_raises ( ValueError , fit_dipole , evoked , cov , fname_bem , fname_trans , ( - 1.0 ) )
test dipole min_dist to inner_skull .