Radiomic Features¶
This section contains the definitions of the various features that can be extracted using PyRadiomics. They are subdivided into the following classes:
 First Order Features (19 features)
 Shape Features (16 features)
 Gray Level Cooccurrence Matrix (GLCM) Features (26 features)
 Gray Level Size Zone Matrix (GLSZM) Features (16 features)
 Gray Level Run Length Matrix (GLRLM) Features (16 features)
All feature classes, with the exception of shape can be calculated on either the original image and/or a derived image, obtained by applying one of several filters. The shape descriptors are independent of gray value, and are extracted from the label mask. If enabled, they are calculated separately of enabled input image types, and listed in the result as if calculated on the original image.
Most features defined below are in compliance with feature definitions as described by the Imaging Biomarker Standardization Initiative (IBSI), which are available in a separate document by Zwanenburg et al. (2016) [1]. Where features differ, a note has been added specifying the difference.
First Order Features¶

class
radiomics.firstorder.
RadiomicsFirstOrder
(inputImage, inputMask, **kwargs)[source]¶ Bases:
radiomics.base.RadiomicsFeaturesBase
Firstorder statistics describe the distribution of voxel intensities within the image region defined by the mask through commonly used and basic metrics.
Let:
 \(\textbf{X}\) be a set of \(N\) voxels included in the ROI
 \(\textbf{P}(i)\) be the first order histogram with \(N_l\) discrete intensity levels,
where \(N_l\) is the number of nonzero bins, equally spaced from 0 with a width defined in the
binWidth
parameter.  \(p(i)\) be the normalized first order histogram and equal to \(\frac{\textbf{P}(i)}{\sum{\textbf{P}(i)}}\)
Following additional settings are possible:
 voxelArrayShift [0]: Integer, This amount is added to the gray level intensity in features Energy, Total Energy and RMS, this is to prevent negative values. If using CT data, or data normalized with mean 0, consider setting this parameter to a fixed value (e.g. 2000) that ensures nonnegative numbers in the image. Bear in mind however, that the larger the value, the larger the volume confounding effect will be.
Note
In the IBSI feature definitions, no correction for negative gray values is implemented. To achieve similar behaviour in PyRadiomics, set
voxelArrayShift
to 0.
getEnergyFeatureValue
()[source]¶ 1. Energy
\[\textit{energy} = \displaystyle\sum^{N}_{i=1}{(\textbf{X}(i) + c)^2}\]Here, \(c\) is optional value, defined by
voxelArrayShift
, which shifts the intensities to prevent negative values in \(\textbf{X}\). This ensures that voxels with the lowest gray values contribute the least to Energy, instead of voxels with gray level intensity closest to 0.Energy is a measure of the magnitude of voxel values in an image. A larger values implies a greater sum of the squares of these values.
Note
This feature is volumeconfounded, a larger value of \(c\) increases the effect of volumeconfounding.

getTotalEnergyFeatureValue
()[source]¶ 2. Total Energy
\[\textit{total energy} = V_{voxel}\displaystyle\sum^{N}_{i=1}{(\textbf{X}(i) + c)^2}\]Here, \(c\) is optional value, defined by
voxelArrayShift
, which shifts the intensities to prevent negative values in \(\textbf{X}\). This ensures that voxels with the lowest gray values contribute the least to Energy, instead of voxels with gray level intensity closest to 0.Total Energy is the value of Energy feature scaled by the volume of the voxel in cubic mm.
Note
This feature is volumeconfounded, a larger value of \(c\) increases the effect of volumeconfounding.
Note
Not present in IBSI feature definitions

getEntropyFeatureValue
()[source]¶ 3. Entropy
\[\textit{entropy} = \displaystyle\sum^{N_l}_{i=1}{p(i)\log_2\big(p(i)+\epsilon\big)}\]Here, \(\epsilon\) is an arbitrarily small positive number (\(\approx 2.2\times10^{16}\)).
Entropy specifies the uncertainty/randomness in the image values. It measures the average amount of information required to encode the image values.
Note
Defined by IBSI as Intensity Histogram Entropy.

getMaximumFeatureValue
()[source]¶ 7. Maximum
\[\textit{maximum} = \max(\textbf{X})\]The maximum gray level intensity within the ROI.

getMeanFeatureValue
()[source]¶ 8. Mean
\[\textit{mean} = \frac{1}{N}\displaystyle\sum^{N}_{i=1}{\textbf{X}(i)}\]The average gray level intensity within the ROI.

getInterquartileRangeFeatureValue
()[source]¶ 10. Interquartile Range
\[\textit{interquartile range} = \textbf{P}_{75}  \textbf{P}_{25}\]Here \(\textbf{P}_{25}\) and \(\textbf{P}_{75}\) are the 25^{th} and 75^{th} percentile of the image array, respectively.

getRangeFeatureValue
()[source]¶ 11. Range
\[\textit{range} = \max(\textbf{X})  \min(\textbf{X})\]The range of gray values in the ROI.

getMeanAbsoluteDeviationFeatureValue
()[source]¶ 12. Mean Absolute Deviation (MAD)
\[\textit{MAD} = \frac{1}{N}\displaystyle\sum^{N}_{i=1}{\textbf{X}(i)\bar{X}}\]Mean Absolute Deviation is the mean distance of all intensity values from the Mean Value of the image array.

getRobustMeanAbsoluteDeviationFeatureValue
()[source]¶ 13. Robust Mean Absolute Deviation (rMAD)
\[\textit{rMAD} = \frac{1}{N_{1090}}\displaystyle\sum^{N_{1090}}_{i=1} {\textbf{X}_{1090}(i)\bar{X}_{1090}}\]Robust Mean Absolute Deviation is the mean distance of all intensity values from the Mean Value calculated on the subset of image array with gray levels in between, or equal to the 10^{th} and 90^{th} percentile.

getRootMeanSquaredFeatureValue
()[source]¶ 14. Root Mean Squared (RMS)
\[\textit{RMS} = \sqrt{\frac{1}{N}\sum^{N}_{i=1}{(\textbf{X}(i) + c)^2}}\]Here, \(c\) is optional value, defined by
voxelArrayShift
, which shifts the intensities to prevent negative values in \(\textbf{X}\). This ensures that voxels with the lowest gray values contribute the least to RMS, instead of voxels with gray level intensity closest to 0.RMS is the squareroot of the mean of all the squared intensity values. It is another measure of the magnitude of the image values. This feature is volumeconfounded, a larger value of \(c\) increases the effect of volumeconfounding.

