def combine_hemi(left, right):
 lh_data = nb.load(left).get_data()
 rh_data = nb.load(right).get_data()
 indices = np.vstack(((1000000 + np.arange(0, lh_data.shape[0])[:, None]), (2000000 + np.arange(0, rh_data.shape[0])[:, None])))
 all_data = np.hstack((indices, np.vstack((lh_data.squeeze(), rh_data.squeeze()))))
 filename = (left.split(u'.')[1] + u'_combined.txt')
 np.savetxt(filename, all_data, fmt=u','.join(([u'%d'] + ([u'%.10f'] * (all_data.shape[1] - 1)))))
 return os.path.abspath(filename)

def combine_hemi ( left , right ) : lh_data = nb . load ( left ) . get_data ( ) rh_data = nb . load ( right ) . get_data ( ) indices = np . vstack ( ( ( 1000000 + np . arange ( 0 , lh_data . shape [ 0 ] ) [ : , None ] ) , ( 2000000 + np . arange ( 0 , rh_data . shape [ 0 ] ) [ : , None ] ) ) ) all_data = np . hstack ( ( indices , np . vstack ( ( lh_data . squeeze ( ) , rh_data . squeeze ( ) ) ) ) ) filename = ( left . split ( u'.' ) [ 1 ] + u'_combined.txt' ) np . savetxt ( filename , all_data , fmt = u',' . join ( ( [ u'%d' ] + ( [ u'%.10f' ] * ( all_data . shape [ 1 ] - 1 ) ) ) ) ) return os . path . abspath ( filename )
combine left and right hemisphere time series into a single text file .