#NEWLINE# def compute( self ) : #NEWLINE# #INDENT# im = self . get_input ( 'Image' ) #NEWLINE# if self . has_input ( 'Input PixelType' ) : #NEWLINE# #INDENT# inPixelType = self . get_input ( 'Input PixelType' ) . _type #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# inPixelType = im . getPixelType ( ) #NEWLINE# #UNINDENT# if self . has_input ( 'Dimension' ) : #NEWLINE# #INDENT# dim = self . get_input ( 'Dimension' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dim = im . getDim ( ) #NEWLINE# #UNINDENT# suf = self . get_input ( 'Suffix' ) #NEWLINE# f = self . createOutputFile ( suf ) #NEWLINE# writeType = itk . Image [ ( inPixelType . _type , dim ) ] #NEWLINE# writer = itk . ImageFileWriter [ writeType ] . New ( im . getImg ( ) , FileName = f . name ) #NEWLINE# writer . Update ( ) #NEWLINE# self . set_output ( 'File' , f )