25 parser = argparse.ArgumentParser(description=
"Extract an isosurface.")
26 parser.add_argument(
"input_image")
27 parser.add_argument(
"output_mesh")
28 parser.add_argument(
"lower_threshold", type=int)
29 parser.add_argument(
"upper_threshold", type=int)
30 args = parser.parse_args()
32 input_image = itk.imread(args.input_image)
34 thresholded = itk.binary_threshold_image_filter(
36 lower_threshold=args.lower_threshold,
37 upper_threshold=args.upper_threshold,
42 output_mesh = itk.binary_mask3_d_mesh_source(thresholded, object_value=255)
44 itk.meshwrite(output_mesh, args.output_mesh)