Mercurial > repos > imgteam > imagej2_bunwarpj_compare_elastic
annotate imagej2_create_image_jython_script.py @ 3:f9f2d9746a01 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:12:07 +0000 | 
| parents | 42ba21dc9ea6 | 
| children | 
| rev | line source | 
|---|---|
| 0 
b95f87118c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 1 import sys | 
| 1 
125641435c4b
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 2afb24f3c81d625312186750a714d702363012b5"
 imgteam parents: 
0diff
changeset | 2 | 
| 0 
b95f87118c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 3 from ij import IJ | 
| 
b95f87118c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 4 | 
| 
b95f87118c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 5 # Fiji Jython interpreter implements Python 2.5 which does not | 
| 
b95f87118c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 6 # provide support for argparse. | 
| 1 
125641435c4b
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 2afb24f3c81d625312186750a714d702363012b5"
 imgteam parents: 
0diff
changeset | 7 title = sys.argv[-6] | 
| 
125641435c4b
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 2afb24f3c81d625312186750a714d702363012b5"
 imgteam parents: 
0diff
changeset | 8 width = int(sys.argv[-5]) | 
| 
125641435c4b
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 2afb24f3c81d625312186750a714d702363012b5"
 imgteam parents: 
0diff
changeset | 9 height = int(sys.argv[-4]) | 
| 
125641435c4b
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 2afb24f3c81d625312186750a714d702363012b5"
 imgteam parents: 
0diff
changeset | 10 depth = int(sys.argv[-3]) | 
| 2 
42ba21dc9ea6
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 57a0433defa3cbc37ab34fbb0ebcfaeb680db8d5
 imgteam parents: 
1diff
changeset | 11 type = sys.argv[-2].replace("_", " ") | 
| 1 
125641435c4b
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 2afb24f3c81d625312186750a714d702363012b5"
 imgteam parents: 
0diff
changeset | 12 tmp_image_path = sys.argv[-1] | 
| 0 
b95f87118c6f
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit b08f0e6d1546caaf627b21f8c94044285d5d5b9c-dirty"
 imgteam parents: diff
changeset | 13 | 
| 1 
125641435c4b
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 2afb24f3c81d625312186750a714d702363012b5"
 imgteam parents: 
0diff
changeset | 14 imp = IJ.newImage(title, type, width, height, depth) | 
| 
125641435c4b
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 2afb24f3c81d625312186750a714d702363012b5"
 imgteam parents: 
0diff
changeset | 15 IJ.save(imp, "%s" % tmp_image_path) | 
