Mercurial > repos > thomaswollmann > colocalization_viz
comparison colocalization_viz.py @ 0:9174e8eaa1e1 draft default tip
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/colocalization_viz/ commit d93e1dd276027cfc3fb518236110395a23d96f66
| author | thomaswollmann |
|---|---|
| date | Wed, 16 Jan 2019 15:33:42 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:9174e8eaa1e1 |
|---|---|
| 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) |
