Previous changeset 0:f264ae82f735 (2019-02-09) Next changeset 2:f70b215d155c (2023-11-10) |
Commit message:
planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/2d_simple_filter/ commit 8e0d09b4c4eadfaaf125f4a0ae7dcbd1bee5ee51 |
modified:
filter.xml filter_image.py test-data/res.tif |
b |
diff -r f264ae82f735 -r dba87c4b32d3 filter.xml --- a/filter.xml Sat Feb 09 14:29:13 2019 -0500 +++ b/filter.xml Thu Jul 18 08:51:58 2019 -0400 |
b |
@@ -1,4 +1,4 @@ -<tool id="ip_filter_standard" name="Filter Image" version="0.0.2"> +<tool id="ip_filter_standard" name="Filter Image" version="0.0.3"> <description>applies a standard filter to an image</description> <requirements> <requirement type="package" version="0.14.2">scikit-image</requirement> |
b |
diff -r f264ae82f735 -r dba87c4b32d3 filter_image.py --- a/filter_image.py Sat Feb 09 14:29:13 2019 -0500 +++ b/filter_image.py Thu Jul 18 08:51:58 2019 -0400 |
[ |
@@ -6,6 +6,7 @@ import skimage.filters import skimage.util from skimage.morphology import disk +from skimage import img_as_uint filterOptions = { 'median' : lambda img_raw, radius: skimage.filters.median(img_raw, disk(radius)), @@ -24,11 +25,5 @@ args = parser.parse_args() img_in = skimage.io.imread(args.input_file.name) - res = filterOptions[args.filter_type](img_in, args.radius) - res[res<-1]=-1 - res[res>1]=1 - - with warnings.catch_warnings(): - warnings.simplefilter("ignore") - res = skimage.util.img_as_uint(res) #Attention: precision loss - skimage.io.imsave(args.out_file.name, res, plugin='tifffile') + res = img_as_uint(filterOptions[args.filter_type](img_in, args.radius)) + skimage.io.imsave(args.out_file.name, res, plugin='tifffile') |
b |
diff -r f264ae82f735 -r dba87c4b32d3 test-data/res.tif |
b |
Binary file test-data/res.tif has changed |