Paper deep dive
A Voxel-Spacing-Aware Extension of PyRadiomics for Anisotropic Texture Analysis
David Corral Fontecha, Juan Miranda Bautista, Pablo Menendez Fernández-Miranda, Andrea Trapote Fernandez, Lara Lloret Iglesias, Jose A. Vega
Intelligence
Status: succeeded | Model: Gemma-4-26B-A4B | Prompt: intel-v1 | Confidence: 93%
Last extracted: 9/20/2026, 4:18:49 AM
Summary
This paper presents a voxel-spacing-aware extension of the PyRadiomics software framework designed to handle anisotropic voxel spacing in CT and MRI images without generating interpolated gray levels. The implementation modifies the Python frontend, C wrapper, and computational backend to incorporate physical spacing information. Specifically, GLCM uses anisotropy-relative feature-level angular aggregation, NGTDM uses anisotropy-relative weighted neighborhood averaging, and GLRLM, GLDM, and GLSZM are computed on a finite-volume zero-order-hold representation derived from the native anisotropic grid. Validation using synthetic 3D phantoms confirmed that the modified implementation reproduces standard PyRadiomics results when spacing-aware mode is disabled or under isotropic spacing, while providing distinct, non-interpolated alternatives under anisotropic conditions.
Entities (10)
Relation Signals (12)
PyRadiomics → extendedby → Voxel-Spacing-Aware Extension
confidence 95% · We implemented and validated a voxel-spacing-aware extension of PyRadiomics that incorporates spacing information without generating interpolated gray levels.
PyRadiomics → implements → GLSZM
confidence 95% · gray-level size-zone matrices (GLSZM)
PyRadiomics → implements → GLCM
confidence 95% · The library provides a standardized framework for the computation of first-order, shape and texture descriptors... These include gray-level co-occurrence matrices (GLCM)
PyRadiomics → implements → NGTDM
confidence 95% · These include... neighborhood gray-tone difference matrices (NGTDM)
PyRadiomics → implements → GLRLM
confidence 95% · These include gray-level run-length matrices (GLRLM)
PyRadiomics → implements → GLDM
confidence 95% · gray-level dependence matrices (GLDM)
Voxel-Spacing-Aware Extension → avoids → Interpolated Gray Levels
confidence 93% · The framework operates across the Python frontend, C wrapper, and computational backend... incorporates spacing information without generating interpolated gray levels.
GLCM → usesmethod → Anisotropy-Relative Angular Aggregation
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Radiomic texture features are commonly extracted from anisotropic CT and MRI acquisitions, where identical voxel offsets may represent different physical distances. We implemented and validated a voxel-spacing-aware extension of PyRadiomics that incorporates spacing information without generating interpolated gray levels. The framework operates across the Python frontend, C wrapper, and computational backend. GLCM uses anisotropy-relative feature-level angular aggregation, NGTDM uses anisotropy-relative weighted neighborhood averaging, and GLRLM, GLDM, and GLSZM are computed on a finite-volume zero-order-hold representation derived from the native anisotropic grid. Synthetic 3D phantoms were used for software validation. The modified implementation reproduced standard PyRadiomics exactly when spacing-aware mode was disabled and remained equivalent under isotropic spacing across 75 texture features. Under anisotropic spacing, the method selectively modified texture families and was numerically distinct from nearest-neighbor, linear, and B-spline resampling. Computational profiling showed moderate runtime and memory increases, while sensitivity analyses quantified finite-volume rounding effects and confirmed that spacing-aware differences persisted across binWidth settings. The framework provides a backward-compatible technical basis for future evaluation of spacing-aware radiomics in heterogeneous medical imaging datasets.
Tags
Links
- Source: https://arxiv.org/abs/2609.14103v1
- Canonical: https://arxiv.org/abs/2609.14103v1
Trouble viewing inline? Open PDF directly →
Full Text
45,769 characters extracted from source content.
Expand or collapse full text
A Voxel-Spacing-Aware Extension of PyRadiomics for Anisotropic Texture Analysis David Corral Fontecha Affiliation: Department of Radiology, Complejo Asistencial Universitario de León, León, Spain Juan Miranda Bautista Affiliation: Department of Radiology, Hospital Universitario Rey Juan Carlos, Móstoles, Madrid, Spain Affiliation: Health Research Institute of the Jiménez Díaz Foundation, IIS-FJD, Madrid, Spain Affiliation: Department of Physical Therapy, Occupational Therapy, Rehabilitation and Physical Medicine, Rey Juan Carlos University, Madrid, Spain Affiliation: Department of Morphology and Cell Biology, Grupo SINPOS, Universidad de Oviedo, Oviedo, Spain Pablo Menendez Fernández-Miranda Affiliation: Department of Radiology, Hospital Universitario Rey Juan Carlos, Móstoles, Madrid, Spain Affiliation: Health Research Institute of the Jiménez Díaz Foundation, IIS-FJD, Madrid, Spain Affiliation: Department of Physical Therapy, Occupational Therapy, Rehabilitation and Physical Medicine, Rey Juan Carlos University, Madrid, Spain Affiliation: Department of Morphology and Cell Biology, Grupo SINPOS, Universidad de Oviedo, Oviedo, Spain Andrea Trapote Fernandez Affiliation: Universidad de Oviedo, Oviedo, Spain Lara Lloret Iglesias Affiliation: Advanced Computing and e-Science Group, IFCA-CSIC, Santander, Spain Jose A. Vega Affiliation: Department of Morphology and Cell Biology, Grupo SINPOS, Universidad de Oviedo, Oviedo, Spain Affiliation: Facultad de Ciencias de la Salud, Universidad Autónoma de Chile, Providencia-Santiago, Chile Abstract Background and Objective: Radiomic texture features are commonly extracted from anisotropic CT and MRI acquisitions, where identical voxel offsets may correspond to different physical distances. Standard workflows often address this issue through isotropic resampling, although interpolation modifies both image geometry and intensity values. This work aimed to implement and validate a voxel-spacing-aware extension of PyRadiomics for anisotropic medical imaging. Methods: A voxel-spacing-aware framework was integrated across the Python frontend, C wrapper layer and computational backend of PyRadiomics. The implementation preserves the discretized gray levels supplied to texture computation and introduces spacing-dependent operations only when weightingNorm="voxelSpacing" is enabled. GLCM uses anisotropy-relative feature-level angular aggregation. GLRLM, GLDM and GLSZM are computed on a finite-volume zero-order-hold representation derived from the native anisotropic grid, preserving gray-level values while expressing run length, dependence size and zone size on an isotropic physical lattice. NGTDM incorporates anisotropy-relative weighted neighborhood averaging. Synthetic images with isotropic and anisotropic spacing were used for software validation. Results: The modified implementation reproduced standard PyRadiomics exactly when voxel-spacing-aware mode was disabled and remained equivalent under isotropic spacing across 75 texture features. Under anisotropic spacing, voxel-spacing-aware extraction selectively modified texture families and behaved as a distinct alternative to nearest-neighbor, linear and B-spline resampling without generating interpolated gray levels. Computational profiling showed moderate runtime and memory increases across the tested finite-volume expansion factors. Sensitivity analyses quantified the effect of finite-volume rounding and showed that spacing-aware differences persisted across binWidth settings. Conclusions: The proposed framework provides a backward-compatible implementation for incorporating voxel-spacing information into selected radiomic texture operations without generating interpolated gray levels. It establishes a technical basis for future evaluation of spacing-aware radiomics in heterogeneous clinical imaging datasets. Keywords: Radiomics; PyRadiomics; voxel spacing; texture analysis; medical imaging. 1. Introduction Radiomics aims to transform medical images into high-dimensional quantitative descriptors that capture tissue phenotype, spatial heterogeneity and structural organization [1, 2, 3]. Over the past decade, radiomic features have been investigated across numerous clinical applications, including oncology, treatment response assessment and prognostic modelling [1, 2]. As the field has matured, increasing attention has been directed toward the standardization, reproducibility and transparent implementation of radiomic biomarkers, leading to initiatives such as the Image Biomarker Standardisation Initiative (IBSI) and the adoption of open-source software frameworks [4, 5]. Among available radiomics platforms, PyRadiomics has become one of the most widely used open-source implementations for feature extraction from medical images [6]. The library provides a standardized framework for the computation of first-order, shape and texture descriptors and is explicitly recommended as a reference implementation in many radiomics workflows. Most texture features implemented in PyRadiomics are derived from matrix-based representations of spatial relationships between voxels, following classical texture analysis formulations originally introduced by Haralick and subsequently extended within the radiomics literature [7]. These include gray-level co-occurrence matrices (GLCM), gray-level run-length matrices (GLRLM), gray-level dependence matrices (GLDM), neighborhood gray-tone difference matrices (NGTDM) and gray-level size-zone matrices (GLSZM). A fundamental characteristic of many clinical CT and MRI acquisitions is voxel anisotropy. While in-plane voxel spacing is often submillimetric, through-plane spacing may be substantially larger due to acquisition constraints, reconstruction settings, or clinical workflow considerations. Consequently, a displacement of one voxel along different image axes may correspond to markedly different physical distances. Despite this geometric disparity, texture matrices are commonly constructed using offsets defined in discrete index space, where neighboring voxels separated by identical index displacements are treated equivalently regardless of their physical separation. The most common strategy for addressing anisotropy is isotropic resampling prior to feature extraction. Although resampling improves geometric consistency, it simultaneously modifies image intensities through interpolation. As a result, geometric correction becomes intrinsically coupled to signal modification, making it difficult to distinguish the effects of spatial harmonization from those introduced by interpolation itself. Previous studies have demonstrated that voxel size, image acquisition parameters and scanner-dependent factors can substantially influence radiomic feature values and reproducibility [8, 9, 5]. An alternative approach is to avoid intensity-interpolating resampling and incorporate physical voxel geometry directly into texture computation. However, spacing-aware formulations are not routinely implemented in standard radiomics workflows and most texture computations remain fundamentally based on index-space relationships. Moreover, not all radiomic feature families admit physically meaningful spacing corrections, raising important mathematical and software-engineering questions regarding how anisotropy should be handled within standardized radiomics software. To the best of our knowledge, publicly available descriptions of voxel-spacing-aware radiomics implementations remain limited and detailed reports of complete frontend-to-backend voxel-spacing-aware implementations within established radiomics frameworks remain scarce. In this work, we present a voxel-spacing-aware extension of PyRadiomics implemented across the Python frontend, C wrapper layer and computational backend of the library. Rather than generating interpolated gray levels through isotropic resampling, the proposed framework incorporates physical voxel spacing through feature-family-specific operations while preserving the discretized gray levels supplied to texture computation. We describe the mathematical rationale underlying the proposed modifications, detail the software architecture required for their implementation, discuss compatibility with existing PyRadiomics and IBSI workflows and critically evaluate the suitability of spacing-aware formulations across different radiomic feature families. This article focuses exclusively on the software architecture, mathematical formulation and implementation details of the proposed framework. Its clinical evaluation is reported separately in an independent application study [10]. 2. Methods 2.1. Geometric implications of voxel anisotropy Texture descriptors rely on spatial relationships between neighboring voxels. In anisotropic CT and MRI acquisitions, identical index-space displacements may correspond to different physical distances, particularly when through-plane spacing differs from in-plane spacing. Let the voxel spacing vector and discrete offset vector be defined as =(Δz,Δy,Δx),=(az,ay,ax),s=( _z, _y, _x), =(a_z,a_y,a_x), where a represents an offset in index space. The corresponding physical distance is dphys=(azΔz)2+(ayΔy)2+(axΔx)2.d_a^phys= (a_z _z)^2+(a_y _y)^2+(a_x _x)^2. (1) To ensure that weighting reflects anisotropy rather than absolute directional length, the proposed implementation uses the ratio between physical and index-space distances. The index-space distance is dindex=az2+ay2+ax2,d_a^index= a_z^2+a_y^2+a_x^2, (2) and the relative anisotropy factor is r=dphysdindex.r_a= d_a^physd_a^index. (3) For valid non-zero offsets and positive physical voxel spacings, r>0r_a>0. In the GLCM implementation, unnormalized directional weights are computed as w~=1max(r,10−5), w_a= 1 (r_a,10^-5 ), (4) and are subsequently normalized across the set of valid directions. The lower bound of 10−510^-5 is included solely as a numerical safeguard and does not materially affect weights for valid offsets and positive physical voxel spacings. Normalized weights are then obtained as W=w~∑∈Aw~,W_a= w_a _b∈ A w_b, (5) where A denotes the set of valid offsets for a given texture descriptor. Under isotropic spacing, r_a is constant across directions and the voxel-spacing-aware branch is defined to reproduce standard PyRadiomics behavior. The implementation is activated only through weightingNorm="voxelSpacing". 2.2. Array, spacing and orientation conventions PyRadiomics internally represents SimpleITK images as NumPy arrays in (z,y,x)(z,y,x) order, whereas SimpleITK reports voxel spacing in (x,y,z)(x,y,z) order. In the voxel-spacing-aware implementation, the SimpleITK spacing vector is therefore reversed using GetSpacing()[::-1] before spacing-dependent calculations, so that =(Δz,Δy,Δx)s=( _z, _y, _x) is aligned directly with the NumPy array axes. The corresponding spacing component is then associated with the same array axis during physical-distance calculation and finite-volume expansion. The voxel-spacing-aware operations use voxel spacing and array-axis geometry but do not incorporate the SimpleITK image direction matrix. Consequently, the current implementation assumes that the array-axis representation and associated spacing components provide the relevant orthogonal acquisition geometry. Image-direction handling is therefore outside the scope of the present implementation and should be considered when applying the method to data requiring explicit orientation-aware physical coordinates. 2.3. Finite-volume representation for selected texture matrices For GLRLM, GLDM and GLSZM, voxel-spacing-aware extraction was implemented using a finite-volume, zero-order-hold representation of the native image grid. Let h=min(Δz,Δy,Δx)h= ( _z, _y, _x) denote the finest voxel spacing. For each axis k∈z,y,xk∈\z,y,x\, the finite-volume expansion factor is qk=round(Δkh),k∈z,y,x.q_k=round ( _kh ), k∈\z,y,x\. (6) The spacing represented by the finite-volume lattice along each axis is Δk∗=qkh, _k^*=q_kh, (7) and the corresponding relative representation error is ek=Δk∗−ΔkΔk.e_k= _k^*- _k _k. (8) The total finite-volume expansion factor is R=qzqyqx.R=q_zq_yq_x. (9) For an input array of dimensions Nz×Ny×NxN_z× N_y× N_x, the expanded lattice contains Nexpanded=(Nzqz)(Nyqy)(Nxqx)N_expanded=(N_zq_z)(N_yq_y)(N_xq_x) (10) subcells. The image and mask are expanded by repeating each voxel along axis k by qkq_k subcells. This operation is an exact zero-order-hold replication implemented with numpy.repeat. It does not generate interpolated gray levels or mix neighboring voxel values; each subcell inherits the discretized gray level of its parent voxel. However, the operation intentionally changes the computational lattice by replacing each native anisotropic voxel with a block of isotropic subcells. Matrix construction is then performed using the standard PyRadiomics backend on the expanded lattice. Consequently, run length, dependence size and zone size remain integer-valued matrix axes, but are expressed in isotropic physical subcells rather than anisotropic native index voxels. Before finite-volume expansion, the implementation computes the repeat factors and expanded array shape. The helper function applies a maximumExpansionFactor limit of 1000 to the total repeat-factor product R=qzqyqx.R=q_zq_yq_x. This safeguard limits the geometric expansion factor rather than the absolute number of expanded voxels. The repeat factors, represented spacing, relative spacing error, expanded shape, and expansion factor are reported through the logging system. Warnings are emitted when the maximum absolute relative spacing error exceeds 10%10\% or when R>8R>8. The library implementation does not currently impose an independent limit based on the total expanded voxel count. If spacing is isotropic, no expansion is applied and the standard PyRadiomics path is preserved. For the finite-volume GLRLM, GLDM and GLSZM paths, the discretized image and binary ROI mask are expanded using identical repeat factors along each axis. Expansion is implemented using exact array replication (numpy.repeat); therefore, no interpolated image values or partial-volume mask values are introduced. Each expanded mask subcell inherits the binary label of its parent voxel, producing a block-wise representation of the original ROI boundary on the expanded lattice. For GLCM and NGTDM, computations remain on the native array. Candidate neighbors lying outside the image or outside the ROI are excluded from matrix or neighborhood accumulation. In GLCM, empty directional matrices are removed and angular weights are renormalized over the remaining valid directions. In spacing-aware NGTDM, neighborhood normalization is performed using only the weights of valid neighbors. This representation is illustrated schematically in Figure 1. Figure 1: Voxel-spacing-aware texture extraction strategy. GLCM and NGTDM operate on the native computational lattice using anisotropy-relative weighting, whereas GLRLM, GLDM and GLSZM are computed on a finite-volume zero-order-hold representation. In the latter families, each anisotropic voxel is represented by repeated isotropic subcells that inherit the discretized gray level of the parent voxel. This operation introduces no interpolated gray levels but changes the computational lattice on which run, dependence and zone relationships are evaluated. 2.4. Software implementation The voxel-spacing-aware framework was implemented across three software layers within PyRadiomics [6]: (i) Python feature classes and configuration management, (i) C extension wrapper functions (_cmatrices.c) and (i) computational matrix backends (cmatrices.c). When weightingNorm="voxelSpacing" is enabled, voxel spacing information is propagated from the Python frontend through the wrapper layer to the computational backend. Physical distances and anisotropy-relative weights are incorporated according to feature-family structure. For GLCM, directional co-occurrence matrices remain separate during feature calculation, and spacing-aware weights are applied only during the final feature-level angular aggregation. NGTDM incorporates weighted neighborhood averaging, whereas GLRLM, GLDM and GLSZM are computed on a finite-volume zero-order-hold representation derived from the native anisotropic grid. The implementation was designed to preserve backward compatibility. When voxel-spacing-aware mode is disabled, the standard PyRadiomics execution paths, matrix definitions and feature calculations remain unchanged. The default mode is therefore intended to preserve the numerical behavior of the reference PyRadiomics implementation. In contrast, enabling weightingNorm="voxelSpacing" activates explicitly defined methodological extensions that incorporate voxel geometry into selected texture operations. Results obtained in this mode should not be interpreted as conventional IBSI reference values, but as outputs of the proposed voxel-spacing-aware extension. 2.5. Feature-family-specific modifications Spacing-aware behavior was implemented selectively according to feature-family structure. Modifications were introduced only when voxel spacing could be incorporated without replacing the underlying descriptor semantics. GLCM is based on directional co-occurrence statistics and therefore admits anisotropy-aware angular aggregation without altering matrix construction. In contrast, run-, dependence- and zone-based descriptors rely on discrete size measures. The feature-family-specific implementation strategies are summarized in Table 1. 2.5.1 Gray-Level Co-occurrence Matrix (GLCM) GLCM co-occurrence pairs are enumerated using the standard PyRadiomics implementation. Matrix construction, discretization and Haralick feature definitions remain unchanged. Let P(i,j)P_a(i,j) denote the directional co-occurrence matrix associated with offset a. In the proposed implementation, voxel spacing is incorporated only during the final angular aggregation. A feature value is first computed independently for each directional matrix, yielding F(P)F(P_a). The final value is then obtained as F=∑∈AWF(P),F= _a∈ AW_aF(P_a), (11) where W_a denotes the normalized anisotropy-relative weight defined in Equation 5. Directional GLCMs are not combined before feature computation. Unlike matrix-level aggregation, this formulation preserves the native directional co-occurrence distributions and applies spacing-aware weighting only after feature computation. Matrix-level weighting was intentionally avoided because many Haralick descriptors are nonlinear functions of the co-occurrence matrix. Weighting matrices before feature computation would therefore modify descriptor definitions and potentially alter their mathematical interpretation. Feature-level aggregation was selected as a conservative strategy that preserves directional co-occurrence statistics while incorporating anisotropy information only during the final aggregation step. Consequently, the implementation should be interpreted as an anisotropy-aware angular aggregation strategy rather than a modification of the underlying GLCM definition. 2.5.2 Gray-Level Run-Length Matrix (GLRLM) GLRLM was computed using the standard PyRadiomics backend on the finite-volume representation. Run lengths remain integer counts of contiguous elements along discrete directions, preserving the original run-length formulation [11]. In voxel-spacing-aware mode, these counts represent isotropic subcells rather than native anisotropic voxels. 2.5.3 Neighborhood Gray-Tone Difference Matrix (NGTDM) NGTDM, originally introduced by Amadasun and King [12] and later standardized by IBSI [4], depends explicitly on local neighborhood averaging. In the NGTDM computational backend, the relative anisotropy factor is evaluated as r=dphysdindex+10−12,r_a= d_a^physd_a^index+10^-12, (12) and the corresponding unnormalized neighborhood weight is w~=1r+10−6. w_a= 1r_a+10^-6. (13) The constants 10−1210^-12 and 10−610^-6 are numerical safeguards against division by zero and have a negligible effect for valid non-zero offsets and positive physical voxel spacings. The resulting weights are normalized over the valid neighborhood offsets. The standard unweighted neighborhood mean is then replaced by I¯(x)=∑∈N(x)I(x+)w~∑∈N(x)w~. I(x)= _a∈ N(x)I(x+a) w_a _a∈ N(x) w_a. (14) Consequently, neighbors located at larger physical distances contribute proportionally less to the local intensity estimate while preserving the original neighborhood definition. The usual NGTDM accumulation is then performed using |I(x)−I¯(x)|. |I(x)- I(x) |. Thus, spacing information is incorporated directly into descriptor construction. 2.5.4 Gray-Level Dependence Matrix (GLDM) GLDM was computed using the standard dependence criterion on the finite-volume representation. Dependence size remains an integer count of neighboring subcells satisfying |I(x)−I(x+a)|≤α.|I(x)-I(x+a)|≤α. This avoids introducing fractional dependence values while allowing anisotropic voxel geometry to affect local dependence estimation through the finite-volume lattice. 2.5.5 Gray-Level Size-Zone Matrix (GLSZM) GLSZM was computed using the standard connected-zone algorithm on the finite-volume representation. Zone size remains an integer count, but in voxel-spacing-aware mode it counts isotropic subcells rather than native anisotropic voxels. Thus, topology and connectivity rules remain unchanged, while zone-size-related descriptors become sensitive to anisotropic voxel volume. 2.5.6 Shape and first-order features No additional spacing-aware modifications were required for shape features because voxel spacing is already incorporated into geometric calculations. First-order descriptors are largely independent of spatial voxel relationships, except for volume-dependent quantities such as Total Energy. Feature family Modification level Use of spacing Interpretation GLCM Feature-level angular aggregation Anisotropy-relative weights Directional GLCMs are preserved and weighted after feature computation. GLRLM Finite-volume matrix construction Zero-order-hold isotropic subcells Run lengths remain integer counts on the expanded physical lattice. NGTDM Descriptor computation Anisotropy-relative weighted neighborhood mean Neighborhood averaging becomes spacing-aware. GLDM Finite-volume matrix construction Zero-order-hold isotropic subcells Dependence size remains integer-valued on the expanded physical lattice. GLSZM Finite-volume matrix construction Zero-order-hold isotropic subcells Standard connected-zone rules are applied while zone size counts isotropic subcells. Shape No new modification Already supported PyRadiomics already uses voxel spacing. First-order Minimal Voxel volume where relevant Mostly intensity-distribution based. Table 1: Summary of spacing-aware implementation strategy by radiomic feature family. 2.6. Filtered image types Filtered image types were largely retained from standard PyRadiomics. Wavelet, gradient and intensity-transformation filters were not functionally modified; the gradient filter already uses image spacing by default through gradientUseSpacing=True. Limited filter-level adjustments included spacing-aware LoG handling and conservative disabling of anisotropic 3D LBP generation when no physically justified extension was available. 2.7. Regression and compatibility testing Software verification included both the existing upstream PyRadiomics regression suite and dedicated voxel-spacing-aware tests. In the evaluated development overlay, 3568 upstream tests passed, including reference feature and matrix tests designed to detect changes in standard PyRadiomics behavior. Additional spacing-aware tests verified isotropic equivalence by comparing default extraction with weightingNorm="voxelSpacing" under isotropic voxel spacing. The current test suite does not contain an independent IBSI benchmark for the new spacing-aware mode. It also does not yet provide dedicated anisotropic reference-value fixtures for every spacing-aware feature family. The regression results therefore establish backward compatibility with the tested PyRadiomics implementation rather than formal IBSI conformance of the proposed extension. 2.8. Synthetic software validation A synthetic software-validation framework was designed to verify the correctness, behavior and computational characteristics of the proposed voxel-spacing-aware implementation under controlled conditions. All experiments were performed using deterministic three-dimensional synthetic phantoms and were intended exclusively for software validation rather than clinical performance assessment. The primary validation experiment assessed backward compatibility, isotropic equivalence and anisotropic activation. Backward compatibility was defined as exact numerical agreement between the original PyRadiomics implementation and the modified implementation with voxel-spacing-aware functionality disabled. This test was intended to verify that the new code did not alter the established default PyRadiomics behavior. Evaluation of the voxel-spacing-aware mode was treated separately because its outputs represent newly defined methodological extensions rather than conventional IBSI reference values. A three-dimensional image containing predefined intensity patterns and a binary region-of-interest mask was generated using both isotropic and anisotropic spacing configurations. Radiomic features were extracted using (i) the original PyRadiomics implementation, (i) the modified implementation with voxel-spacing-aware functionality disabled and (i) the modified implementation with weightingNorm="voxelSpacing" enabled. Feature extraction was restricted to GLCM, GLRLM, GLDM, NGTDM and GLSZM, while shape features were excluded because physical spacing is already incorporated in standard PyRadiomics geometric calculations. All texture features were computed using fully three-dimensional (3D) matrix construction with force2D=False. No slice-wise 2D or 2.5D texture extraction was used in the present validation experiments. To compare the proposed framework with conventional preprocessing strategies, additional anisotropic synthetic phantoms were generated with through-plane spacing ratios of 2:1:1, 3:1:1 and 5:1:1 in array order ((z,y,x)). Each phantom contained a binary ROI, an in-plane intensity gradient, through-plane alternating bands, local heterogeneous texture and fixed-seed noise. Texture features were extracted using native PyRadiomics without resampling, isotropic resampling with nearest-neighbor, linear or B-spline interpolation, and the voxel-spacing-aware implementation. Mask resampling was always performed using nearest-neighbor interpolation. For each resampling comparison, a feature-level output table was generated containing the native value, comparison value, absolute difference, relative difference, and extraction method. Results were summarized across individual feature–phantom comparisons and by texture family. Computational profiling was performed using synthetic volumes of 16×64×6416× 64× 64, 32×96×9632× 96× 96, and 48×128×12848× 128× 128 voxels. The corresponding native ROI sizes were 12,126, 50,328, and 139,028 voxels. Expansion factors of R=1,2,3,5R=1,2,3,5, and 7 were evaluated. Runtime and approximate peak memory consumption were recorded together with the repeat factors qkq_k, represented spacings Δk∗ _k^*, relative representation errors eke_k, expanded array dimensions, and expanded ROI sizes. Sensitivity to non-integer spacing ratios was evaluated using through-plane spacings of 2.0, 2.5, 3.0, 3.5, 5.0, and 5.5 m with fixed 1 m in-plane spacing. Finally, discretization sensitivity was assessed by repeating feature extraction with binWidth values of 5, 10, 25, and 50. 3. Results 3.1. Implementation outcome The voxel-spacing-aware framework was integrated across the Python frontend, shared configuration and spacing utilities, the C extension wrapper, and the computational backend of PyRadiomics. The implementation introduced an optional execution mode through weightingNorm="voxelSpacing" without altering the standard external feature-extraction workflow. The evaluated development overlay passed all 3568 tests executed from the upstream PyRadiomics regression suite. Dedicated synthetic tests also confirmed exact isotropic equivalence between default extraction and the spacing-aware execution mode under isotropic voxel spacing. Spacing-aware functionality was implemented selectively according to feature-family structure. GLCM used anisotropy-relative feature-level angular aggregation. GLRLM, GLDM and GLSZM were computed on a finite-volume zero-order-hold representation derived from the native anisotropic grid. NGTDM incorporated anisotropy-relative weighted neighborhood averaging. 3.2. Software validation The modified implementation reproduced original PyRadiomics results exactly when voxel-spacing-aware mode was disabled. For the anisotropic synthetic image, all 75 evaluated texture features were identical between the original and modified implementations. Similarly, under isotropic voxel spacing, enabling weightingNorm="voxelSpacing" produced identical results to the default implementation, with mean and maximum absolute differences equal to zero. Under anisotropic voxel spacing, activation of weightingNorm="voxelSpacing" modified all evaluated GLCM, GLRLM and NGTDM features, 11 of 14 GLDM features and 8 of 16 GLSZM features. Median relative differences were 10.1% for GLCM, 26.1% for GLRLM, 33.6% for NGTDM, 49.1% for GLDM and 40.0% for GLSZM. Additional validation showed that voxel-spacing-aware extraction was not equivalent to conventional isotropic resampling. Across the three anisotropic synthetic phantoms, corresponding to 225 feature–phantom comparisons, nearest-neighbor resampling changed 192/225 comparisons (85.3%), whereas linear and B-spline resampling changed 225/225 comparisons (100%). Voxel-spacing-aware extraction changed 192/225 comparisons (85.3%). The median of the family-level median relative differences was 0.333 for nearest-neighbor resampling, 0.304 for linear resampling, 0.302 for B-spline resampling, and 0.307 for voxel-spacing-aware extraction. The minimum method-level Spearman correlations were 0.900 for nearest-neighbor and voxel-spacing-aware extraction and 0.800 for linear and B-spline resampling. These results confirm that the proposed method is not numerically equivalent to resampling, despite producing differences of comparable magnitude, because it preserves the gray levels supplied to texture computation rather than generating interpolated gray levels. Computational profiling showed increasing memory requirements with finite-volume expansion while runtime remained moderate across the tested synthetic settings. The most demanding completed experiment used a 48×128×12848× 128× 128 volume with spacing 0.7:0.7:5.00.7:0.7:5.0 m, producing repeat factors q=(1,1,7)q=(1,1,7), an expanded lattice of 48×128×89648× 128× 896, and 973,196 ROI subcells. Runtime was 1.74 s and approximate peak memory consumption was 90.55 MB. Across all tested configurations, median peak memory increased from 2.83 MB at R=1R=1 to 13.56 MB at R=7R=7, while the maximum observed runtime remained below 1.75 s. Finite-volume rounding introduced measurable geometric approximation for non-integer spacing ratios. Integer spacing ratios were represented without error. A 2.5:1:12.5:1:1 spacing ratio was represented using qz=2q_z=2, corresponding to a relative through-plane representation error of −20.0%-20.0\%, whereas a 3.5:1:13.5:1:1 ratio was represented using qz=4q_z=4, corresponding to an error of +14.3%+14.3\%. Across adjacent tested spacing-ratio configurations, the largest family-level median relative feature difference was 0.167 for GLSZM, and the lowest Spearman correlation was 0.900 for NGTDM. These results do not eliminate the integer-rounding approximation but quantify its effect and make the represented geometry auditable. Binning sensitivity analysis showed that voxel-spacing-aware differences persisted across binWidth values. Median relative differences versus native extraction ranged from 14.5% to 23.3%, with Spearman correlations ranging from 0.973 to 0.982. Validation component Evaluated data Main metric Result Upstream regression suite 3568 tests Passed tests 3568/3568 Default compatibility 75 features Mean/max absolute difference 0 / 0 Isotropic equivalence 75 features Mean/max absolute difference 0 / 0 Anisotropic activation 75 features Median relative difference 10.1–49.1% Rounding sensitivity Seven spacing ratios Representation error −20.0%-20.0\% to +14.3%+14.3\% Computational profiling Three volume sizes; R=1R=1–7 Maximum runtime / memory 1.74 s / 90.55 MB Resampling comparison 225 feature–phantom comparisons Changed comparisons 85.3–100% Binning sensitivity Four binWidth values Median relative difference 14.5–23.3% Table 2: Summary of synthetic software validation, finite-volume rounding, computational profiling, resampling comparisons, and discretization sensitivity. The principal software-validation results are summarized in Table 2. 4. Discussion The present work introduces a voxel-spacing-aware extension of PyRadiomics that incorporates physical voxel geometry into selected texture operations while preserving the discretized gray levels supplied to texture computation. Unlike isotropic resampling, which modifies both geometry and image intensities through interpolation, the proposed framework addresses anisotropy at the feature-extraction stage without generating interpolated gray levels. Synthetic validation demonstrated three key properties: exact backward compatibility with standard PyRadiomics when spacing-aware mode is disabled, exact equivalence under isotropic spacing and selective activation under anisotropic spacing. A central design decision was the use of relative anisotropy rather than absolute physical distance for angular weighting. Direct weighting by physical distance would alter descriptor behaviour even under isotropic spacing by systematically penalizing diagonal offsets. By weighting according to the ratio between physical and index-space distances, the proposed formulation remains equivalent to standard PyRadiomics under isotropic conditions while selectively accounting for anisotropy when physical and discrete spatial relationships diverge. The implementation highlights that spacing-aware radiomics requires feature-family-specific treatment. For GLCM, feature-level aggregation was adopted to preserve directional co-occurrence distributions and avoid altering non-linear Haralick descriptors through matrix averaging. NGTDM incorporates anisotropy-relative weighting directly into neighborhood averaging. For GLRLM, GLDM and GLSZM, the finite-volume representation preserves standard matrix semantics by keeping run length, dependence size and zone size as integer-valued axes, while allowing these quantities to be measured on an isotropic physical lattice rather than on anisotropic native voxels. The relationship with PyRadiomics reference behavior and IBSI should be considered separately. When weightingNorm="voxelSpacing" is disabled, the modified library uses the standard PyRadiomics execution paths. Backward compatibility was additionally assessed using the upstream PyRadiomics regression suite, for which 3568 tests passed in the evaluated development overlay, together with dedicated synthetic tests of isotropic equivalence. These tests demonstrate preservation of the reference PyRadiomics behavior covered by the existing test suite, but should not be interpreted as independent IBSI conformance testing. When weightingNorm="voxelSpacing" is enabled, spacing information is incorporated into selected texture operations and the resulting values represent methodological extensions rather than conventional IBSI reference values. For GLCM and NGTDM, the extension modifies angular feature aggregation or neighborhood averaging. For GLRLM, GLDM and GLSZM, standard matrix construction is applied after finite-volume zero-order-hold expansion rather than directly to the native index lattice. No independent IBSI benchmark extraction was performed for the voxel-spacing-aware mode, and the proposed outputs are therefore not claimed to be IBSI compliant or IBSI-equivalent. Dedicated anisotropic reference fixtures and independent IBSI benchmarking remain appropriate targets for future validation. Several limitations should be acknowledged. First, the finite-volume representation requires integer repeat factors. For non-integer spacing ratios, the represented spacing Δk∗=qkh _k^*=q_kh may differ from the acquired spacing Δk _k. Although this approximation was quantified and is reported through eke_k, it remains the principal mathematical limitation of the current implementation. Future approaches could consider rational approximations, direct physical traversal, or streaming matrix construction. Second, finite-volume expansion increases array size approximately in proportion to R=qzqyqxR=q_zq_yq_x. The implemented expansion-factor limit, expanded-shape calculation, logging, and warning thresholds provide safeguards against extreme finite-volume expansion, but larger clinical volumes and highly anisotropic multi-axis acquisitions may still require tiling or streaming implementations. The computational results reported here therefore support moderate-cost operation only within the tested volume sizes and expansion factors. However, because the current library-level safeguard is based on R rather than on the absolute expanded voxel count, memory requirements may still become substantial for large native volumes. A future implementation could additionally impose an explicit pre-allocation memory or expanded-voxel limit. Third, the present study used deterministic synthetic phantoms designed for software validation. It does not establish clinical superiority, test–retest reproducibility, or predictive performance. The clinical impact of the implementation has been evaluated separately in an independent application study [10]. Finally, the spacing-aware operations are opt-in methodological extensions and are not claimed to produce conventional IBSI reference values. Overall, the proposed framework provides a practical and backward-compatible strategy for incorporating physical voxel geometry into radiomic texture computation without generating interpolated gray levels. The implementation establishes a foundation for future investigations of spacing-aware radiomics in clinical and methodological settings. 5. Conclusion This work presents a voxel-spacing-aware extension of PyRadiomics that incorporates physical voxel geometry into selected texture operations while avoiding the generation of interpolated gray levels. Rather than relying exclusively on isotropic resampling, the proposed framework introduces feature-family-specific spacing-aware operations, including native-lattice weighting for GLCM and NGTDM and finite-volume zero-order-hold representation for GLRLM, GLDM and GLSZM. The implementation was integrated across the Python frontend, C wrapper layer and computational backend of PyRadiomics while maintaining full backward compatibility through an optional execution mode. GLCM was handled through feature-level angular aggregation, whereas GLRLM, GLDM and GLSZM were computed on a finite-volume zero-order-hold lattice. Synthetic validation demonstrated exact agreement with standard PyRadiomics when spacing-aware extraction was disabled and exact equivalence under isotropic voxel spacing. Under anisotropic conditions, spacing-aware computation produced selective feature-family activation consistent with the proposed mathematical formulation. These results establish a practical and extensible framework for incorporating voxel-spacing information into radiomic texture analysis and provide a foundation for future studies evaluating its impact on feature reproducibility, robustness and clinical modelling. Acknowledgments The authors thank the developers and contributors of the PyRadiomics project for providing an open-source framework that enabled the implementation and evaluation of the proposed methodology. Funding This research received no specific grant from any funding agency in the public, commercial, or not-for-profit sectors. Declaration of Competing Interest The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. Ethics Statement This study did not involve human participants, patient data, animal experiments, or clinical interventions. Validation was performed exclusively using synthetic imaging data generated for software verification purposes. Therefore, ethics committee approval and informed consent were not required. Data Availability The synthetic validation datasets and derived results generated during this study are available from the corresponding author upon reasonable request. Code Availability The voxel-spacing-aware modifications described in this work are being prepared for public release. The implementation is intended to be submitted as a contribution to the PyRadiomics project and will be made available through a public source-code repository following review and integration procedures. Source code may also be obtained from the corresponding author upon reasonable request. References [1] P. Lambin, E. Rios-Velazquez, R. Leijenaar, S. Carvalho, R. G. Van Stiphout, P. Granton, C. M. Zegers, R. Gillies, R. Boellard, A. Dekker, et al. (2012) Radiomics: extracting more information from medical images using advanced feature analysis. European journal of cancer 48 (4), p. 441–446. Cited by: §1. [2] H. J. Aerts, E. R. Velazquez, R. T. Leijenaar, C. Parmar, P. Grossmann, S. Carvalho, J. Bussink, R. Monshouwer, B. Haibe-Kains, D. Rietveld, et al. (2014) Decoding tumour phenotype by noninvasive imaging using a quantitative radiomics approach. Nature communications 5 (1), p. 4006. Cited by: §1. [3] M. E. Mayerhoefer, A. Materka, G. Langs, I. Häggström, P. Szczypiński, P. Gibbs, and G. Cook (2020) Introduction to radiomics. Journal of Nuclear Medicine 61 (4), p. 488–495. Cited by: §1. [4] A. Zwanenburg, M. Vallières, M. A. Abdalah, H. J. Aerts, V. Andrearczyk, A. Apte, S. Ashrafinia, S. Bakas, R. J. Beukinga, R. Boellaard, et al. (2020) The image biomarker standardization initiative: standardized quantitative radiomics for high-throughput image-based phenotyping. Radiology 295 (2), p. 328–338. External Links: Document Cited by: §1, §2.5.3. [5] M. L. Welch, C. McIntosh, B. Haibe-Kains, M. F. Milosevic, L. Wee, A. Dekker, S. H. Huang, T. G. Purdie, B. O’Sullivan, H. J. Aerts, et al. (2019) Vulnerabilities of radiomic signature development: the need for safeguards. Radiotherapy and Oncology 130, p. 2–9. Cited by: §1, §1. [6] J. J. Van Griethuysen, A. Fedorov, C. Parmar, A. Hosny, N. Aucoin, V. Narayan, R. G. Beets-Tan, J. Fillion-Robin, S. Pieper, and H. J. Aerts (2017) Computational radiomics system to decode the radiographic phenotype. Cancer research 77 (21), p. e104–e107. Cited by: §1, §2.4. [7] R. M. Haralick, K. Shanmugam, and I. H. Dinstein (1973) Textural features for image classification. IEEE Transactions on systems, man, and cybernetics (6), p. 610–621. Cited by: §1. [8] M. Shafiq-ul-Hassan, G. G. Zhang, K. Latifi, G. Ullah, D. C. Hunt, Y. Balagurunathan, M. A. Abdalah, M. B. Schabath, D. G. Goldgof, D. Mackin, et al. (2017) Intrinsic dependencies of ct radiomic features on voxel size and number of gray levels. Medical physics 44 (3), p. 1050–1062. Cited by: §1. [9] D. Mackin, X. Fave, L. Zhang, D. Fried, J. Yang, B. Taylor, E. Rodriguez-Rivera, C. Dodge, A. K. Jones, et al. (2015) Measuring computed tomography scanner variability of radiomics features. Investigative radiology 50 (11), p. 757–765. Cited by: §1. [10] D. Corral Fontecha, J. Miranda Bautista, P. Menéndez Fernández-Miranda, S. Rubio-Martín, L. Lloret Iglesias, and J. A. Vega (2026) Physically aware radiomics without interpolation: disentangling voxel geometry and signal modification in CT and MRI. arXiv preprint arXiv:2607.12399. External Links: Document Cited by: §1, §4. [11] M. M. Galloway (1975) Texture analysis using gray level run lengths. Computer graphics and image processing 4 (2), p. 172–179. Cited by: §2.5.2. [12] M. Amadasun and R. King (1989) Textural features corresponding to textural properties. IEEE Transactions on systems, man, and Cybernetics 19 (5), p. 1264–1274. Cited by: §2.5.3.