#NEWLINE# def xyImage( self ) : #NEWLINE# #INDENT# 'Create xy slice' #NEWLINE# ( zdim , ydim , xdim ) = self . data . shape [ 1 : ] #NEWLINE# if ( self . data . dtype == np . uint8 ) : #NEWLINE# #INDENT# return Image . frombuffer ( 'L' , ( xdim , ydim ) , self . data [ 0 , 0 , : , : ] . flatten ( ) , 'raw' , 'L' , 0 , 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# outimage = Image . frombuffer ( 'I;16' , ( xdim , ydim ) , self . data [ 0 , 0 , : , : ] . flatten ( ) , 'raw' , 'I;16' , 0 , 1 ) #NEWLINE# return outimage . point ( ( lambda i : ( i * ( 1.0 / 256 ) ) ) ) . convert ( 'L' )