#NEWLINE# def compute( self ) : #NEWLINE# #INDENT# im = self . get_input ( 'Input Image' ) #NEWLINE# if self . has_input ( 'Input PixelType' ) : #NEWLINE# #INDENT# inPixelType = self . get_input ( 'Input PixelType' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# inPixelType = im . getPixelType ( ) #NEWLINE# #UNINDENT# if self . has_input ( 'Output PixelType' ) : #NEWLINE# #INDENT# outPixelType = self . get_input ( 'Output PixelType' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# outPixelType = inPixelType #NEWLINE# #UNINDENT# if self . has_input ( 'Dimension' ) : #NEWLINE# #INDENT# dim = self . get_input ( 'Dimension' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dim = im . getDim ( ) #NEWLINE# #UNINDENT# inImgType = itk . Image [ ( inPixelType . _type , dim ) ] #NEWLINE# outImgType = itk . Image [ ( outPixelType . _type , dim ) ] #NEWLINE# self . filter_ = itk . NormalizeImageFilter [ ( inImgType , outImgType ) ] . New ( im . getImg ( ) ) #NEWLINE# self . filter_ . Update ( ) #NEWLINE# outIm = Image ( ) #NEWLINE# outIm . setImg ( self . filter_ . GetOutput ( ) ) #NEWLINE# outIm . setPixelType ( outPixelType ) #NEWLINE# outIm . setDim ( dim ) #NEWLINE# self . set_output ( 'Output Image' , outIm ) #NEWLINE# self . set_output ( 'Filter' , self ) #NEWLINE# self . set_output ( 'Output PixelType' , outPixelType )