Mercurial > repos > bgruening > imagej2_crop
annotate imagej2_create_image_jython_script.py @ 0:018144807556 draft default tip
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
author | bgruening |
---|---|
date | Tue, 24 Sep 2024 17:12:52 +0000 |
parents | |
children |
rev | line source |
---|---|
0
018144807556
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
bgruening
parents:
diff
changeset
|
1 import sys |
018144807556
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
bgruening
parents:
diff
changeset
|
2 |
018144807556
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
bgruening
parents:
diff
changeset
|
3 from ij import IJ |
018144807556
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
bgruening
parents:
diff
changeset
|
4 |
018144807556
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
bgruening
parents:
diff
changeset
|
5 # Fiji Jython interpreter implements Python 2.5 which does not |
018144807556
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
bgruening
parents:
diff
changeset
|
6 # provide support for argparse. |
018144807556
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
bgruening
parents:
diff
changeset
|
7 title = sys.argv[-6] |
018144807556
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
bgruening
parents:
diff
changeset
|
8 width = int(sys.argv[-5]) |
018144807556
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
bgruening
parents:
diff
changeset
|
9 height = int(sys.argv[-4]) |
018144807556
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
bgruening
parents:
diff
changeset
|
10 depth = int(sys.argv[-3]) |
018144807556
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
bgruening
parents:
diff
changeset
|
11 type = sys.argv[-2].replace("_", " ") |
018144807556
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
bgruening
parents:
diff
changeset
|
12 tmp_image_path = sys.argv[-1] |
018144807556
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
bgruening
parents:
diff
changeset
|
13 |
018144807556
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
bgruening
parents:
diff
changeset
|
14 imp = IJ.newImage(title, type, width, height, depth) |
018144807556
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/image_processing/imagej2 commit 8f49f3c66b5a1de99ec15e65c2519a56792f1d56
bgruening
parents:
diff
changeset
|
15 IJ.save(imp, "%s" % tmp_image_path) |