changeset 1:6be26440a8ec draft default tip

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/anisotropic-diffusion/ commit d93e1dd276027cfc3fb518236110395a23d96f66
author thomaswollmann
date Wed, 16 Jan 2019 15:33:19 -0500
parents 9a30c8f0f651
children
files anisotropic_diffusion.py anisotropic_diffusion.xml test-data/galaxyIcon_noText.png test-data/galaxyIcon_noText.tif test-data/res.tif
diffstat 5 files changed, 17 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/anisotropic_diffusion.py	Tue Feb 21 09:11:07 2017 -0500
+++ b/anisotropic_diffusion.py	Wed Jan 16 15:33:19 2019 -0500
@@ -15,12 +15,14 @@
 parser.add_argument('eqoption', type=int, choices=[1,2], help='Perona Malik diffusion equation', default=1)
 args = parser.parse_args()
 
-img_in = skimage.io.imread(args.input_file.name)
-res = anisotropic_diffusion(img_raw, niter=args.niter, kappa=args.kappa, gamma=args.gamma, option=args.eqoption)
-res[res<-1]=-1
-res[res>1]=1
+with warnings.catch_warnings():
+	warnings.simplefilter("ignore") #to ignore FutureWarning as well 
 
-with warnings.catch_warnings():
-	warnings.simplefilter("ignore")
+	img_in = skimage.io.imread(args.input_file.name, plugin='tifffile')
+	res = anisotropic_diffusion(img_in, niter=args.niter, kappa=args.kappa, gamma=args.gamma, option=args.eqoption)
+	res[res<-1]=-1
+	res[res>1]=1
+
 	res = skimage.util.img_as_uint(res) #Attention: precision loss
-skimage.io.imsave(args.out_file.name, res, plugin='tifffile')
+
+	skimage.io.imsave(args.out_file.name, res, plugin='tifffile')
--- a/anisotropic_diffusion.xml	Tue Feb 21 09:11:07 2017 -0500
+++ b/anisotropic_diffusion.xml	Wed Jan 16 15:33:19 2019 -0500
@@ -1,9 +1,9 @@
 <tool id="anisotropic_diffusion" name="Anisotropic Diffusion" version="0.1">
   <description>Edge-preserving, Anisotropic diffusion</description>
   <requirements>
-    <requirement type="package" version="0.12.3" >scikit-image</requirement>
-    <requirement type="package" version="0.2.2">medpy</requirement>
-    <requirement type="package" version="1.12">numpy</requirement>
+    <requirement type="package" version="0.14.0" >scikit-image</requirement>
+    <requirement type="package" version="0.3.0">medpy</requirement>
+    <requirement type="package" version="1.15.4">numpy</requirement>
   </requirements>
   <command>
         <![CDATA[
@@ -11,7 +11,7 @@
         ]]>
   </command>
   <inputs>
-    <param name="input" type="data" format="tiff,png,jpg,bmp" label="Image file"/>
+    <param name="input" type="data" format="tiff" label="Image file"/>
     <param label="Number of iterations" name="niter" optional="true" type="integer" value="50"/>
     <param label="Conduction coefficient" name="kappa" optional="true" type="integer" value="50"/>
     <param label="Speed of diffusion" name="gamma" optional="true" type="float" value="0.1"/>
@@ -25,16 +25,16 @@
   </outputs>
   <tests>
     <test>
-	    <param name="input" value="galaxyIcon_noText.png" />
+	    <param name="input" value="galaxyIcon_noText.tif" />
 	    <param name="niter" value="100" />
-            <param name="kappa" value="50" />
+      <param name="kappa" value="50" />
 	    <param name="gamma" value="0.1" />
 	    <param name="eqoption" value="1" />
-	    <output name="output" ftype="tiff" />
+	    <output name="output" file="res.tif" ftype="tiff" compare="sim_size"/>
     </test>
   </tests>
   <help>Edge-preserving, Anisotropic image diffusion.</help>
   <citations>
-      <citation type="doi">10.1109/34.56205</citation>
+      <citation type="doi">10.1016/j.jbiotec.2017.07.019</citation>
   </citations>
 </tool>
Binary file test-data/galaxyIcon_noText.png has changed
Binary file test-data/galaxyIcon_noText.tif has changed
Binary file test-data/res.tif has changed