#NEWLINE# def read_root( self , fid ) : #NEWLINE# #INDENT# 'Read the root node from an acclaim skeleton file stream.' #NEWLINE# lin = self . read_line ( fid ) #NEWLINE# while ( lin [ 0 ] != ':' ) : #NEWLINE# #INDENT# parts = lin . split ( ) #NEWLINE# if ( parts [ 0 ] == 'order' ) : #NEWLINE# #INDENT# order = [ ] #NEWLINE# for i in range ( 1 , len ( parts ) ) : #NEWLINE# #INDENT# if ( parts [ i ] . lower ( ) == 'rx' ) : #NEWLINE# #INDENT# chan = 'Xrotation' #NEWLINE# order . append ( 'x' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( parts [ i ] . lower ( ) == 'ry' ) : #NEWLINE# #INDENT# chan = 'Yrotation' #NEWLINE# order . append ( 'y' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( parts [ i ] . lower ( ) == 'rz' ) : #NEWLINE# #INDENT# chan = 'Zrotation' #NEWLINE# order . append ( 'z' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( parts [ i ] . lower ( ) == 'tx' ) : #NEWLINE# #INDENT# chan = 'Xposition' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( parts [ i ] . lower ( ) == 'ty' ) : #NEWLINE# #INDENT# chan = 'Yposition' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( parts [ i ] . lower ( ) == 'tz' ) : #NEWLINE# #INDENT# chan = 'Zposition' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( parts [ i ] . lower ( ) == 'l' ) : #NEWLINE# #INDENT# chan = 'length' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# self . vertices [ 0 ] . meta [ 'channels' ] . append ( chan ) #NEWLINE# #UNINDENT# self . vertices [ 0 ] . meta [ 'order' ] = order [ : : ( - 1 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( parts [ 0 ] == 'axis' ) : #NEWLINE# #INDENT# self . vertices [ 0 ] . meta [ 'axis_order' ] = parts [ 1 ] [ : : ( - 1 ) ] . lower ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( parts [ 0 ] == 'position' ) : #NEWLINE# #INDENT# self . vertices [ 0 ] . meta [ 'offset' ] = [ float ( parts [ 1 ] ) , float ( parts [ 2 ] ) , float ( parts [ 3 ] ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( parts [ 0 ] == 'orientation' ) : #NEWLINE# #INDENT# self . vertices [ 0 ] . meta [ 'orientation' ] = [ float ( parts [ 1 ] ) , float ( parts [ 2 ] ) , float ( order [ 3 ] ) ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# lin = self . read_line ( fid ) #NEWLINE# #UNINDENT# return lin