Repository 'scale_image'
hg clone https://toolshed.g2.bx.psu.edu/repos/imgteam/scale_image

Changeset 2:f3c05a734dd1 (2019-07-22)
Previous changeset 1:3e4231ed875e (2019-03-28) Next changeset 3:d09507d3fb0e (2023-11-10)
Commit message:
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/scale_image/ commit b2acc1845a25828181597fe5b6982fe116a7796d
modified:
scale_image.py
scale_image.xml
b
diff -r 3e4231ed875e -r f3c05a734dd1 scale_image.py
--- a/scale_image.py Thu Mar 28 13:02:18 2019 -0400
+++ b/scale_image.py Mon Jul 22 05:04:55 2019 -0400
[
@@ -3,33 +3,27 @@
 import skimage.io
 import skimage.transform
 import scipy.misc
-import warnings
-import os
 from PIL import Image
 
-

 def scale_image(input_file, output_file, scale, order=1):
-    with warnings.catch_warnings():
-        warnings.simplefilter("ignore")
-        Image.MAX_IMAGE_PIXELS = 50000*50000
-        img_in = skimage.io.imread(input_file)
-        if order == 0:
-            interp = 'nearest'
-        elif order == 1:
-            interp = 'bilinear'
-        elif order == 2:
-            interp = 'bicubic'
-
-        if ',' in scale:
-            scale = scale[1:-1].split(',')
-            scale = [int(i) for i in scale]
-        elif '.' in scale:
-            scale = float(scale)
-        else:
-            scale = int(scale)
-
-        res = scipy.misc.imresize(img_in, scale, interp=interp)
-        skimage.io.imsave(output_file, res)
+    Image.MAX_IMAGE_PIXELS = 50000*50000
+    img_in = skimage.io.imread(input_file)
+    if order == 0:
+        interp = 'nearest'
+    elif order == 1:
+        interp = 'bilinear'
+    elif order == 2:
+        interp = 'bicubic'
+    if ',' in scale:
+        scale = scale[1:-1].split(',')
+        scale = [int(i) for i in scale]
+    elif '.' in scale:
+        scale = float(scale)
+    else:
+        scale = int(scale)
+    res = scipy.misc.imresize(img_in, scale, interp=interp)
+    skimage.io.imsave(output_file, res)
 
 
 if __name__ == "__main__":
b
diff -r 3e4231ed875e -r f3c05a734dd1 scale_image.xml
--- a/scale_image.xml Thu Mar 28 13:02:18 2019 -0400
+++ b/scale_image.xml Mon Jul 22 05:04:55 2019 -0400
[
@@ -1,10 +1,13 @@
-<tool id="ip_scale_image" name="Scale Image" version="0.3">
+<tool id="ip_scale_image" name="Scale Image" version="0.4"> 
     <description>Scales image</description>
     <requirements>
+        <requirement type="package" version="6.1.0">pillow</requirement>
         <requirement type="package" version="0.14.2">scikit-image</requirement>
         <requirement type="package" version="1.15.4">numpy</requirement>
-    </requirements>
-    <command>
+        <requirement type="package" version="1.1.0">scipy</requirement>
+        <requirement type="package" version="0.15.1">tifffile</requirement>
+    </requirements> 
+    <command detect_errors="aggressive">
         <![CDATA[
         python '$__tool_directory__/scale_image.py' '$input' ./out.png
         #if $use_scale_option.use_scale == 'true'