def _write_bem_surfaces_block(fid, surfs):
 for surf in surfs:
  start_block(fid, FIFF.FIFFB_BEM_SURF)
  write_float(fid, FIFF.FIFF_BEM_SIGMA, surf['sigma'])
  write_int(fid, FIFF.FIFF_BEM_SURF_ID, surf['id'])
  write_int(fid, FIFF.FIFF_MNE_COORD_FRAME, surf['coord_frame'])
  write_int(fid, FIFF.FIFF_BEM_SURF_NNODE, surf['np'])
  write_int(fid, FIFF.FIFF_BEM_SURF_NTRI, surf['ntri'])
  write_float_matrix(fid, FIFF.FIFF_BEM_SURF_NODES, surf['rr'])
  write_int_matrix(fid, FIFF.FIFF_BEM_SURF_TRIANGLES, (surf['tris'] + 1))
  if (('nn' in surf) and (surf['nn'] is not None) and (len(surf['nn']) > 0)):
   write_float_matrix(fid, FIFF.FIFF_BEM_SURF_NORMALS, surf['nn'])
  end_block(fid, FIFF.FIFFB_BEM_SURF)

def _write_bem_surfaces_block ( fid , surfs ) : for surf in surfs : start_block ( fid , FIFF . FIFFB_BEM_SURF ) write_float ( fid , FIFF . FIFF_BEM_SIGMA , surf [ 'sigma' ] ) write_int ( fid , FIFF . FIFF_BEM_SURF_ID , surf [ 'id' ] ) write_int ( fid , FIFF . FIFF_MNE_COORD_FRAME , surf [ 'coord_frame' ] ) write_int ( fid , FIFF . FIFF_BEM_SURF_NNODE , surf [ 'np' ] ) write_int ( fid , FIFF . FIFF_BEM_SURF_NTRI , surf [ 'ntri' ] ) write_float_matrix ( fid , FIFF . FIFF_BEM_SURF_NODES , surf [ 'rr' ] ) write_int_matrix ( fid , FIFF . FIFF_BEM_SURF_TRIANGLES , ( surf [ 'tris' ] + 1 ) ) if ( ( 'nn' in surf ) and ( surf [ 'nn' ] is not None ) and ( len ( surf [ 'nn' ] ) > 0 ) ) : write_float_matrix ( fid , FIFF . FIFF_BEM_SURF_NORMALS , surf [ 'nn' ] ) end_block ( fid , FIFF . FIFFB_BEM_SURF )
helper to actually write bem surfaces .