20 from __future__
import print_function
22 import SimpleITK
as sitk
26 if len ( sys.argv ) != 4:
27 print(
"Usage: %s inputImage sliceNumber outputImage" % ( sys.argv[0] ) )
30 zslice = int( sys.argv[2] )
34 size = list( inputImage.GetSize() )
37 index = [ 0, 0, zslice ]
40 Extractor.SetSize( size )
41 Extractor.SetIndex( index )
46 if (
not "SITK_NOSHOW" in os.environ ):
47 sitk.Show( Extractor.Execute( inputImage ) )