diff anisotropic_diffusion.py @ 1:626be11c43fc draft

planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/anisotropic-diffusion/ commit 27a6350188f687411bdd6bfe0d569c0803389ca0
author thomaswollmann
date Wed, 12 Dec 2018 04:48:49 -0500
parents babb41158e9f
children
line wrap: on
line diff
--- a/anisotropic_diffusion.py	Tue Feb 21 09:10:52 2017 -0500
+++ b/anisotropic_diffusion.py	Wed Dec 12 04:48:49 2018 -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')