view 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
line wrap: on
line source

import skimage.io
import skimage.color
import numpy as np
import os
import sys
import warnings

#TODO make importable by python script

args = sys.argv

def readImg(path):
	img = skimage.io.imread(path)
	if len(img.shape) > 2:
		img = skimage.color.rgb2gray(img)
	img = np.expand_dims(img > 0, 3)
	return img

im1 = readImg(args[1])
im2 = readImg(args[2])
res = np.concatenate((im1, im2, np.zeros_like(im1)), axis=2) * 1.0

with warnings.catch_warnings():
	warnings.simplefilter("ignore")
	skimage.io.imsave(args[3], res)