Mercurial > repos > imgteam > imagej2_sharpen
annotate imagej2_base_utils.py @ 0:855fa4bb8a44 draft default tip
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
| author | imgteam | 
|---|---|
| date | Tue, 17 Sep 2019 17:03:40 -0400 | 
| parents | |
| children | 
| rev | line source | 
|---|---|
| 0 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 1 import os | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 2 import shutil | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 3 import sys | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 4 import tempfile | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 5 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 6 BUFF_SIZE = 1048576 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 7 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 8 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 9 def cleanup_before_exit(tmp_dir): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 10 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 11 Remove temporary files and directories prior to tool exit. | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 12 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 13 if tmp_dir and os.path.exists(tmp_dir): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 14 shutil.rmtree(tmp_dir) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 15 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 16 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 17 def get_base_cmd_bunwarpj(jvm_memory): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 18 if jvm_memory in [None, 'None']: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 19 jvm_memory_str = '' | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 20 else: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 21 jvm_memory_str = '-Xmx%s' % jvm_memory | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 22 # The following bunwarpj_base_cmd string will look something like this: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 23 # "java %s -cp $JAR_DIR/ij-1.49k.jar:$PLUGINS_DIR/bUnwarpJ_-2.6.1.jar \ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 24 # bunwarpj.bUnwarpJ_" % (jvm_memory_str) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 25 # See the bunwarpj.sh script for the fiji 20151222 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 26 # bioconda recipe in github. | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 27 bunwarpj_base_cmd = "bunwarpj %s" % jvm_memory_str | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 28 return bunwarpj_base_cmd | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 29 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 30 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 31 def get_base_command_imagej2(memory_size=None, macro=None, jython_script=None): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 32 imagej2_executable = get_imagej2_executable() | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 33 if imagej2_executable is None: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 34 return None | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 35 cmd = '%s --ij2 --headless --debug' % imagej2_executable | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 36 if memory_size is not None: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 37 memory_size_cmd = ' -DXms=%s -DXmx=%s' % (memory_size, memory_size) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 38 cmd += memory_size_cmd | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 39 if macro is not None: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 40 cmd += ' --macro %s' % os.path.abspath(macro) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 41 if jython_script is not None: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 42 cmd += ' --jython %s' % os.path.abspath(jython_script) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 43 return cmd | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 44 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 45 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 46 def get_file_extension(image_format): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 47 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 48 Return a valid bioformats file extension based on the received | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 49 value of image_format(e.g., "gif" is returned as ".gif". | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 50 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 51 return '.%s' % image_format | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 52 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 53 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 54 def get_file_name_without_extension(file_path): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 55 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 56 Eliminate the .ext from the received file name, assuming that | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 57 the file name consists of only a single '.'. | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 58 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 59 if os.path.exists(file_path): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 60 path, name = os.path.split(file_path) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 61 name_items = name.split('.') | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 62 return name_items[0] | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 63 return None | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 64 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 65 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 66 def get_imagej2_executable(): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 67 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 68 Fiji names the ImageJ executable different names for different | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 69 architectures, but our bioconda recipe allows us to do this. | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 70 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 71 return 'ImageJ' | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 72 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 73 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 74 def get_input_image_path(tmp_dir, input_file, image_format): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 75 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 76 Bioformats uses file extensions (e.g., .job, .gif, etc) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 77 when reading and writing image files, so the Galaxy dataset | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 78 naming convention of setting all file extensions as .dat | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 79 must be handled. | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 80 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 81 image_path = get_temporary_image_path(tmp_dir, image_format) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 82 # Remove the file so we can create a symlink. | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 83 os.remove(image_path) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 84 os.symlink(input_file, image_path) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 85 return image_path | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 86 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 87 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 88 def get_platform_info_dict(): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 89 '''Return a dict with information about the current platform.''' | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 90 platform_dict = {} | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 91 sysname, nodename, release, version, machine = os.uname() | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 92 platform_dict['os'] = sysname.lower() | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 93 platform_dict['architecture'] = machine.lower() | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 94 return platform_dict | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 95 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 96 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 97 def get_stderr_exception(tmp_err, tmp_stderr, tmp_out, tmp_stdout, include_stdout=False): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 98 tmp_stderr.close() | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 99 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 100 Return a stderr string of reasonable size. | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 101 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 102 # Get stderr, allowing for case where it's very large. | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 103 tmp_stderr = open(tmp_err, 'rb') | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 104 stderr_str = '' | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 105 buffsize = BUFF_SIZE | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 106 try: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 107 while True: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 108 stderr_str += tmp_stderr.read(buffsize) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 109 if not stderr_str or len(stderr_str) % buffsize != 0: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 110 break | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 111 except OverflowError: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 112 pass | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 113 tmp_stderr.close() | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 114 if include_stdout: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 115 tmp_stdout = open(tmp_out, 'rb') | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 116 stdout_str = '' | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 117 buffsize = BUFF_SIZE | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 118 try: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 119 while True: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 120 stdout_str += tmp_stdout.read(buffsize) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 121 if not stdout_str or len(stdout_str) % buffsize != 0: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 122 break | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 123 except OverflowError: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 124 pass | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 125 tmp_stdout.close() | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 126 if include_stdout: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 127 return 'STDOUT\n%s\n\nSTDERR\n%s\n' % (stdout_str, stderr_str) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 128 return stderr_str | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 129 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 130 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 131 def get_temp_dir(prefix='tmp-imagej-', dir=None): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 132 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 133 Return a temporary directory. | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 134 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 135 return tempfile.mkdtemp(prefix=prefix, dir=dir) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 136 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 137 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 138 def get_tempfilename(dir=None, suffix=None): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 139 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 140 Return a temporary file name. | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 141 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 142 fd, name = tempfile.mkstemp(suffix=suffix, dir=dir) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 143 os.close(fd) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 144 return name | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 145 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 146 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 147 def get_temporary_image_path(tmp_dir, image_format): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 148 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 149 Return the path to a temporary file with a valid image format | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 150 file extension that can be used with bioformats. | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 151 """ | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 152 file_extension = get_file_extension(image_format) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 153 return get_tempfilename(tmp_dir, file_extension) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 154 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 155 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 156 def handle_none_type(val, val_type='float'): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 157 if val is None: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 158 return ' None' | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 159 else: | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 160 if val_type == 'float': | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 161 return ' %.3f' % val | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 162 elif val_type == 'int': | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 163 return ' %d' % val | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 164 return ' %s' % val | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 165 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 166 | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 167 def stop_err(msg): | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 168 sys.stderr.write(msg) | 
| 
855fa4bb8a44
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 169 sys.exit(1) | 
