Skip to main content
. 2020 Aug 27;5(1):e38. doi: 10.1017/cts.2020.531

Table 1.

A summary of select useful functions in image processing in Python and R

Program Package/library Function Brief description
Python Py_wsi Sample_and_store_patches Sample tiles (patches) from a WSI
OpenCV Dilate, erosion, etc.
scikit-image Rgb2hed Color deconvolution for WSIs
Match_histograms Histogram matching for color normalization
Threshold_otsu Otsu thresholding
Scipy Center_of_mass() Calculate object location
Find_objects() Find objects in an array
Label() Label features in an array
pgmagick Image conversions
R EBImage computeFeatures Calculate sizes of objects
removeObjects Remove objects
Filter2D Apply a filter to an image
Dilate, erosion, etc. Morphological operations
Bwlabel() Label objects
Otsu() Otsu thresholding
Tiff, jpeg, png Read/write Read and write images of different file types
Magick Image conversions
Reticulate Compile Python code in R
Windows/Linux ImageMagick Command-line package for image manipulation