#NEWLINE# def compute( self ) : #NEWLINE# #INDENT# dir = self . get_input ( 'Directory' ) #NEWLINE# dim = self . get_input ( 'Dimension' ) #NEWLINE# self . dicomNames_ = itk . GDCMSeriesFileNames . New ( ) #NEWLINE# self . dicomNames_ . SetDirectory ( dir ) #NEWLINE# self . dicomNames_ . SetUseSeriesDetails ( True ) #NEWLINE# self . dicomNames_ . SetRecursive ( True ) #NEWLINE# self . dicomNames_ . LoadSequencesOn ( ) #NEWLINE# self . iType_ = itk . Image [ ( itk . US , dim ) ] #NEWLINE# self . reader_ = itk . ImageSeriesReader [ self . iType_ ] . New ( ) #NEWLINE# self . reader_ . SetFileNames ( self . dicomNames_ . GetInputFileNames ( ) ) #NEWLINE# self . io_ = itk . GDCMImageIO . New ( ) #NEWLINE# self . reader_ . SetImageIO ( self . io_ . GetPointer ( ) ) #NEWLINE# self . reader_ . Update ( ) #NEWLINE# outIm = Image ( ) #NEWLINE# outIm . setImg ( self . reader_ . GetOutput ( ) ) #NEWLINE# outIm . setPixelType ( itk . US ) #NEWLINE# outIm . setDim ( dim ) #NEWLINE# self . set_output ( 'Image Series' , outIm )