def test_fiducials_io():
 tempdir = _TempDir()
 (pts, coord_frame) = read_fiducials(fiducials_fname)
 assert_equal(pts[0]['coord_frame'], FIFF.FIFFV_COORD_MRI)
 assert_equal(pts[0]['ident'], FIFF.FIFFV_POINT_CARDINAL)
 temp_fname = op.join(tempdir, 'test.fif')
 write_fiducials(temp_fname, pts, coord_frame)
 (pts_1, coord_frame_1) = read_fiducials(temp_fname)
 assert_equal(coord_frame, coord_frame_1)
 for (pt, pt_1) in zip(pts, pts_1):
  assert_equal(pt['kind'], pt_1['kind'])
  assert_equal(pt['ident'], pt_1['ident'])
  assert_equal(pt['coord_frame'], pt_1['coord_frame'])
  assert_array_equal(pt['r'], pt_1['r'])
 pts[0]['coord_frame'] += 1
 assert_raises(ValueError, write_fiducials, temp_fname, pts, coord_frame)

def test_fiducials_io ( ) : tempdir = _TempDir ( ) ( pts , coord_frame ) = read_fiducials ( fiducials_fname ) assert_equal ( pts [ 0 ] [ 'coord_frame' ] , FIFF . FIFFV_COORD_MRI ) assert_equal ( pts [ 0 ] [ 'ident' ] , FIFF . FIFFV_POINT_CARDINAL ) temp_fname = op . join ( tempdir , 'test.fif' ) write_fiducials ( temp_fname , pts , coord_frame ) ( pts_1 , coord_frame_1 ) = read_fiducials ( temp_fname ) assert_equal ( coord_frame , coord_frame_1 ) for ( pt , pt_1 ) in zip ( pts , pts_1 ) : assert_equal ( pt [ 'kind' ] , pt_1 [ 'kind' ] ) assert_equal ( pt [ 'ident' ] , pt_1 [ 'ident' ] ) assert_equal ( pt [ 'coord_frame' ] , pt_1 [ 'coord_frame' ] ) assert_array_equal ( pt [ 'r' ] , pt_1 [ 'r' ] ) pts [ 0 ] [ 'coord_frame' ] += 1 assert_raises ( ValueError , write_fiducials , temp_fname , pts , coord_frame )
test fiducials i/o .