Inferensys

Glossary

Gray-Level Run Length Matrix (GLRLM)

A texture matrix that counts the number of consecutive pixels with the same gray-level value in a specific direction to capture structural coarseness.
Developer building agentic RAG system, retrieval pipeline diagram on laptop, technical workspace with notes.
TEXTURE ANALYSIS

What is Gray-Level Run Length Matrix (GLRLM)?

A Gray-Level Run Length Matrix (GLRLM) is a second-order statistical texture analysis method that quantifies the coarseness of an image by counting consecutive pixels sharing the same gray-level value along a specific directional vector.

A Gray-Level Run Length Matrix (GLRLM) is a second-order statistical texture matrix that captures the spatial coarseness of an image by quantifying runs of consecutive, collinear pixels with identical gray-level values. A 'run' is defined by its length, direction, and gray-level intensity. The resulting matrix encodes the number of times a run of a specific length occurs for each gray level, providing a structural fingerprint of the region of interest (ROI).

GLRLM is a core component of radiomics feature extraction, where it is used to characterize intratumoral heterogeneity in medical scans. Short-run emphasis metrics indicate fine, granular textures, while long-run emphasis metrics suggest coarse, homogeneous structural patterns. The matrix is typically computed for multiple angular directions in 2D or 13 directions in 3D volumetric data, with features often averaged to achieve rotational invariance, making it a critical tool for image biomarker standardisation.

TEXTURE MATRIX METRICS

Key GLRLM Features and Their Interpretations

The Gray-Level Run Length Matrix (GLRLM) quantifies gray-level runs—consecutive pixels sharing the same intensity in a given direction. The following metrics are derived from the run-length distribution to characterize structural coarseness and homogeneity.

01

Short Run Emphasis (SRE)

Measures the distribution of short runs. A higher SRE value indicates finer, more heterogeneous textures with frequent intensity changes.

  • Formula: Divides the run-length matrix by the squared run length, summing and normalizing.
  • Interpretation: Fine-grained sandpaper or noisy tissue yields high SRE; smooth, uniform regions yield low SRE.
  • Clinical Relevance: High SRE in tumor regions often correlates with increased cellular heterogeneity.
Fine Textures
High SRE Indicates
02

Long Run Emphasis (LRE)

Measures the distribution of long runs. A higher LRE value indicates coarser, more structurally uniform textures with extended constant-intensity paths.

  • Formula: Multiplies the run-length matrix by the squared run length, summing and normalizing.
  • Interpretation: Homogeneous tissue like healthy liver parenchyma yields high LRE; chaotic structures yield low LRE.
  • Directional Sensitivity: LRE values vary significantly based on the angular offset (0°, 45°, 90°, 135°) chosen for run counting.
Coarse Textures
High LRE Indicates
03

Gray-Level Non-Uniformity (GLN)

Quantifies the similarity of gray-level values throughout the run-length matrix. Lower GLN indicates greater uniformity in intensity distribution.

  • Formula: Sums the squared row totals (per gray level) and normalizes by total runs.
  • Interpretation: A region with only a few dominant intensity levels produces low GLN; a region with many distinct intensities produces high GLN.
  • Relationship: GLN is independent of spatial arrangement and purely measures intensity dispersion across runs.
Intensity Dispersion
Primary Measurement
04

Run Length Non-Uniformity (RLN)

Quantifies the similarity of run lengths throughout the matrix. Lower RLN indicates greater uniformity in the distribution of run lengths.

  • Formula: Sums the squared column totals (per run length) and normalizes by total runs.
  • Interpretation: A texture where all runs have similar lengths yields low RLN; a mix of short and long runs yields high RLN.
  • Clinical Application: High RLN in a lesion may indicate a disorganized, heterogeneous internal architecture.
Length Consistency
Primary Measurement
05

Run Percentage (RP)

Measures the fraction of total runs relative to the total number of potential runs (voxel count). Higher RP indicates a coarser, more homogeneous texture.

  • Formula: Divides the total number of runs by the total number of voxels in the ROI.
  • Interpretation: RP approaches 1.0 when runs are maximally long (one run per gray level); it approaches 0.0 when runs are all length 1.
  • Robustness: RP is one of the most stable GLRLM features against intensity discretization parameter changes.
Coarseness Proxy
Primary Measurement
06

Low Gray-Level Run Emphasis (LGRE)

Measures the joint distribution of runs with low intensity values. High LGRE indicates a predominance of dark runs.

  • Formula: Divides the run-length matrix by the squared gray-level value, summing and normalizing.
  • Interpretation: Useful for characterizing hypodense or hypointense regions in CT and MRI, such as necrotic tumor cores.
  • Complementary Metric: Often analyzed alongside High Gray-Level Run Emphasis (HGRE) to capture the full intensity spectrum of runs.
Dark Runs
High LGRE Indicates
GLRLM INSIGHTS

Frequently Asked Questions

Explore the fundamental concepts behind the Gray-Level Run Length Matrix, a critical tool for quantifying structural texture and tissue heterogeneity in medical imaging.

A Gray-Level Run Length Matrix (GLRLM) is a second-order statistical texture analysis method that quantifies the coarseness of a structure by counting consecutive pixels (runs) that share the same gray-level intensity in a specific direction. Unlike first-order statistics that ignore spatial relationships, the GLRLM captures structural anisotropy by scanning the image at defined angles—typically 0°, 45°, 90°, and 135° in 2D space. For each run, the algorithm records its length and the gray level, populating a matrix where rows represent gray levels and columns represent run lengths. A fine texture will be dominated by short runs, while a coarse, homogeneous texture will exhibit many long runs, making this matrix essential for distinguishing malignant lesions from benign tissue in radiomics pipelines.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.