20 from __future__
import print_function
23 import SimpleITK
as sitk
27 if ( len( sys.argv ) != 5 ):
28 sys.stderr.write(
"Usage: prog inputFile outputFile replaceValue upperThreshold\n" )
32 inputFileName = sys.argv[1]
33 outputFileName = sys.argv[2]
34 replaceValue = int( sys.argv[3] )
35 upperThreshold = float( sys.argv[4] )
50 boundary =
sitk.Cast( boundary, image.GetPixelID() )
55 image = image * ~boundary
58 image = image + ( boundary * replaceValue )
61 if (
not "SITK_NOSHOW" in os.environ ):
62 sitk.Show( image,
"Boarder Segmentation" )