Inferensys

Glossary

Gray-Level Run Length Matrix (GLRLM)

A texture analysis matrix that counts the number of consecutive, collinear pixels sharing the same gray-level intensity to characterize structural roughness in medical images.
Finance team analyzing AI ROI on laptop, investment return charts visible, business case review session.
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 a region by counting consecutive, collinear pixels sharing the same gray-level intensity.

A Gray-Level Run Length Matrix (GLRLM) is a texture analysis matrix that quantifies structural roughness by counting runs of consecutive, collinear pixels that share an identical gray-level intensity. A 'run' is defined by its length, direction, and intensity value. The resulting matrix captures higher-order spatial information, distinguishing fine, granular textures from coarse, homogeneous regions by analyzing the distribution of these runs across a defined region of interest.

In radiomics, GLRLM features such as Short Run Emphasis (SRE) and Run Length Non-Uniformity (RLNU) are critical for characterizing tumor heterogeneity. The matrix is typically computed in four two-dimensional directions or thirteen three-dimensional directions to ensure rotational invariance. Accurate computation requires prior intensity discretization to bin continuous voxel values into a finite number of gray levels, a preprocessing step standardized by the Image Biomarker Standardisation Initiative (IBSI).

QUANTIFYING RUN-LENGTH TEXTURE

Key GLRLM-Derived Metrics

The Gray-Level Run Length Matrix (GLRLM) captures structural roughness by counting consecutive, collinear pixels sharing the same intensity. The following metrics, derived directly from the run-length probability distribution, are essential for characterizing tumor heterogeneity in radiomic analysis.

01

Short Run Emphasis (SRE)

A metric that quantifies the distribution of short runs of consecutive, identical pixel intensities. A high SRE value indicates fine, granular textures with rapid intensity fluctuations, often associated with heterogeneous tumor microenvironments. It is calculated by dividing each run count by its squared length, giving greater weight to shorter runs.

  • Formula: Σ [p(i,j) / j²] / Σ p(i,j)
  • Interpretation: High SRE = Fine texture; Low SRE = Coarse texture
  • Clinical Relevance: High SRE in lung CT nodules has been correlated with malignancy and poorer prognosis.
Fine-Grained
Texture Signature
02

Long Run Emphasis (LRE)

A metric that measures the distribution of long runs of consecutive, identical pixel intensities. A high LRE value indicates coarse, structurally homogeneous textures with broad, uniform regions. It is calculated by multiplying each run count by the square of its length, emphasizing longer runs.

  • Formula: Σ [p(i,j) × j²] / Σ p(i,j)
  • Interpretation: High LRE = Coarse, uniform texture; Low LRE = Fine texture
  • Clinical Relevance: High LRE in breast MRI has been associated with benign fibroglandular tissue, whereas low LRE suggests invasive carcinoma.
Coarse-Grained
Texture Signature
03

Gray-Level Non-Uniformity (GLN)

A metric that assesses the similarity of gray-level intensity values throughout the run-length distribution. A low GLN value indicates that runs are evenly distributed across all gray levels, signifying greater intensity uniformity. High GLN suggests that specific intensities dominate the texture.

  • Formula: Σ [Σ p(i,j)]² / Σ p(i,j)
  • Interpretation: Low GLN = Uniform intensity distribution; High GLN = Dominant intensities
  • Clinical Relevance: GLN is a robust predictor of overall survival in head and neck cancer when extracted from FDG-PET scans.
Intensity
Distribution Metric
04

Run Length Non-Uniformity (RLN)

A metric that evaluates the similarity of run lengths across the image. A low RLN value indicates that the lengths of runs are evenly distributed, suggesting a heterogeneous mix of fine and coarse textures. High RLN implies that the texture is dominated by runs of a single, specific length.

  • Formula: Σ [Σ p(i,j)]² / Σ p(i,j)
  • Interpretation: Low RLN = Even mix of run lengths; High RLN = Dominant run length
  • Clinical Relevance: RLN is sensitive to structural anisotropy and is frequently used to differentiate between necrotic cores and viable tumor peripheries in glioblastoma.
Length
Distribution Metric
05

Run Percentage (RP)

A measure of overall homogeneity that calculates the fraction of the total number of runs over the total number of pixels in the region of interest. A high RP value indicates a highly homogeneous texture dominated by long runs, while a low RP suggests a chaotic, short-run texture.

  • Formula: Σ p(i,j) / N_p
  • Interpretation: High RP = Homogeneous; Low RP = Heterogeneous
  • Clinical Relevance: RP is often inversely correlated with tumor grade, where lower RP values indicate higher cellular pleomorphism and aggressive pathology.
Homogeneity
Global Metric
06

Low Gray-Level Run Emphasis (LGRE)

A joint metric that quantifies the distribution of runs dominated by low intensity values (dark regions). It is calculated by dividing each run count by the square of its gray level. A high LGRE indicates that short, dark runs are prevalent, often corresponding to hypoxic or necrotic tissue.

  • Formula: Σ [p(i,j) / i²] / Σ p(i,j)
  • Interpretation: High LGRE = Dark, hypodense texture
  • Clinical Relevance: Combined with SRE, the LGRE metric helps identify necrotic cores in non-small cell lung cancer on contrast-enhanced CT.
Hypodense
Intensity Emphasis
GLRLM INSIGHTS

Frequently Asked Questions

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

A Gray-Level Run Length Matrix (GLRLM) is a second-order statistical texture analysis method that quantifies the structural roughness of an image by counting consecutive, collinear pixels that share the same gray-level intensity. It works by scanning a defined Region of Interest (ROI) in a specific direction (typically 0°, 45°, 90°, or 135°) and recording the length of each 'run' of identical pixel values. The resulting matrix stores the frequency of runs for each gray level and each run length, providing a compact representation of coarse or fine textural patterns. Unlike first-order statistics, which ignore spatial relationships, the GLRLM captures the directional graininess essential for distinguishing homogeneous tissue from heterogeneous tumor textures.

COMPARATIVE ANALYSIS

GLRLM vs. Other Texture Matrices

Structural and functional comparison of the Gray-Level Run Length Matrix against other core second-order and higher-order texture matrices used in radiomic feature extraction.

FeatureGLRLMGLCMGLSZMNGTDM

Primary Spatial Relationship

Consecutive collinear runs of identical gray levels

Pairwise co-occurrence at a defined offset (distance, angle)

Connected homogeneous zones (region size, not shape)

Average intensity difference between a voxel and its neighbors

Rotational Invariance

Captures Structural Roughness

Computational Complexity

O(N_g × N_r)

O(N_g²)

O(N_g × N_z)

O(N_g × N_v)

Key Derived Feature

Short Run Emphasis (SRE)

Contrast

Zone Percentage (ZP)

Coarseness

Sensitivity to Discretization

High

High

Moderate

Moderate

Typical Clinical Application

Quantifying tumor heterogeneity in soft-tissue sarcomas

Classifying benign vs. malignant nodules

Assessing lesion homogeneity in liver fibrosis

Evaluating brain tissue coarseness in neurodegeneration

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.