getStandardDeviationFeatureValue
()[source]¶ 15. Standard Deviation
\[\textit{standard deviation} = \sqrt{\frac{1}{N}\sum^{N}_{i=1}{(\textbf{X}(i)\bar{X})^2}}\]Standard Deviation measures the amount of variation or dispersion from the Mean Value. By definition, :math:textit{standard deviation} = sqrt{textit{variance}}
Note
Not present in IBSI feature definitions (correlated with variance)

getSkewnessFeatureValue
(axis=0)[source]¶ 16. Skewness
\[\textit{skewness} = \displaystyle\frac{\mu_3}{\sigma^3} = \frac{\frac{1}{N}\sum^{N}_{i=1}{(\textbf{X}(i)\bar{X})^3}} {\left(\sqrt{\frac{1}{N}\sum^{N}_{i=1}{(\textbf{X}(i)\bar{X})^2}}\right)^3}\]Where \(\mu_3\) is the 3^{rd} central moment.
Skewness measures the asymmetry of the distribution of values about the Mean value. Depending on where the tail is elongated and the mass of the distribution is concentrated, this value can be positive or negative.
Related links:
https://en.wikipedia.org/wiki/Skewness
Note
In case of a flat region, the standard deviation and 4^{rd} central moment will be both 0. In this case, a value of 0 is returned.

getKurtosisFeatureValue
(axis=0)[source]¶ 17. Kurtosis
\[\textit{kurtosis} = \displaystyle\frac{\mu_4}{\sigma^4} = \frac{\frac{1}{N}\sum^{N}_{i=1}{(\textbf{X}(i)\bar{X})^4}} {\left(\frac{1}{N}\sum^{N}_{i=1}{(\textbf{X}(i)\bar{X}})^2\right)^2}\]Where \(\mu_4\) is the 4^{th} central moment.
Kurtosis is a measure of the ‘peakedness’ of the distribution of values in the image ROI. A higher kurtosis implies that the mass of the distribution is concentrated towards the tail(s) rather than towards the mean. A lower kurtosis implies the reverse: that the mass of the distribution is concentrated towards a spike near the Mean value.
Related links:
https://en.wikipedia.org/wiki/Kurtosis
Note
In case of a flat region, the standard deviation and 4^{rd} central moment will be both 0. In this case, a value of 0 is returned.
Note
The IBSI feature definition implements excess kurtosis, where kurtosis is corrected by 3, yielding 0 for normal distributions. The PyRadiomics kurtosis is not corrected, yielding a value 3 higher than the IBSI kurtosis.

getVarianceFeatureValue
()[source]¶ 18. Variance
\[\textit{variance} = \frac{1}{N}\displaystyle\sum^{N}_{i=1}{(\textbf{X}(i)\bar{X})^2}\]Variance is the the mean of the squared distances of each intensity value from the Mean value. This is a measure of the spread of the distribution about the mean. By definition, \(\textit{variance} = \sigma^2\)

getUniformityFeatureValue
()[source]¶ 19. Uniformity
\[\textit{uniformity} = \displaystyle\sum^{N_l}_{i=1}{p(i)^2}\]Uniformity is a measure of the sum of the squares of each intensity value. This is a measure of the heterogeneity of the image array, where a greater uniformity implies a greater heterogeneity or a greater range of discrete intensity values.
Note
Defined by IBSI as Intensity Histogram Uniformity.
Shape Features¶

class
radiomics.shape.
RadiomicsShape
(inputImage, inputMask, **kwargs)[source]¶ Bases:
radiomics.base.RadiomicsFeaturesBase
In this group of features we included descriptors of the threedimensional size and shape of the ROI. These features are independent from the gray level intensity distribution in the ROI and are therefore only calculated on the nonderived image and mask.
Let:
 \(V\) the volume of the ROI in mm^{3}
 \(A\) the surface area of the ROI in mm^{2}

getVolumeFeatureValue
()[source]¶ 1. Volume
\[V = \displaystyle\sum^{N}_{i=1}{V_i}\]The volume of the ROI \(V\) is approximated by multiplying the number of voxels in the ROI by the volume of a single voxel \(V_i\).
Note
In the IBSI feature definitions, a more precise approximation of the volume is used. That method uses tetrahedrons consisting of the origin and faces in the ROI. Although the method implemented here overestimates the volume, especially in small volumes, the difference will be negligible in large ROIs.

getSurfaceAreaFeatureValue
()[source]¶ 2. Surface Area
\[A = \displaystyle\sum^{N}_{i=1}{\frac{1}{2}\text{a}_i\text{b}_i \times \text{a}_i\text{c}_i}\]Where:
\(N\) is the number of triangles forming the surface mesh of the volume (ROI)
\(\text{a}_i\text{b}_i\) and \(\text{a}_i\text{c}_i\) are the edges of the \(i^{\text{th}}\) triangle formed by points \(\text{a}_i\), \(\text{b}_i\) and \(\text{c}_i\)
Surface Area is an approximation of the surface of the ROI in mm2, calculated using a marching cubes algorithm.
References:
 Lorensen WE, Cline HE. Marching cubes: A high resolution 3D surface construction algorithm. ACM SIGGRAPH Comput Graph Internet. 1987;21:1639.

getSurfaceVolumeRatioFeatureValue
()[source]¶ 3. Surface Area to Volume ratio
\[\textit{surface to volume ratio} = \frac{A}{V}\]Here, a lower value indicates a more compact (spherelike) shape. This feature is not dimensionless, and is therefore (partly) dependent on the volume of the ROI.

getSphericityFeatureValue
()[source]¶ 4. Sphericity
\[\textit{sphericity} = \frac{\sqrt[3]{36 \pi V^2}}{A}\]Sphericity is a measure of the roundness of the shape of the tumor region relative to a sphere. It is a dimensionless measure, independent of scale and orientation. The value range is \(0 < sphericity \leq 1\), where a value of 1 indicates a perfect sphere (a sphere has the smallest possible surface area for a given volume, compared to other solids).
Note
This feature is correlated to Compactness 1, Compactness 2 and Spherical Disproportion. In the default parameter file provided in the
pyradiomics/examples/exampleSettings
folder, Compactness 1 and Compactness 2 are therefore disabled.

getCompactness1FeatureValue
()[source]¶ 5. Compactness 1
\[\textit{compactness 1} = \frac{V}{\sqrt{\pi A^3}}\]Similar to Sphericity, Compactness 1 is a measure of how compact the shape of the tumor is relative to a sphere (most compact). It is therefore correlated to Sphericity and redundant. It is provided here for completeness. The value range is \(0 < compactness\ 1 \leq \frac{1}{6 \pi}\), where a value of \(\frac{1}{6 \pi}\) indicates a perfect sphere.
By definition, \(compactness\ 1 = \frac{1}{6 \pi}\sqrt{compactness\ 2} = \frac{1}{6 \pi}\sqrt{sphericity^3}\).
Note
This feature is correlated to Compactness 2, Sphericity and Spherical Disproportion. In the default parameter file provided in the
pyradiomics/examples/exampleSettings
folder, Compactness 1 and Compactness 2 are therefore disabled.

