# HG changeset patch # User imgteam # Date 1549741743 18000 # Node ID a1d02d2e814a12e8f9853dff52f6f82bca677d44 planemo upload for repository https://github.com/BMCV/galaxy-image-analysis/tools/wsi_extract_top_view/ commit c3f4b766f03770f094fda6bda0a5882c0ebd4581 diff -r 000000000000 -r a1d02d2e814a test-data/CMU-1-Small-Region.svs Binary file test-data/CMU-1-Small-Region.svs has changed diff -r 000000000000 -r a1d02d2e814a test-data/out.tif Binary file test-data/out.tif has changed diff -r 000000000000 -r a1d02d2e814a wsi_extract_top_view.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wsi_extract_top_view.py Sat Feb 09 14:49:03 2019 -0500 @@ -0,0 +1,22 @@ +import argparse +import openslide +import os +import fnmatch +import skimage.io +import numpy as np + +def wsi_extract_top_view(input_path, out_path): + img_raw = openslide.OpenSlide(input_path) + top_size = img_raw.level_dimensions[len(img_raw.level_dimensions)-1] + img_area = img_raw.read_region((0,0), len(img_raw.level_dimensions)-1, top_size) + img_area = np.asarray(img_area, dtype=np.uint8) + skimage.io.imsave(out_path, img_area, plugin="tifffile") + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('input_file', type=argparse.FileType('r'), help='input file') + parser.add_argument('out_file', help='out file') + args = parser.parse_args() + + wsi_extract_top_view(args.input_file.name, args.out_file) diff -r 000000000000 -r a1d02d2e814a wsi_extract_top_view.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wsi_extract_top_view.xml Sat Feb 09 14:49:03 2019 -0500 @@ -0,0 +1,34 @@ + + from whole-slice image + + scikit-image + numpy + openslide-python + glob2 + + + + + + + + + + + + + + + + + + **What it does** + + Extracts the top view from a whole-slice image, also known as virtual slide, which are high-resolution images used in digital pathology. + + + 10.1016/j.jbiotec.2017.07.019 + +