def _points_to_dig(points, n_idx_points, use_hpi):
 idx_idents = (list(range(1, 4)) + list(range(1, ((n_idx_points + 1) - 3))))
 dig = []
 for idx in range(points.shape[0]):
  point_info = dict(zip(FIFF_INFO_DIG_FIELDS, FIFF_INFO_DIG_DEFAULTS))
  point_info['r'] = points[idx]
  if (idx < 3):
   point_info['kind'] = FIFF.FIFFV_POINT_CARDINAL
   point_info['ident'] = idx_idents[idx]
  if ((2 < idx < n_idx_points) and use_hpi):
   point_info['kind'] = FIFF.FIFFV_POINT_HPI
   point_info['ident'] = idx_idents[idx]
  elif (idx > 4):
   point_info['kind'] = FIFF.FIFFV_POINT_EXTRA
   point_info['ident'] = ((idx + 1) - len(idx_idents))
  if ((2 < idx < n_idx_points) and (not use_hpi)):
   pass
  else:
   dig += [point_info]
 return dig

def _points_to_dig ( points , n_idx_points , use_hpi ) : idx_idents = ( list ( range ( 1 , 4 ) ) + list ( range ( 1 , ( ( n_idx_points + 1 ) - 3 ) ) ) ) dig = [ ] for idx in range ( points . shape [ 0 ] ) : point_info = dict ( zip ( FIFF_INFO_DIG_FIELDS , FIFF_INFO_DIG_DEFAULTS ) ) point_info [ 'r' ] = points [ idx ] if ( idx < 3 ) : point_info [ 'kind' ] = FIFF . FIFFV_POINT_CARDINAL point_info [ 'ident' ] = idx_idents [ idx ] if ( ( 2 < idx < n_idx_points ) and use_hpi ) : point_info [ 'kind' ] = FIFF . FIFFV_POINT_HPI point_info [ 'ident' ] = idx_idents [ idx ] elif ( idx > 4 ) : point_info [ 'kind' ] = FIFF . FIFFV_POINT_EXTRA point_info [ 'ident' ] = ( ( idx + 1 ) - len ( idx_idents ) ) if ( ( 2 < idx < n_idx_points ) and ( not use_hpi ) ) : pass else : dig += [ point_info ] return dig
put points in info dig structure .