#NEWLINE# def compute( self , data ) : #NEWLINE# #INDENT# '\n        arguments: data is a 3D numpy.ndarray\n        result: numpy ndarray of shape: (data.shape + (numOutputChannels,))\n\n        you plugin must reimplement this function, or the compute2d and compute3d functions.\n        ' #NEWLINE# if ( data . shape [ 0 ] > 1 ) : #NEWLINE# #INDENT# res = self . compute3d ( data ) #NEWLINE# if ( len ( res . shape ) == 3 ) : #NEWLINE# #INDENT# return res . reshape ( ( res . shape + ( 1 , ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return res #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# res = self . compute2d ( data [ 0 , : ] ) #NEWLINE# if ( len ( res . shape ) == 2 ) : #NEWLINE# #INDENT# res . shape = ( ( ( 1 , ) + res . shape ) + ( 1 , ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# res . shape = ( ( 1 , ) + res . shape ) #NEWLINE# #UNINDENT# return res