changeset 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
files colocalization_viz.py colocalization_viz.xml test-data/out.png test-data/sample1.tiff test-data/sample2.tiff
diffstat 5 files changed, 59 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/colocalization_viz.py	Sat Feb 09 14:32:01 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)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/colocalization_viz.xml	Sat Feb 09 14:32:01 2019 -0500
@@ -0,0 +1,34 @@
+<tool id="ip_colocalization" name="Colocalization" version="0.0.6">
+    <description>of two segmentation maps</description>
+    <requirements>
+        <requirement type="package" version="0.14.2">scikit-image</requirement>
+        <requirement type="package" version="1.15.4">numpy</requirement>
+    </requirements>
+    <command detect_errors="aggressive">
+    <![CDATA[
+        python '$__tool_directory__/colocalization_viz.py' '$input_mask1' '$input_mask2' ./out.png
+    ]]>
+    </command>
+    <inputs>
+        <param name="input_mask1" type="data" format="tiff" label="Mask1 Source File" />
+        <param name="input_mask2" type="data" format="tiff" label="Mask2 Source File" />
+    </inputs>
+    <outputs>
+        <data format="png" name="output" from_work_dir="out.png"/>
+    </outputs>
+    <tests>
+        <test>
+            <param name="input_mask1" value="sample1.tiff"/>
+            <param name="input_mask2" value="sample2.tiff"/>
+            <output name="output" value="out.png" ftype="png" compare="sim_size"/>
+        </test>
+    </tests>
+    <help>
+    **What it does**
+
+    This tool overlays two segmentation maps and displays the colocalization results.
+    </help>
+    <citations>
+        <citation type="doi">10.1016/j.jbiotec.2017.07.019</citation>
+    </citations>
+</tool>
Binary file test-data/out.png has changed
Binary file test-data/sample1.tiff has changed
Binary file test-data/sample2.tiff has changed