getCompactness2FeatureValue
()[source]¶ 6. Compactness 2
\[\textit{compactness 2} = 36 \pi \frac{V^2}{A^3}\]Similar to Sphericity and Compactness 1, Compactness 2 is a measure of how compact the shape of the tumor is relative to a sphere (most compact). It is a dimensionless measure, independent of scale and orientation. The value range is \(0 < compactness\ 2 \leq 1\), where a value of 1 indicates a perfect sphere.
By definition, \(compactness\ 2 = (sphericity)^3\)
Note
This feature is correlated to Compactness 1, Sphericity and Spherical Disproportion. In the default parameter file provided in the
pyradiomics/examples/exampleSettings
folder, Compactness 1 and Compactness 2 are therefore disabled.

getSphericalDisproportionFeatureValue
()[source]¶ 7. Spherical Disproportion
\[\textit{spherical disproportion} = \frac{A}{4\pi R^2} = \frac{A}{\sqrt[3]{36 \pi V^2}}\]Where \(R\) is the radius of a sphere with the same volume as the tumor, and equal to \(\sqrt[3]{\frac{3V}{4\pi}}\).
Spherical Disproportion is the ratio of the surface area of the tumor region to the surface area of a sphere with the same volume as the tumor region, and by definition, the inverse of Sphericity. Therefore, the value range is \(spherical\ disproportion \geq 1\), with a value of 1 indicating a perfect sphere.
Note
This feature is correlated to Compactness 1, Compactness 2 and Sphericity. In the default parameter file provided in the
pyradiomics/examples/exampleSettings
folder, Compactness 1 and Compactness 2 are therefore disabled.

getMaximum3DDiameterFeatureValue
()[source]¶ 8. Maximum 3D diameter
Maximum 3D diameter is defined as the largest pairwise Euclidean distance between surface voxels in the ROI.
Also known as Feret Diameter.
Warning
This feature is only available when C Extensions are enabled

getMaximum2DDiameterSliceFeatureValue
()[source]¶ 9. Maximum 2D diameter (Slice)
Maximum 2D diameter (Slice) is defined as the largest pairwise Euclidean distance between tumor surface voxels in the rowcolumn (generally the axial) plane.
Warning
This feature is only available when C Extensions are enabled

getMaximum2DDiameterColumnFeatureValue
()[source]¶ 10. Maximum 2D diameter (Column)
Maximum 2D diameter (Column) is defined as the largest pairwise Euclidean distance between tumor surface voxels in the rowslice (usually the coronal) plane.
Warning
This feature is only available when C Extensions are enabled

getMaximum2DDiameterRowFeatureValue
()[source]¶ 11. Maximum 2D diameter (Row)
Maximum 2D diameter (Row) is defined as the largest pairwise Euclidean distance between tumor surface voxels in the columnslice (usually the sagittal) plane.
Warning
This feature is only available when C Extensions are enabled

getMajorAxisFeatureValue
()[source]¶ 12. Major Axis
\[\textit{major axis} = 4 \sqrt{\lambda_{\text{major}}}\]

getMinorAxisFeatureValue
()[source]¶ 13. Minor Axis
\[\textit{minor axis} = 4 \sqrt{\lambda_{\text{minor}}}\]

getLeastAxisFeatureValue
()[source]¶ 14. Least Axis
\[\textit{least axis} = 4 \sqrt{\lambda_{\text{least}}}\]

getElongationFeatureValue
()[source]¶ 15. Elongation
Elongation is calculated using its implementation in SimpleITK, and is defined as:
\[\textit{elongation} = \sqrt{\frac{\lambda_{\text{minor}}}{\lambda_{\text{major}}}}\]Here, \(\lambda_{\text{major}}\) and \(\lambda_{\text{minor}}\) are the lengths of the largest and second largest principal component axes. The values range between 1 (where the cross section through the first and second largest principal moments is circlelike (nonelongated)) and 0 (where the object is a single point or 1 dimensional line).

getFlatnessFeatureValue
()[source]¶ 16. Flatness
Flatness is calculated using its implementation in SimpleITK, and is defined as:
\[\textit{flatness} = \sqrt{\frac{\lambda_{\text{least}}}{\lambda_{\text{major}}}}\]Here, \(\lambda_{\text{major}}\) and \(\lambda_{\text{least}}\) are the lengths of the largest and smallest principal component axes. The values range between 1 (nonflat, spherelike) and 0 (a flat object).
Gray Level Cooccurrence Matrix (GLCM) Features¶

