Mercurial > repos > imgteam > imagej2_bunwarpj_adapt_transform
comparison imagej2_skeletonize3d_jython_script.py @ 2:fa64e8aed5a5 draft default tip
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
author | imgteam |
---|---|
date | Sun, 05 Nov 2023 14:24:23 +0000 |
parents | 5d633d30316e |
children |
comparison
equal
deleted
inserted
replaced
1:5d633d30316e | 2:fa64e8aed5a5 |
---|---|
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] | 7 error_log = sys.argv[-5] |
8 input_file = sys.argv[-4] | 8 input_file = sys.argv[-4] |
9 black_background = sys.argv[-3] == 'yes' | 9 black_background = sys.argv[-3] == "yes" |
10 tmp_output_path = sys.argv[-2] | 10 tmp_output_path = sys.argv[-2] |
11 output_datatype = sys.argv[-1] | 11 output_datatype = sys.argv[-1] |
12 | 12 |
13 # Open the input image file. | 13 # Open the input image file. |
14 input_image_plus = IJ.openImage(input_file) | 14 input_image_plus = IJ.openImage(input_file) |
16 # Create a copy of the image. | 16 # Create a copy of the image. |
17 input_image_plus_copy = input_image_plus.duplicate() | 17 input_image_plus_copy = input_image_plus.duplicate() |
18 image_processor_copy = input_image_plus_copy.getProcessor() | 18 image_processor_copy = input_image_plus_copy.getProcessor() |
19 | 19 |
20 # Set binary options. | 20 # Set binary options. |
21 options = ['edm=Overwrite', 'iterations=1', 'count=1'] | 21 options = ["edm=Overwrite", "iterations=1", "count=1"] |
22 if (black_background): | 22 if black_background: |
23 options.append('black') | 23 options.append("black") |
24 options = " ".join(options) | 24 options = " ".join(options) |
25 IJ.run(input_image_plus_copy, "Options...", options) | 25 IJ.run(input_image_plus_copy, "Options...", options) |
26 | 26 |
27 # Convert image to binary if necessary. | 27 # Convert image to binary if necessary. |
28 if not image_processor_copy.isBinary(): | 28 if not image_processor_copy.isBinary(): |