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.
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 a region by counting consecutive, collinear pixels sharing the same gray-level intensity.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
| Feature | GLRLM | GLCM | GLSZM | NGTDM |
|---|---|---|---|---|
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 |
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
GLRLM is one component of a broader radiomic texture analysis toolkit. These related concepts define the preprocessing steps, complementary matrices, and derived metrics essential for robust feature extraction.
Intensity Discretization
The critical preprocessing step of binning continuous voxel intensities into a finite number of discrete gray levels before matrix calculation. The number of bins directly impacts GLRLM sensitivity—too few bins suppress fine texture, while too many create sparse, noisy matrices. Common strategies include fixed bin number (e.g., 8, 16, 32 levels) and fixed bin width (e.g., 25 HU in CT). The Image Biomarker Standardisation Initiative (IBSI) recommends consistent discretization protocols to ensure cross-study reproducibility.
Short Run Emphasis (SRE)
A primary GLRLM-derived metric that quantifies the distribution of short consecutive runs of identical pixel intensities. SRE is calculated by dividing each run length count by the square of its run length, then summing and normalizing. A high SRE value indicates fine, granular textures with frequent intensity changes—characteristic of heterogeneous tumor microenvironments. Conversely, low SRE suggests coarse, homogeneous regions. SRE is often combined with Long Run Emphasis (LRE) and Run Percentage (RP) to form a comprehensive texture signature.
Gray-Level Co-occurrence Matrix (GLCM)
A complementary second-order statistical method that quantifies texture by calculating the frequency of specific pairs of pixel intensities occurring at a defined spatial offset and direction. While GLRLM captures run-length continuity, GLCM captures spatial dependence between pixel pairs. Key GLCM features include Contrast (local intensity variation), Homogeneity (closeness of element distribution to the diagonal), and Correlation (linear dependency of gray levels). Together, GLRLM and GLCM provide orthogonal texture characterizations.
Gray-Level Size Zone Matrix (GLSZM)
A texture matrix that quantifies the size of homogeneous connected regions (zones) of identical voxel intensity, independent of rotational orientation. Unlike GLRLM, which measures one-dimensional collinear runs, GLSZM measures two-dimensional or three-dimensional contiguous zones. This rotation-invariance makes GLSZM particularly valuable for analyzing tumors where orientation is arbitrary. Derived features include Zone Percentage (ZP) and Large Zone Emphasis (LZE), which correlate with coarse, uniform tissue architecture.
Run Length Non-Uniformity (RLN)
A GLRLM feature measuring the similarity of run lengths throughout the image. RLN is calculated by summing the squares of each run length's total count, then normalizing. Low RLN values indicate greater homogeneity in run length distribution—most runs have similar lengths. High RLN values suggest heterogeneous run length mixtures, often seen in complex, irregular tissue patterns. RLN is directionally dependent and is typically averaged across all 13 angular directions (in 3D) or 4 directions (in 2D) for a rotationally robust metric.

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