class
radiomics.glcm.
RadiomicsGLCM
(inputImage, inputMask, **kwargs)[source]¶ Bases:
radiomics.base.RadiomicsFeaturesBase
A Gray Level Cooccurrence Matrix (GLCM) of size \(N_g \times N_g\) describes the secondorder joint probability function of an image region constrained by the mask and is defined as \(\textbf{P}(i,j\delta,\alpha)\). The \((i,j)^{\text{th}}\) element of this matrix represents the number of times the combination of levels \(i\) and \(j\) occur in two pixels in the image, that are separated by a distance of \(\delta\) pixels along angle \(\alpha\). The distance \(\delta\) from the center voxel is defined as the distance according to the infinity norm. For \(\delta=1\), this results in 2 neighbors for each of 13 angles in 3D (26connectivity) and for \(\delta=2\) a 98connectivity (49 unique angles).
Note that pyradiomics by default computes symmetrical GLCM!
As a two dimensional example, let the following matrix \(\textbf{I}\) represent a 5x5 image, having 5 discrete grey levels:
\[\begin{split}\textbf{I} = \begin{bmatrix} 1 & 2 & 5 & 2 & 3\\ 3 & 2 & 1 & 3 & 1\\ 1 & 3 & 5 & 5 & 2\\ 1 & 1 & 1 & 1 & 2\\ 1 & 2 & 4 & 3 & 5 \end{bmatrix}\end{split}\]For distance \(\delta = 1\) (considering pixels with a distance of 1 pixel from each other) and angle \(\alpha=0^\circ\) (horizontal plane, i.e. voxels to the left and right of the center voxel), the following symmetrical GLCM is obtained:
\[\begin{split}\textbf{P} = \begin{bmatrix} 6 & 4 & 3 & 0 & 0\\ 4 & 0 & 2 & 1 & 3\\ 3 & 2 & 0 & 1 & 2\\ 0 & 1 & 1 & 0 & 0\\ 0 & 3 & 2 & 0 & 2 \end{bmatrix}\end{split}\]Let:
 \(\epsilon\) be an arbitrarily small positive number (\(\approx 2.2\times10^{16}\))
 \(\textbf{P}(i,j)\) be the cooccurence matrix for an arbitrary \(\delta\) and \(\alpha\)
 \(p(i,j)\) be the normalized cooccurence matrix and equal to \(\frac{\textbf{P}(i,j)}{\sum{\textbf{P}(i,j)}}\)
 \(N_g\) be the number of discrete intensity levels in the image
 \(p_x(i) = \sum^{N_g}_{j=1}{P(i,j)}\) be the marginal row probabilities
 \(p_y(j) = \sum^{N_g}_{i=1}{P(i,j)}\) be the marginal column probabilities
 \(\mu_x\) be the mean gray level intensity of \(p_x\) and defined as \(\mu_x = \displaystyle\sum^{N_g}_{i=1}{p_x(i)i}\)
 \(\mu_y\) be the mean gray level intensity of \(p_y\) and defined as \(\mu_y = \displaystyle\sum^{N_g}_{j=1}{p_y(j)j}\)
 \(\sigma_x\) be the standard deviation of \(p_x\)
 \(\sigma_y\) be the standard deviation of \(p_y\)
 \(p_{x+y}(k) = \sum^{N_g}_{i=1}\sum^{N_g}_{j=1}{p(i,j)},\text{ where }i+j=k,\text{ and }k=2,3,\dots,2N_g\)
 \(p_{xy}(k) = \sum^{N_g}_{i=1}\sum^{N_g}_{j=1}{p(i,j)},\text{ where }ij=k,\text{ and }k=0,1,\dots,N_g1\)
 \(HX = \sum^{N_g}_{i=1}{p_x(i)\log_2\big(p_x(i)+\epsilon\big)}\) be the entropy of \(p_x\)
 \(HY = \sum^{N_g}_{j=1}{p_y(j)\log_2\big(p_y(j)+\epsilon\big)}\) be the entropy of \(p_y\)
 \(HXY = \sum^{N_g}_{i=1}\sum^{N_g}_{j=1}{p(i,j)\log_2\big(p(i,j)+\epsilon\big)}\) be the entropy of \(p(i,j)\)
 \(HXY1 = \sum^{N_g}_{i=1}\sum^{N_g}_{j=1}{p(i,j)\log_2\big(p_x(i)p_y(j)+\epsilon\big)}\)
 \(HXY2 = \sum^{N_g}_{i=1}\sum^{N_g}_{j=1}{p_x(i)p_y(j)\log_2\big(p_x(i)p_y(j)+\epsilon\big)}\)
By default, the value of a feature is calculated on the GLCM for each angle separately, after which the mean of these values is returned. If distance weighting is enabled, GLCM matrices are weighted by weighting factor W and then summed and normalised. Features are then calculated on the resultant matrix. Weighting factor W is calculated for the distance between neighbouring voxels by:
\(W = e^{\d\^2}\), where d is the distance for the associated angle according to the norm specified in setting ‘weightingNorm’.
The following class specific settings are possible:
symmetricalGLCM [True]: boolean, indicates whether cooccurrences should be assessed in two directions per angle, which results in a symmetrical matrix, with equal distributions for \(i\) and \(j\). A symmetrical matrix corresponds to the GLCM as defined by Haralick et al.
weightingNorm [None]: string, indicates which norm should be used when applying distance weighting. Enumerated setting, possible values:
 ‘manhattan’: first order norm
 ‘euclidean’: second order norm
 ‘infinity’: infinity norm.
 ‘no_weighting’: GLCMs are weighted by factor 1 and summed
 None: Applies no weighting, mean of values calculated on separate matrices is returned.
In case of other values, an warning is logged and option ‘no_weighting’ is used.
References
 Haralick, R., Shanmugan, K., Dinstein, I; Textural features for image classification; IEEE Transactions on Systems, Man and Cybernetics; 1973(3), p610621
 https://en.wikipedia.org/wiki/Cooccurrence_matrix
 http://www.fp.ucalgary.ca/mhallbey/the_glcm.htm

getAutocorrelationFeatureValue
()[source]¶ 1. Autocorrelation
\[\textit{autocorrelation} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{p(i,j)ij}\]Autocorrelation is a measure of the magnitude of the fineness and coarseness of texture.

getJointAverageFeatureValue
()[source]¶ 2. Joint Average
\[\textit{joint average} = \mu_x = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{p(i,j)i}\]Returns the mean gray level intensity of the \(i\) distribution.
Warning
As this formula represents the average of the distribution of \(i\), it is independent from the distribution of \(j\). Therefore, only use this formula if the GLCM is symmetrical, where \(p_x(i) = p_y(j) \text{, where } i = j\).

getClusterProminenceFeatureValue
()[source]¶ 3. Cluster Prominence
\[\textit{cluster prominence} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1} {\big( i+j\mu_x\mu_y\big)^4p(i,j)}\]Cluster Prominence is a measure of the skewness and asymmetry of the GLCM. A higher values implies more asymmetry about the mean while a lower value indicates a peak near the mean value and less variation about the mean.

getClusterShadeFeatureValue
()[source]¶ 4. Cluster Shade
\[\textit{cluster shade} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1} {\big(i+j\mu_x\mu_y\big)^3p(i,j)}\]Cluster Shade is a measure of the skewness and uniformity of the GLCM. A higher cluster shade implies greater asymmetry about the mean.

getClusterTendencyFeatureValue
()[source]¶ 5. Cluster Tendency
\[\textit{cluster tendency} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1} {\big(i+j\mu_x\mu_y\big)^2p(i,j)}\]Cluster Tendency is a measure of groupings of voxels with similar graylevel values.
Note
Cluster Tendency is mathematically identical to Sum Variance, the latter has therefore been removed from PyRadiomics. See here for the proof.

getContrastFeatureValue
()[source]¶ 6. Contrast
\[\textit{contrast} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{(ij)^2p(i,j)}\]Contrast is a measure of the local intensity variation, favoring values away from the diagonal \((i = j)\). A larger value correlates with a greater disparity in intensity values among neighboring voxels.

getCorrelationFeatureValue
()[source]¶ 7. Correlation
\[\textit{correlation} = \frac{\sum^{N_g}_{i=1}\sum^{N_g}_{j=1}{p(i,j)ij\mu_x\mu_y}}{\sigma_x(i)\sigma_y(j)}\]Correlation is a value between 0 (uncorrelated) and 1 (perfectly correlated) showing the linear dependency of gray level values to their respective voxels in the GLCM.
Note
When there is only 1 discreet gray value in the ROI (flat region), \(\sigma_x\) and \(\sigma_y\) will be 0. In this case, an arbitrary value of 1 is returned instead. This is assessed on a perangle basis.

