changeset 2:f70b215d155c draft

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tree/master/tools/2d_simple_filter/ commit 56e3f647d08d5e6c973d5e6cd89bb677db6473ab
author imgteam
date Fri, 10 Nov 2023 13:44:57 +0000
parents dba87c4b32d3
children 6c4b22ef2b81
files filter.xml filter_image.py
diffstat 2 files changed, 20 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/filter.xml	Thu Jul 18 08:51:58 2019 -0400
+++ b/filter.xml	Fri Nov 10 13:44:57 2023 +0000
@@ -1,5 +1,12 @@
-<tool id="ip_filter_standard" name="Filter Image" version="0.0.3">
-    <description>applies a standard filter to an image</description>
+<tool id="ip_filter_standard" name="Filter 2D image" version="0.0.3-3">
+    <description>with scikit-image</description>
+    <edam_operations>
+        <edam_operation>operation_3443</edam_operation>
+    </edam_operations>
+    <xrefs>
+        <xref type="bio.tools">scikit-image</xref>
+        <xref type="biii">scikit-image</xref>
+    </xrefs>
     <requirements>
         <requirement type="package" version="0.14.2">scikit-image</requirement>
         <requirement type="package" version="1.15.4">numpy</requirement>
@@ -12,7 +19,7 @@
       ]]>
     </command>
     <inputs>
-        <param name="filter_type" type="select" label="Image type">
+        <param name="filter_type" type="select" label="Filter type">
           <option value="median" selected="True">Median</option>
           <option value="gaussian">Gaussian Blur</option>
           <option value="prewitt">Prewitt</option>
@@ -24,7 +31,7 @@
     </inputs>
     <outputs>
        <data format="tiff" name="output" />
-    </outputs>
+    </outputs> 
     <tests>
       <test>
         <param name="input" value="sample.tif" />
--- a/filter_image.py	Thu Jul 18 08:51:58 2019 -0400
+++ b/filter_image.py	Fri Nov 10 13:44:57 2023 +0000
@@ -1,19 +1,19 @@
 import argparse
 import sys
-import warnings
-import numpy as np
-import skimage.io
+
 import skimage.filters
+import skimage.io
 import skimage.util
+from skimage import img_as_uint
 from skimage.morphology import disk
-from skimage import img_as_uint
+
 
 filterOptions = {
-    'median' : lambda img_raw, radius: skimage.filters.median(img_raw, disk(radius)),
-    'gaussian' : lambda img_raw, radius: skimage.filters.gaussian(img_raw, sigma=radius),
-    'prewitt' : lambda img_raw, radius: skimage.filters.prewitt(img_raw),
-    'sobel' : lambda img_raw, radius: skimage.filters.sobel(img_raw),
-    'scharr' : lambda img_raw, radius: skimage.filters.scharr(img_raw),
+    'median': lambda img_raw, radius: skimage.filters.median(img_raw, disk(radius)),
+    'gaussian': lambda img_raw, radius: skimage.filters.gaussian(img_raw, sigma=radius),
+    'prewitt': lambda img_raw, radius: skimage.filters.prewitt(img_raw),
+    'sobel': lambda img_raw, radius: skimage.filters.sobel(img_raw),
+    'scharr': lambda img_raw, radius: skimage.filters.scharr(img_raw),
 }
 
 if __name__ == "__main__":