# load the package using OpenSlide # construct path to test file inside of directory # note: test file is not part of code distribution and must be downloaded separately. imgfile = Pkg.dir("OpenSlide", "test", "CMU-1-Small-Region.svs") # load the slide @time img = OpenSlide.open_slide(imgfile) # read the entire level @time imgdata = OpenSlide.read_slide(img); arraysize(imgdata) using PyPlot # Plot a sub-region # We keep the figure small in order to reduce the size of the notebook, but larger figure size will work fine. figure(figsize=[2,2]) imshow(imgdata[1200:1500,800:1100,:]) # read a given extent and level (shown for example, but note that this image has only one level!) @time imgdata2 = OpenSlide.read_slide(img; origin = [1200,800], extent = [300,300], level = 1); figure(figsize=[2,2]) imshow(imgdata2) # get image properties props = OpenSlide.properties(img) props["tiff.ResolutionUnit"]