getDifferenceAverageFeatureValue
()[source]¶ 8. Difference Average
\[\textit{difference average} = \displaystyle\sum^{N_g1}_{k=0}{kp_{xy}(k)}\]Difference Average measures the relationship between occurrences of pairs with similar intensity values and occurrences of pairs with differing intensity values.

getDifferenceEntropyFeatureValue
()[source]¶ 9. Difference Entropy
\[\textit{difference entropy} = \displaystyle\sum^{N_g1}_{k=0}{p_{xy}(k)\log_2\big(p_{xy}(k)+\epsilon\big)}\]Difference Entropy is a measure of the randomness/variability in neighborhood intensity value differences.

getDifferenceVarianceFeatureValue
()[source]¶ 10. Difference Variance
\[\textit{difference variance} = \displaystyle\sum^{N_g1}_{k=0}{(kDA)^2p_{xy}(k)}\]Difference Variance is a measure of heterogeneity that places higher weights on differing intensity level pairs that deviate more from the mean.

getDissimilarityFeatureValue
()[source]¶ 11. Dissimilarity
\[\textit{dissimilarity} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{ijp(i,j)}\]Dissimilarity is a measure of local intensity variation defined as the mean absolute difference between the neighbouring pairs. A larger value correlates with a greater disparity in intensity values among neighboring voxels.

getJointEnergyFeatureValue
()[source]¶ 12. Joint Energy
\[\textit{joint energy} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{\big(p(i,j)\big)^2}\]Energy is a measure of homogeneous patterns in the image. A greater Energy implies that there are more instances of intensity value pairs in the image that neighbor each other at higher frequencies.
Note
Defined by IBSI as Angular Second Moment.

getJointEntropyFeatureValue
()[source]¶ 13. Joint Entropy
\[\textit{joint entropy} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1} {p(i,j)\log_2\big(p(i,j)+\epsilon\big)}\]Entropy is a measure of the randomness/variability in neighborhood intensity values.
Note
Defined by IBSI as Joint entropy

getHomogeneity1FeatureValue
()[source]¶ 14. Homogeneity 1
\[\textit{homogeneity 1} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{\frac{p(i,j)}{1+ij}}\]Homogeneity 1 is a measure of the similarity in intensity values for neighboring voxels. It is a measure of local homogeneity that increases with less contrast in the window.
Note
Not present in IBSI feature definitions

getHomogeneity2FeatureValue
()[source]¶ 15. Homogeneity 2
\[\textit{homogeneity 2} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{\frac{p(i,j)}{1+ij^2}}\]Homogeneity 2 is a measure of the similarity in intensity values for neighboring voxels.
Note
Not present in IBSI feature definitions

getImc1FeatureValue
()[source]¶ 16. Informal Measure of Correlation (IMC) 1
\[\textit{IMC 1} = \frac{HXYHXY1}{\max\{HX,HY\}}\]Note
In the case where both HX and HY are 0 (as is the case in a flat region), an arbitrary value of 0 is returned to prevent a division by 0. This is done on a perangle basis

getImc2FeatureValue
()[source]¶ 17. Informal Measure of Correlation (IMC) 2
\[\textit{IMC 2} = \sqrt{1e^{2(HXY2HXY)}}\]Note
In the case where HXY = HXY2, an arbitrary value of 0 is returned to prevent returning complex numbers. This is done on a perangle basis.

getIdmFeatureValue
()[source]¶ 18. Inverse Difference Moment (IDM)
\[\textit{IDM} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{ \frac{p(i,j)}{1+ij^2} }\]IDM (inverse difference moment) is a measure of the local homogeneity of an image. IDM weights are the inverse of the Contrast weights (decreasing exponentially from the diagonal i=j in the GLCM).

getIdmnFeatureValue
()[source]¶ 19. Inverse Difference Moment Normalized (IDMN)
\[\textit{IDMN} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1} { \frac{p(i,j)}{1+\left(\frac{ij^2}{N_g^2}\right)} }\]IDMN (inverse difference moment normalized) is a measure of the local homogeneity of an image. IDMN weights are the inverse of the Contrast weights (decreasing exponentially from the diagonal \(i=j\) in the GLCM). Unlike Homogeneity2, IDMN normalizes the square of the difference between neighboring intensity values by dividing over the square of the total number of discrete intensity values.

getIdFeatureValue
()[source]¶ 20. Inverse Difference (ID)
\[\textit{ID} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{ \frac{p(i,j)}{1+ij} }\]ID (inverse difference) is another measure of the local homogeneity of an image. With more uniform gray levels, the denominator will remain low, resulting in a higher overall value.

getIdnFeatureValue
()[source]¶ 21. Inverse Difference Normalized (IDN)
\[\textit{IDN} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1} { \frac{p(i,j)}{1+\left(\frac{ij}{N_g}\right)} }\]IDN (inverse difference normalized) is another measure of the local homogeneity of an image. Unlike Homogeneity1, IDN normalizes the difference between the neighboring intensity values by dividing over the total number of discrete intensity values.

getInverseVarianceFeatureValue
()[source]¶ 22. Inverse Variance
\[\textit{inverse variance} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{\frac{p(i,j)}{ij^2}}, i \neq j\]

getMaximumProbabilityFeatureValue
()[source]¶ 23. Maximum Probability
\[\textit{maximum probability} = \max\big(p(i,j)\big)\]Maximum Probability is occurrences of the most predominant pair of neighboring intensity values.
Note
Defined by IBSI as Joint maximum

getSumAverageFeatureValue
()[source]¶ 24. Sum Average
\[\textit{sum average} = \displaystyle\sum^{2N_g}_{k=2}{p_{x+y}(k)k}\]Sum Average measures the relationship between occurrences of pairs with lower intensity values and occurrences of pairs with higher intensity values.
Warning
When GLCM is symmetrical, \(\mu_x = \mu_y\), and therefore \(\text{Sum Average} = \mu_x + \mu_y = 2 \mu_x = 2 * Joint Average\). See formulas (4.), (5.) and (6.) defined here for the proof that \(\text{Sum Average} = \mu_x + \mu_y\). In the default parameter files provided in the
examples/exampleSettings
, this feature has been disabled.

getSumEntropyFeatureValue
()[source]¶ 25. Sum Entropy
\[\textit{sum entropy} = \displaystyle\sum^{2N_g}_{k=2}{p_{x+y}(k)\log_2\big(p_{x+y}(k)+\epsilon\big)}\]Sum Entropy is a sum of neighborhood intensity value differences.

