def write_int_matrix(fid, kind, mat):
 FIFFT_MATRIX = (1 << 30)
 FIFFT_MATRIX_INT = (FIFF.FIFFT_INT | FIFFT_MATRIX)
 data_size = ((4 * mat.size) + (4 * 3))
 fid.write(np.array(kind, dtype='>i4').tostring())
 fid.write(np.array(FIFFT_MATRIX_INT, dtype='>i4').tostring())
 fid.write(np.array(data_size, dtype='>i4').tostring())
 fid.write(np.array(FIFF.FIFFV_NEXT_SEQ, dtype='>i4').tostring())
 fid.write(np.array(mat, dtype='>i4').tostring())
 dims = np.empty(3, dtype=np.int32)
 dims[0] = mat.shape[1]
 dims[1] = mat.shape[0]
 dims[2] = 2
 fid.write(np.array(dims, dtype='>i4').tostring())
 check_fiff_length(fid)

def write_int_matrix ( fid , kind , mat ) : FIFFT_MATRIX = ( 1 << 30 ) FIFFT_MATRIX_INT = ( FIFF . FIFFT_INT | FIFFT_MATRIX ) data_size = ( ( 4 * mat . size ) + ( 4 * 3 ) ) fid . write ( np . array ( kind , dtype = '>i4' ) . tostring ( ) ) fid . write ( np . array ( FIFFT_MATRIX_INT , dtype = '>i4' ) . tostring ( ) ) fid . write ( np . array ( data_size , dtype = '>i4' ) . tostring ( ) ) fid . write ( np . array ( FIFF . FIFFV_NEXT_SEQ , dtype = '>i4' ) . tostring ( ) ) fid . write ( np . array ( mat , dtype = '>i4' ) . tostring ( ) ) dims = np . empty ( 3 , dtype = np . int32 ) dims [ 0 ] = mat . shape [ 1 ] dims [ 1 ] = mat . shape [ 0 ] dims [ 2 ] = 2 fid . write ( np . array ( dims , dtype = '>i4' ) . tostring ( ) ) check_fiff_length ( fid )
write integer 32 matrix tag .