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).
Glossary
Gray-Level Run Length Matrix (GLRLM)

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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Gray-Level Run Length Matrix (GLRLM) is one component of a broader radiomic feature extraction framework. These related concepts define the mathematical and computational context required to understand and apply run-length texture analysis effectively.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us