getSumSquaresFeatureValue
()[source]¶ 26. Sum of Squares
\[\textit{sum squares} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{(i\mu_x)^2p(i,j)}\]Sum of Squares or Variance is a measure in the distribution of neigboring intensity level pairs about the mean intensity level in the GLCM.
Warning
This formula represents the variance of the distribution of \(i\) and is independent from the distribution of \(j\). Therefore, only use this formula if the GLCM is symmetrical, where \(p_x(i) = p_y(j) \text{, where } i = j\)
Note
Defined by IBSI as Joint Variance
Gray Level Size Zone Matrix (GLSZM) Features¶

class
radiomics.glszm.
RadiomicsGLSZM
(inputImage, inputMask, **kwargs)[source]¶ Bases:
radiomics.base.RadiomicsFeaturesBase
A Gray Level Size Zone (GLSZM) quantifies gray level zones in an image. A gray level zone is defined as a the number of connected voxels that share the same gray level intensity. A voxel is considered connected if the distance is 1 according to the infinity norm (26connected region in a 3D, 8connected region in 2D). In a gray level size zone matrix \(P(i,j)\) the \((i,j)^{\text{th}}\) element equals the number of zones with gray level \(i\) and size \(j\) appear in image. Contrary to GLCM and GLRLM, the GLSZM is rotation independent, with only one matrix calculated for all directions in the ROI.
As a two dimensional example, consider the following 5x5 image, with 5 discrete gray levels:
\[\begin{split}\textbf{I} = \begin{bmatrix} 5 & 2 & 5 & 4 & 4\\ 3 & 3 & 3 & 1 & 3\\ 2 & 1 & 1 & 1 & 3\\ 4 & 2 & 2 & 2 & 3\\ 3 & 5 & 3 & 3 & 2 \end{bmatrix}\end{split}\]The GLSZM then becomes:
\[\begin{split}\textbf{P} = \begin{bmatrix} 0 & 0 & 0 & 1 & 0\\ 1 & 0 & 0 & 0 & 1\\ 1 & 0 & 1 & 0 & 1\\ 1 & 1 & 0 & 0 & 0\\ 3 & 0 & 0 & 0 & 0 \end{bmatrix}\end{split}\]Let:
 \(\textbf{P}(i,j)\) be the size zone matrix
 \(p(i,j)\) be the normalized size zone matrix, defined as \(p(i,j) = \frac{\textbf{P}(i,j)}{\sum{\textbf{P}(i,j)}}\)
 \(N_g\) be the number of discreet intensity values in the image
 \(N_s\) be the number of discreet zone sizes in the image
 \(N_p\) be the number of voxels in the image
Note
The mathematical formulas that define the GLSZM features correspond to the definitions of features extracted from the GLRLM.
References
 Guillaume Thibault; Bernard Fertil; Claire Navarro; Sandrine Pereira; Pierre Cau; Nicolas Levy; Jean Sequeira; JeanLuc Mari (2009). “Texture Indexes and Gray Level Size Zone Matrix. Application to Cell Nuclei Classification”. Pattern Recognition and Information Processing (PRIP): 140145.
 https://en.wikipedia.org/wiki/Gray_level_size_zone_matrix

getSmallAreaEmphasisFeatureValue
()[source]¶ 1. Small Area Emphasis (SAE)
\[\textit{SAE} = \frac{\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\frac{\textbf{P}(i,j)}{j^2}}} {\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\textbf{P}(i,j)}}\]SAE is a measure of the distribution of small size zones, with a greater value indicative of more smaller size zones and more fine textures.

getLargeAreaEmphasisFeatureValue
()[source]¶ 2. Large Area Emphasis (LAE)
\[\textit{LAE} = \frac{\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\textbf{P}(i,j)j^2}} {\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\textbf{P}(i,j)}}\]LAE is a measure of the distribution of large area size zones, with a greater value indicative of more larger size zones and more coarse textures.

getGrayLevelNonUniformityFeatureValue
()[source]¶ 3. Gray Level NonUniformity (GLN)
\[\textit{GLN} = \frac{\sum^{N_g}_{i=1}\left(\sum^{N_s}_{j=1}{\textbf{P}(i,j)}\right)^2} {\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\textbf{P}(i,j)}}\]GLN measures the variability of graylevel intensity values in the image, with a lower value indicating more homogeneity in intensity values.

getGrayLevelNonUniformityNormalizedFeatureValue
()[source]¶ 4. Gray Level NonUniformity Normalized (GLNN)
\[\textit{GLNN} = \frac{\sum^{N_g}_{i=1}\left(\sum^{N_s}_{j=1}{\textbf{P}(i,j)}\right)^2} {\sum^{N_g}_{i=1}\sum^{N_d}_{j=1}{\textbf{P}(i,j)}^2}\]GLNN measures the variability of graylevel intensity values in the image, with a lower value indicating a greater similarity in intensity values. This is the normalized version of the GLN formula.

getSizeZoneNonUniformityFeatureValue
()[source]¶ 5. SizeZone NonUniformity (SZN)
\[\textit{SZN} = \frac{\sum^{N_s}_{j=1}\left(\sum^{N_g}_{i=1}{\textbf{P}(i,j)}\right)^2} {\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\textbf{P}(i,j)}}\]SZN measures the variability of size zone volumes in the image, with a lower value indicating more homogeneity in size zone volumes.

getSizeZoneNonUniformityNormalizedFeatureValue
()[source]¶ 6. SizeZone NonUniformity Normalized (SZNN)
\[\textit{SZNN} = \frac{\sum^{N_s}_{j=1}\left(\sum^{N_g}_{i=1}{\textbf{P}(i,j)}\right)^2} {\sum^{N_g}_{i=1}\sum^{N_d}_{j=1}{\textbf{P}(i,j)}^2}\]SZNN measures the variability of size zone volumes throughout the image, with a lower value indicating more homogeneity among zone size volumes in the image. This is the normalized version of the SZN formula.

getZonePercentageFeatureValue
()[source]¶ 7. Zone Percentage (ZP)
\[\textit{ZP} = \sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\frac{\textbf{P}(i,j)}{N_p}}\]ZP measures the coarseness of the texture by taking the ratio of number of zones and number of voxels in the ROI.
Values are in range \(\frac{1}{N_p} \leq ZP \leq 1\), with higher values indicating a larger portion of the ROI consists of small zones (indicates a more fine texture).

getGrayLevelVarianceFeatureValue
()[source]¶ 8. Gray Level Variance (GLV)
\[\textit{GLV} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_s}_{j=1}{p(i,j)(i  \mu)^2}\]Here, \(\mu = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_s}_{j=1}{p(i,j)i}\)
GLV measures the variance in gray level intensities for the zones.

