comparison imagej2_watershed_binary_jython_script.py @ 3:f72f8e6787cd draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
author imgteam
date Wed, 25 Sep 2024 16:01:42 +0000
parents 55bf135d6b0c
children
comparison
equal deleted inserted replaced
2:55bf135d6b0c 3:f72f8e6787cd
2 2
3 from ij import IJ 3 from ij import IJ
4 4
5 # Fiji Jython interpreter implements Python 2.5 which does not 5 # Fiji Jython interpreter implements Python 2.5 which does not
6 # provide support for argparse. 6 # provide support for argparse.
7 error_log = sys.argv[-5]
8 input = sys.argv[-4] 7 input = sys.argv[-4]
9 black_background = sys.argv[-3] == "yes" 8 black_background = sys.argv[-3] == "yes"
10 tmp_output_path = sys.argv[-2] 9 tmp_output_path = sys.argv[-2]
11 output_datatype = sys.argv[-1] 10 output_datatype = sys.argv[-1]
12 11
28 if not image_processor_copy.isBinary(): 27 if not image_processor_copy.isBinary():
29 # Convert the image to binary grayscale. 28 # Convert the image to binary grayscale.
30 IJ.run(input_image_plus_copy, "Make Binary", "") 29 IJ.run(input_image_plus_copy, "Make Binary", "")
31 30
32 # Run the command. 31 # Run the command.
33 IJ.run(input_image_plus_copy, "Watershed", "") 32 IJ.run(input_image_plus_copy, "Watershed", "stack")
34 33
35 # Save the ImagePlus object as a new image. 34 # Save the ImagePlus object as a new image.
36 IJ.saveAs(input_image_plus_copy, output_datatype, tmp_output_path) 35 IJ.saveAs(input_image_plus_copy, output_datatype, tmp_output_path)