changeset 6:2495f8b2aefd draft

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/overlay_images/ commit c86a1b93cb7732f7331a981d13465653cc1a2790
author imgteam
date Wed, 24 Apr 2024 08:12:55 +0000
parents 002f7bad3e82
children 8dc02c854048
files overlay_images.py overlay_images.xml
diffstat 2 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/overlay_images.py	Thu Apr 04 15:25:58 2024 +0000
+++ b/overlay_images.py	Wed Apr 24 08:12:55 2024 +0000
@@ -7,6 +7,7 @@
 
 import argparse
 
+import giatools.io
 import matplotlib.colors
 import matplotlib.pyplot as plt
 import numpy as np
@@ -18,7 +19,7 @@
 
 
 def read_im_gray(fn):
-    img = skimage.io.imread(fn)
+    img = giatools.io.imread(fn)
     nDims = len(img.shape)
     assert nDims in [2, 3], 'this tool only supports single 2D images'
     if nDims == 3 and img.shape[-1] in [3, 4]:
@@ -61,8 +62,8 @@
 
 
 def blending(im1_fn, im2_fn, out_fn, alpha=0.5):
-    im1 = skimage.io.imread(im1_fn)
-    im2 = skimage.io.imread(im2_fn)
+    im1 = giatools.io.imread(im1_fn)
+    im2 = giatools.io.imread(im2_fn)
     assert im1.shape == im2.shape, 'Two images should have the same dimension'
     out_im = (1 - alpha) * im1 + alpha * im2
     if len(im1.shape) > 3:
@@ -72,8 +73,8 @@
 
 
 def seg_contour(im1_fn, im2_fn, out_fn, linewidth, color='#ff0000', show_label=False, label_color='#ffff00'):
-    img = skimage.io.imread(im1_fn)
-    labels = skimage.io.imread(im2_fn)
+    img = giatools.io.imread(im1_fn)
+    labels = giatools.io.imread(im2_fn)
 
     result = get_rgb8_copy(img)
     cp = ContourPaint(labels, linewidth, where='center')
--- a/overlay_images.xml	Thu Apr 04 15:25:58 2024 +0000
+++ b/overlay_images.xml	Wed Apr 24 08:12:55 2024 +0000
@@ -4,7 +4,7 @@
         <import>creators.xml</import>
         <import>tests.xml</import>
         <token name="@TOOL_VERSION@">0.0.4</token>
-        <token name="@VERSION_SUFFIX@">1</token>
+        <token name="@VERSION_SUFFIX@">2</token>
     </macros>
     <creator>
         <expand macro="creators/bmcv"/>
@@ -21,6 +21,7 @@
         <requirement type="package" version="3.3.4">matplotlib</requirement>
         <requirement type="package" version="2020.10.1">tifffile</requirement>
         <requirement type="package" version="1.20.2">numpy</requirement>
+        <requirement type="package" version="0.1">giatools</requirement>
     </requirements>
     <command detect_errors="aggressive">
     <![CDATA[