getZoneVarianceFeatureValue
()[source]¶ 9. Zone Variance (ZV)
\[\textit{ZV} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_s}_{j=1}{p(i,j)(j  \mu)^2}\]Here, \(\mu = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_s}_{j=1}{p(i,j)j}\)
ZV measures the variance in zone size volumes for the zones.

getZoneEntropyFeatureValue
()[source]¶ 10. Zone Entropy (ZE)
\[\textit{ZE} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_s}_{j=1}{p(i,j)\log_{2}(p(i,j)+\epsilon)}\]Here, \(\epsilon\) is an arbitrarily small positive number (\(\approx 2.2\times10^{16}\)).
ZE measures the uncertainty/randomness in the distribution of zone sizes and gray levels. A higher value indicates more heterogeneneity in the texture patterns.

getLowGrayLevelZoneEmphasisFeatureValue
()[source]¶ 11. Low Gray Level Zone Emphasis (LGLZE)
\[\textit{LGLZE} = \frac{\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\frac{\textbf{P}(i,j)}{i^2}}} {\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\textbf{P}(i,j)}}\]LGLZE measures the distribution of lower graylevel size zones, with a higher value indicating a greater proportion of lower graylevel values and size zones in the image.

getHighGrayLevelZoneEmphasisFeatureValue
()[source]¶ 12. High Gray Level Zone Emphasis (HGLZE)
\[\textit{HGLZE} = \frac{\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\textbf{P}(i,j)i^2}} {\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\textbf{P}(i,j)}}\]HGLZE measures the distribution of the higher graylevel values, with a higher value indicating a greater proportion of higher graylevel values and size zones in the image.

getSmallAreaLowGrayLevelEmphasisFeatureValue
()[source]¶ 13. Small Area Low Gray Level Emphasis (SALGLE)
\[\textit{SALGLE} = \frac{\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\frac{\textbf{P}(i,j)}{i^2j^2}}} {\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\textbf{P}(i,j)}}\]SALGLE measures the proportion in the image of the joint distribution of smaller size zones with lower graylevel values.

getSmallAreaHighGrayLevelEmphasisFeatureValue
()[source]¶ 14. Small Area High Gray Level Emphasis (SAHGLE)
\[\textit{SAHGLE} = \frac{\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\frac{\textbf{P}(i,j)i^2}{j^2}}} {\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\textbf{P}(i,j)}}\]SAHGLE measures the proportion in the image of the joint distribution of smaller size zones with higher graylevel values.

getLargeAreaLowGrayLevelEmphasisFeatureValue
()[source]¶ 15. Large Area Low Gray Level Emphasis (LALGLE)
\[\textit{LALGLE} = \frac{\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\frac{\textbf{P}(i,j)j^2}{i^2}}} {\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\textbf{P}(i,j)}}\]LALGLE measures the proportion in the image of the joint distribution of larger size zones with lower graylevel values.

getLargeAreaHighGrayLevelEmphasisFeatureValue
()[source]¶ 16. Large Area High Gray Level Emphasis (LAHGLE)
\[\textit{LAHGLE} = \frac{\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\textbf{P}(i,j)i^2j^2}} {\sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\textbf{P}(i,j)}}\]LAHGLE measures the proportion in the image of the joint distribution of larger size zones with higher graylevel values.
Gray Level Run Length Matrix (GLRLM) Features¶

class
radiomics.glrlm.
RadiomicsGLRLM
(inputImage, inputMask, **kwargs)[source]¶ Bases:
radiomics.base.RadiomicsFeaturesBase
A Gray Level Run Length Matrix (GLRLM) quantifies gray level runs, which are defined as the length in number of pixels, of consecutive pixels that have the same gray level value. In a gray level run length matrix \(\textbf{P}(i,j\theta)\), the \((i,j)^{\text{th}}\) element describes the number of runs with gray level \(i\) and length \(j\) occur in the image (ROI) along angle \(\theta\).
As a two dimensional example, consider the following 5x5 image, with 5 discrete gray levels:
\[\begin{split}\textbf{I} = \begin{bmatrix} 5 & 2 & 5 & 4 & 4\\ 3 & 3 & 3 & 1 & 3\\ 2 & 1 & 1 & 1 & 3\\ 4 & 2 & 2 & 2 & 3\\ 3 & 5 & 3 & 3 & 2 \end{bmatrix}\end{split}\]The GLRLM for \(\theta = 0\), where 0 degrees is the horizontal direction, then becomes:
\[\begin{split}\textbf{P} = \begin{bmatrix} 1 & 0 & 1 & 0 & 0\\ 3 & 0 & 1 & 0 & 0\\ 4 & 1 & 1 & 0 & 0\\ 1 & 1 & 0 & 0 & 0\\ 3 & 0 & 0 & 0 & 0 \end{bmatrix}\end{split}\]Let:
 \(\textbf{P}(i,j\theta)\) be the run length matrix for an arbitrary direction \(\theta\)
 \(p(i,j\theta)\) be the normalized run length matrix, defined as \(p(i,j\theta) = \frac{\textbf{P}(i,j\theta)}{\sum{\textbf{P}(i,j\theta)}}\)
 \(N_g\) be the number of discreet intensity values in the image
 \(N_r\) be the number of discreet run lengths in the image
 \(N_p\) be the number of voxels in the image
By default, the value of a feature is calculated on the GLRLM for each angle separately, after which the mean of these values is returned. If distance weighting is enabled, GLRLMs are weighted by the distance between neighbouring voxels and then summed and normalised. Features are then calculated on the resultant matrix. The distance between neighbouring voxels is calculated for each angle using the norm specified in ‘weightingNorm’.
The following class specific settings are possible:
weightingNorm [None]: string, indicates which norm should be used when applying distance weighting. Enumerated setting, possible values:
 ‘manhattan’: first order norm
 ‘euclidean’: second order norm
 ‘infinity’: infinity norm.
 ‘no_weighting’: GLCMs are weighted by factor 1 and summed
 None: Applies no weighting, mean of values calculated on separate matrices is returned.
In case of other values, an warning is logged and option ‘no_weighting’ is used.
References
 Galloway MM. 1975. Texture analysis using gray level run lengths. Computer Graphics and Image Processing, 4(2):172179.
 Chu A., Sehgal C.M., Greenleaf J. F. 1990. Use of gray value distribution of run length for texture analysis. Pattern Recognition Letters, 11(6):415419
 Xu D., Kurani A., Furst J., Raicu D. 2004. RunLength Encoding For Volumetric Texture. International Conference on Visualization, Imaging and Image Processing (VIIP), p. 452458
 Tang X. 1998. Texture information in runlength matrices. IEEE Transactions on Image Processing 7(11):16021609.
 Tustison N., Gee J. RunLength Matrices For Texture Analysis. Insight Journal 2008 January  June.

