comparison imagej2_enhance_contrast_jython_script.py @ 2:7121957d0bbf draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
author imgteam
date Sun, 05 Nov 2023 10:59:40 +0000
parents 423400b3c47f
children e781a17b3c14
comparison
equal deleted inserted replaced
1:423400b3c47f 2:7121957d0bbf
22 22
23 # Set the options 23 # Set the options
24 options = [] 24 options = []
25 # If equalize_histogram, saturated_pixels and normalize are ignored. 25 # If equalize_histogram, saturated_pixels and normalize are ignored.
26 if equalize_histogram: 26 if equalize_histogram:
27 options.append('equalize') 27 options.append("equalize")
28 else: 28 else:
29 if saturated_pixels not in [None, 'None']: 29 if saturated_pixels not in [None, "None"]:
30 # Fiji allows only a single decimal place for this value. 30 # Fiji allows only a single decimal place for this value.
31 options.append('saturated=%.3f' % float(saturated_pixels)) 31 options.append("saturated=%.3f" % float(saturated_pixels))
32 # Normalization of RGB images is not supported. 32 # Normalization of RGB images is not supported.
33 if bit_depth != 24 and normalize: 33 if bit_depth != 24 and normalize:
34 options.append('normalize') 34 options.append("normalize")
35 # Run the command. 35 # Run the command.
36 options = "%s" % ' '.join(options) 36 options = "%s" % " ".join(options)
37 IJ.run(input_image_plus_copy, "Enhance Contrast...", options) 37 IJ.run(input_image_plus_copy, "Enhance Contrast...", options)
38 # Save the ImagePlus object as a new image. 38 # Save the ImagePlus object as a new image.
39 IJ.saveAs(input_image_plus_copy, output_datatype, tmp_output_path) 39 IJ.saveAs(input_image_plus_copy, output_datatype, tmp_output_path)