Mercurial > repos > imgteam > colocalization_viz
comparison colocalization_viz.py @ 0:9ddb11b272ee draft
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/colocalization_viz/ commit c3f4b766f03770f094fda6bda0a5882c0ebd4581
| author | imgteam |
|---|---|
| date | Sat, 09 Feb 2019 14:32:01 -0500 |
| parents | |
| children | fc85eb253163 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:9ddb11b272ee |
|---|---|
| 1 import skimage.io | |
| 2 import skimage.color | |
| 3 import numpy as np | |
| 4 import os | |
| 5 import sys | |
| 6 import warnings | |
| 7 | |
| 8 #TODO make importable by python script | |
| 9 | |
| 10 args = sys.argv | |
| 11 | |
| 12 def readImg(path): | |
| 13 img = skimage.io.imread(path) | |
| 14 if len(img.shape) > 2: | |
| 15 img = skimage.color.rgb2gray(img) | |
| 16 img = np.expand_dims(img > 0, 3) | |
| 17 return img | |
| 18 | |
| 19 im1 = readImg(args[1]) | |
| 20 im2 = readImg(args[2]) | |
| 21 res = np.concatenate((im1, im2, np.zeros_like(im1)), axis=2) * 1.0 | |
| 22 | |
| 23 with warnings.catch_warnings(): | |
| 24 warnings.simplefilter("ignore") | |
| 25 skimage.io.imsave(args[3], res) |
