diff colocalization_viz.py @ 0:4e9bafbcf296 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:30:08 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/colocalization_viz.py	Wed Jan 16 15:30:08 2019 -0500
@@ -0,0 +1,25 @@
+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)