20 from __future__
import print_function
22 import SimpleITK
as sitk
25 if len ( sys.argv ) < 3:
26 print(
"Usage: " +sys.argv[0]+
" <input-1> <input-2>" )
35 joined_image = join.Execute(image_1, image_2)
39 channel1_image = select.Execute(joined_image, 0, sitk.sitkUInt8)
40 channel2_image = select.Execute(joined_image, 1, sitk.sitkUInt8)
41 channel3_image = select.Execute(joined_image, 2, sitk.sitkUInt8)
45 composed_image = compose.Execute(channel1_image, channel2_image, channel3_image)
48 sliced_image = composed_image[100:400, 100:400, 0]
52 extract.SetSize([300, 300, 0])
53 extract.SetIndex([100, 100, 0])
54 extracted_image = extract.Execute(composed_image)
59 crop.SetLowerBoundaryCropSize([100, 100, 0])
60 crop.SetUpperBoundaryCropSize([composed_image.GetWidth()-400, composed_image.GetHeight()-400, 1])
61 cropped_image = crop.Execute(composed_image)