getShortRunEmphasisFeatureValue
()[source]¶ 1. Short Run Emphasis (SRE)
\[\textit{SRE} = \frac{\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\frac{\textbf{P}(i,j\theta)}{j^2}}} {\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)}}\]SRE is a measure of the distribution of short run lengths, with a greater value indicative of shorter run lengths and more fine textural textures.

getLongRunEmphasisFeatureValue
()[source]¶ 2. Long Run Emphasis (LRE)
\[\textit{LRE} = \frac{\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)j^2}} {\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)}}\]LRE is a measure of the distribution of long run lengths, with a greater value indicative of longer run lengths and more coarse structural textures.

getGrayLevelNonUniformityFeatureValue
()[source]¶ 3. Gray Level NonUniformity (GLN)
\[\textit{GLN} = \frac{\sum^{N_g}_{i=1}\left(\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)}\right)^2} {\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)}}\]GLN measures the similarity of graylevel intensity values in the image, where a lower GLN value correlates with a greater similarity in intensity values.

getGrayLevelNonUniformityNormalizedFeatureValue
()[source]¶ 4. Gray Level NonUniformity Normalized (GLNN)
\[\textit{GLNN} = \frac{\sum^{N_g}_{i=1}\left(\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)}\right)^2} {\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)}^2}\]GLNN measures the similarity of graylevel intensity values in the image, where a lower GLNN value correlates with a greater similarity in intensity values. This is the normalized version of the GLN formula.

getRunLengthNonUniformityFeatureValue
()[source]¶ 5. Run Length NonUniformity (RLN)
\[\textit{RLN} = \frac{\sum^{N_r}_{j=1}\left(\sum^{N_g}_{i=1}{\textbf{P}(i,j\theta)}\right)^2} {\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)}}\]RLN measures the similarity of run lengths throughout the image, with a lower value indicating more homogeneity among run lengths in the image.

getRunLengthNonUniformityNormalizedFeatureValue
()[source]¶ 6. Run Length NonUniformity Normalized (RLNN)
\[\textit{RLNN} = \frac{\sum^{N_r}_{j=1}\left(\sum^{N_g}_{i=1}{\textbf{P}(i,j\theta)}\right)^2} {\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)}}\]RLNN measures the similarity of run lengths throughout the image, with a lower value indicating more homogeneity among run lengths in the image. This is the normalized version of the RLN formula.

getRunPercentageFeatureValue
()[source]¶ 7. Run Percentage (RP)
\[\textit{RP} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_r}_{j=1}{\frac{\textbf{P}(i,j\theta)}{N_p}}\]RP measures the coarseness of the texture by taking the ratio of number of runs and number of voxels in the ROI.
Values are in range \(\frac{1}{N_p} \leq RP \leq 1\), with higher values indicating a larger portion of the ROI consists of short runs (indicates a more fine texture).
Note
Note that when weighting is applied and matrices are merged before calculation, \(N_p\) is multiplied by \(n\) number of matrices merged to ensure correct normalization (as each voxel is considered \(n\) times)

getGrayLevelVarianceFeatureValue
()[source]¶ 8. Gray Level Variance (GLV)
\[\textit{GLV} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_r}_{j=1}{p(i,j\theta)(i  \mu)^2}\]Here, \(\mu = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_r}_{j=1}{p(i,j\theta)i}\)
GLV measures the variance in gray level intensity for the runs.

getRunVarianceFeatureValue
()[source]¶ 9. Run Variance (RV)
\[\textit{RV} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_r}_{j=1}{p(i,j\theta)(j  \mu)^2}\]Here, \(\mu = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_r}_{j=1}{p(i,j\theta)j}\)
RV is a measure of the variance in runs for the run lengths.

getRunEntropyFeatureValue
()[source]¶ 10. Run Entropy (RE)
\[\textit{RE} = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_r}_{j=1} {p(i,j\theta)\log_{2}(p(i,j\theta)+\epsilon)}\]Here, \(\epsilon\) is an arbitrarily small positive number (\(\approx 2.2\times10^{16}\)).
RE measures the uncertainty/randomness in the distribution of run lengths and gray levels. A higher value indicates more heterogeneity in the texture patterns.

getLowGrayLevelRunEmphasisFeatureValue
()[source]¶ 11. Low Gray Level Run Emphasis (LGLRE)
\[\textit{LGLRE} = \frac{\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\frac{\textbf{P}(i,j\theta)}{i^2}}} {\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)}}\]LGLRE measures the distribution of low graylevel values, with a higher value indicating a greater concentration of low graylevel values in the image.

getHighGrayLevelRunEmphasisFeatureValue
()[source]¶ 12. High Gray Level Run Emphasis (HGLRE)
\[\textit{HGLRE} = \frac{\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)i^2}} {\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)}}\]HGLRE measures the distribution of the higher graylevel values, with a higher value indicating a greater concentration of high graylevel values in the image.

getShortRunLowGrayLevelEmphasisFeatureValue
()[source]¶ 13. Short Run Low Gray Level Emphasis (SRLGLE)
\[\textit{SRLGLE} = \frac{\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\frac{\textbf{P}(i,j\theta)}{i^2j^2}}} {\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)}}\]SRLGLE measures the joint distribution of shorter run lengths with lower graylevel values.

getShortRunHighGrayLevelEmphasisFeatureValue
()[source]¶ 14. Short Run High Gray Level Emphasis (SRHGLE)
\[\textit{SRHGLE} = \frac{\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\frac{\textbf{P}(i,j\theta)i^2}{j^2}}} {\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)}}\]SRHGLE measures the joint distribution of shorter run lengths with higher graylevel values.

getLongRunLowGrayLevelEmphasisFeatureValue
()[source]¶ 15. Long Run Low Gray Level Emphasis (LRLGLE)
\[\textit{LRLGLRE} = \frac{\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\frac{\textbf{P}(i,j\theta)j^2}{i^2}}} {\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)}}\]LRLGLRE measures the joint distribution of long run lengths with lower graylevel values.

getLongRunHighGrayLevelEmphasisFeatureValue
()[source]¶ 16. Long Run High Gray Level Emphasis (LRHGLE)
\[\textit{LRHGLRE} = \frac{\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)i^2j^2}} {\sum^{N_g}_{i=1}\sum^{N_r}_{j=1}{\textbf{P}(i,j\theta)}}\]LRHGLRE measures the joint distribution of long run lengths with higher graylevel values.
[1]  Zwanenburg, A., Leger, S., Vallières, M., and Löck, S. (2016). Image biomarker standardisation initiative  feature definitions. In eprint arXiv:1612.07003 [cs.CV] 