#NEWLINE# def getCurrentDistanceMap( self ) : #NEWLINE# #INDENT# ' Calculate the distance map to the centroid for the current labelmap volume.\n        To that end, we have to calculate first the centroid.\n        Please note the results could be cached\n        :return:\n        ' #NEWLINE# if ( self . currentDistanceMap is None ) : #NEWLINE# #INDENT# centroid = Util . centroid ( self . currentLabelmapArray ) #NEWLINE# dims = Util . vtk_numpy_coordinate ( self . currentVolume . GetImageData ( ) . GetDimensions ( ) ) #NEWLINE# input = np . ones ( dims , np . int32 ) #NEWLINE# sitkImage = sitk . GetImageFromArray ( input ) #NEWLINE# sitkImage . SetSpacing ( self . currentVolume . GetSpacing ( ) ) #NEWLINE# fastMarchingFilter = sitk . FastMarchingImageFilter ( ) #NEWLINE# fastMarchingFilter . SetStoppingValue ( self . MAX_TUMOR_RADIUS ) #NEWLINE# seeds = [ Util . numpy_itk_coordinate ( centroid ) ] #NEWLINE# fastMarchingFilter . SetTrialPoints ( seeds ) #NEWLINE# output = fastMarchingFilter . Execute ( sitkImage ) #NEWLINE# self . currentDistanceMap = sitk . GetArrayFromImage ( output )