Mercurial > repos > imgteam > imagej2_bunwarpj_compose_elastic
comparison imagej2_find_maxima_jython_script.py @ 3:e781a17b3c14 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:00:54 +0000 | 
| parents | 7121957d0bbf | 
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| 2:7121957d0bbf | 3:e781a17b3c14 | 
|---|---|
| 4 from ij.plugin.filter import Analyzer, MaximumFinder | 4 from ij.plugin.filter import Analyzer, MaximumFinder | 
| 5 from ij.process import ImageProcessor | 5 from ij.process import ImageProcessor | 
| 6 | 6 | 
| 7 # Fiji Jython interpreter implements Python 2.5 which does not | 7 # Fiji Jython interpreter implements Python 2.5 which does not | 
| 8 # provide support for argparse. | 8 # provide support for argparse. | 
| 9 error_log = sys.argv[-10] | |
| 10 input_file = sys.argv[-9] | 9 input_file = sys.argv[-9] | 
| 11 scale_when_converting = sys.argv[-8] == "yes" | 10 scale_when_converting = sys.argv[-8] == "yes" | 
| 12 weighted_rgb_conversions = sys.argv[-7] == "yes" | 11 weighted_rgb_conversions = sys.argv[-7] == "yes" | 
| 13 noise_tolerance = int(sys.argv[-6]) | 12 noise_tolerance = int(sys.argv[-6]) | 
| 14 output_type = sys.argv[-5] | 13 output_type = sys.argv[-5] | 
| 33 if scale_when_converting: | 32 if scale_when_converting: | 
| 34 options.append("scale") | 33 options.append("scale") | 
| 35 if weighted_rgb_conversions: | 34 if weighted_rgb_conversions: | 
| 36 options.append("weighted") | 35 options.append("weighted") | 
| 37 # Perform conversion - must happen even if no options are set. | 36 # Perform conversion - must happen even if no options are set. | 
| 38 IJ.run(input_image_plus_copy, "Conversions...", "%s" % " ".join(options)) | 37 IJ.run(input_image_plus_copy, "Conversions...", " %s" % " ".join(options)) | 
| 39 if output_type in ["List", "Count"]: | 38 if output_type in ["List", "Count"]: | 
| 40 # W're generating a tabular file for the output. | 39 # W're generating a tabular file for the output. | 
| 41 # Set the Find Maxima options. | 40 # Set the Find Maxima options. | 
| 42 options = ["noise=%d" % noise_tolerance] | 41 options = ["noise=%d" % noise_tolerance] | 
| 43 if output_type.find("_") > 0: | 42 if output_type.find("_") > 0: | 
