def _process_bti_headshape(fname, convert=True, use_hpi=True):
 (idx_points, dig_points) = _read_head_shape(fname)
 if convert:
  ctf_head_t = _get_ctf_head_to_head_t(idx_points)
 else:
  ctf_head_t = Transform('ctf_head', 'ctf_head')
 if (dig_points is not None):
  all_points = np.r_[(idx_points, dig_points)]
 else:
  all_points = idx_points
 if convert:
  all_points = _convert_hs_points(all_points, ctf_head_t)
 dig = _points_to_dig(all_points, len(idx_points), use_hpi)
 return (dig, ctf_head_t)

def _process_bti_headshape ( fname , convert = True , use_hpi = True ) : ( idx_points , dig_points ) = _read_head_shape ( fname ) if convert : ctf_head_t = _get_ctf_head_to_head_t ( idx_points ) else : ctf_head_t = Transform ( 'ctf_head' , 'ctf_head' ) if ( dig_points is not None ) : all_points = np . r_ [ ( idx_points , dig_points ) ] else : all_points = idx_points if convert : all_points = _convert_hs_points ( all_points , ctf_head_t ) dig = _points_to_dig ( all_points , len ( idx_points ) , use_hpi ) return ( dig , ctf_head_t )
read index points and dig points from bti head shape file .