Informatics, digital & computational pathology

Image analysis

Image analysis fundamentals

Editor-in-Chief: Debra L. Zynger, M.D.
Jerome Cheng, M.D.

Topic Completed: 4 March 2019

Minor changes: 14 May 2021

Copyright: 2019-2021,, Inc.

PubMed Search: Image analysis [title] Informatics "loattrfree full text"[sb]

Jerome Cheng, M.D.
Page views in 2020: 973
Page views in 2021 to date: 702
Cite this page: Cheng J. Image analysis fundamentals. website. Accessed December 2nd, 2021.
Definition / general
  • Extraction of useful information from virtual slides and other forms of digital images, commonly acquired through a whole slide scanner or camera
  • Tools such as ImageJ may be used to characterize the nuclei in a histological image of a soft tissue tumor; further analysis on the differences in nuclear shape, color and texture can aid in the classification of the type of lesion present in a specimen (Zentralbl Pathol 1994;140:351)
  • Digital image is composed of pixels arranged in a grid-like manner, with each pixel assigned x and y coordinates
  • Below is an image of a neutrophil magnified to emphasize each pixel, appearing as square blocks of different colors
  • Typical high definition computer monitor has 1920 columns and 1080 rows of pixels, making up a total of 1920 x 1080 = 2,073,600 pixels and 4K computer displays have 3840 x 2160 = 8,294,400 pixels
  • Colors in a digital image are commonly based on the RGB color model, with an image depth of 24 bits (8 bits for each color: red, green and blue); in this color representation, the pixels making up an image are composed of varying intensities of the 3 colors, each with an intensity value ranging from 0 to 255 and the combination of these 3 color intensities will produce a specific color, giving a possibility of 16,777,216 colors (256 x 256 x 256 = 16,777,216)
  • In image processing and analysis, the data are analyzed by performing various mathematical operations on numeric data derived from an image
Essential features
  • Image processing steps to modify and enhance image attributes are frequently involved to facilitate further processing or analysis of images
  • Combination of different image processing techniques are usually needed to perform a particular type of analysis
  • Image features acquired through image processing techniques can be combined with machine learning and statistical methods to categorize different types of cells, nuclei or cancer; dimensional reduction techniques like principal component analysis (PCA) and t-distributed stochastic neighbor embedding (t-SNE) may be used to visualize the differences in classes (example: type of cell) based on feature characteristics
  • Image processing: application of a set of mathematical operations or computer algorithms on digital images to alter or enhance the quality and characteristics of an image
  • Structuring element: defines the region / shape surrounding a pixel for morphologic operation
    • 3 x 3 square structuring element is often used by default if no structuring element is specified
    • Below is a diamond shaped structuring element with a radius of 3; when used with a morphologic operation, every white region in the structuring element contributes to calculations that will determine the final value of the pixel that overlaps with the center of the structuring element (3,3)
      • Image of the structuring element was created using Octave
Image analysis / processing techniques
  • Examples and methods shown below can be replicated using readily available tools such as ImageJ, GIMP and OpenCV, all of which can be downloaded and used for free
  • Grayscale operation: averages the value from each color channel to produce a black and white image
    • Example of RGB image converted to grayscale
    • To perform a grayscale operation using GIMP: load the image and under the Image menu, select Mode and choose the Grayscale option
  • Histogram: shows the frequency of each color in a graph, with each color intensity arranged left to right from lowest to highest intensity
    • ImageJ : Analyze menu → Histogram
    • Histogram of the neutrophil above (red channel); analysis was performed using ImageJ
  • Geometric transformations: rotation, scaling, cropping and shifting
  • Morphologic operations: erosion, dilation, opening, closing
    • Dilation: enlarges objects
      • Can be used to fill holes or for edge detection

Note: Diamond shaped structuring
element illustrated above was used
in this dilation operation

      • Binary dilation: at a pixel coordinate, returns a white pixel (value of 1) if any pixels within the vicinity of the pixel is positive (white); the vicinity is defined by a structuring element
      • Grayscale dilation: returns the maximum value (brightest pixel) in the vicinity of a pixel coordinate
    • Erosion: shrinks objects
      • Binary erosion at a pixel coordinate, returns a black pixel (value of 0) if any pixels within the vicinity of the pixel is zero (black)
      • Grayscale erosion: returns the minimum value (darkest pixel) in the vicinity of a pixel coordinate
    • Opening: erosion followed by dilation
    • Closing: dilation followed by erosion
  • Thresholding: excludes colors belonging to a specified range
    • Helpful in identifying structures with distinct colors like nuclei
    • ImageJ : Image menu → Adjust → Color Threshold
    • Below, the nuclei in a case of clear cell adenocarcinoma were highlighted using a thresholding operation, facilitating other image analysis procedures like morphometry, counting or segmentation of nuclei

  • Edge detection
  • Convolution matrix: for edge detection, sharpening or blurring
    • Most common: 3 x 3 matrix
    • GIMP: Filter menu → Generic → Convolution Matrix
    • Example: applying a 3 x 3 matrix composed of 1's will blur an image

  • Normalization: increases the contrast of an image
    • Contrast stretching
    • Histogram equalization
  • Watershed algorithm: useful for separating overlapping cells in an image so they can be counted properly
  • Contour tracing: draws the boundaries of an object
  • Fourier transform: converts an image into a series of 2 dimensional sinusoidal (sine and cosine) waves
    • Can be used to remove noise or smoothen an image
  • Convolutional Neural Networks (CNN): became popular in recent years for image classification tasks due to its accuracy and the availability of computational power needed to run CNN experiments
  • Cell counting
  • Mitosis detection
  • Cancer / tissue segmentation
  • Morphometry: measures the circularity, shape, volume, size, area and perimeter of objects (example: cells)
    • These measurements may be used to train machine learning algorithms to classify objects (example: cells or nuclei)
    • Dimensional reduction methods such as PCA or t-SNE can be used to visualize the differences between object classes based on the measurements
  • Cancer identification
  • Differential diagnosis engine
  • Area detection
  • Area measurement
  • Colocalization: looks for color signals that are close to one another
    • Can identify fluorescent signals that originate from the same region / cell
  • Object tracking
  • Volumetric processing of 3D images (PLoS Biol 2018;16:e2005970)
  • Karyotyping
  • Serum protein electrophoresis (SPEP) densitometry plot intensity measurement (Electrophoresis 2013;34:1148)
Additional references
Board review style question #1
Which image processing method can separate overlapping red blood cells?

  1. Grayscale operation
  2. Histogram equalization
  3. Rotation
  4. Watershed
Board review style answer #1
Board review style question #2
Which image processing technique can increase contrast in an image?

  1. Closing
  2. Dilation
  3. Histogram equalization
  4. Watershed
Board review style answer #2
C. Histogram equalization

Comment Here

Reference: Image analysis fundamentals
Back to top
Image 01 Image 02