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 (13 features)
 Gray Level Cooccurrence Matrix (GLCM) Features (28 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.
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}\) denote the three dimensional image matrix with \(N\) voxels
\(\textbf{P}(i)\) the first order histogram with \(N_l\) discrete intensity levels, where \(N_l\) is defined by the number of levels, calculated based on 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.__

getEnergyFeatureValue
()[source]¶ Calculate the Energy of the image array.
\(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. This feature is volumeconfounded, a larger value of \(c\) increases the effect of volumeconfounding.

getTotalEnergyFeatureValue
()[source]¶ Calculate the Total Energy of the image array.
\(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. This feature is volumeconfounded, a larger value of \(c\) increases the effect of volumeconfounding.

getEntropyFeatureValue
()[source]¶ Calculate the Entropy of the image array.
\(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.

getMinimumFeatureValue
()[source]¶ Calculate the Minimum Value in the image array.
\(minimum = \min(\textbf{X})\)

getMaximumFeatureValue
()[source]¶ Calculate the Maximum Value in the image array.
\(maximum = \max(\textbf{X})\)

getMeanFeatureValue
()[source]¶ Calculate the Mean Value for the image array.
\(mean = \frac{1}{N}\displaystyle\sum^{N}_{i=1}{\textbf{X}(i)}\)

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

getRangeFeatureValue
()[source]¶ Calculate the Range of Values in the image array.
\(range = \max(\textbf{X})  \min(\textbf{X})\)

getMeanAbsoluteDeviationFeatureValue
()[source]¶ Calculate the Mean Absolute Deviation for the image array.
\(mean\ absolute\ deviation = \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]¶ Calculate the Robust Mean Absolute Deviation for the image array.
\(robust\ mean\ absolute\ deviation = \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]¶ Calculate the Root Mean Squared of the image array.
\(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]¶ Calculate the Standard Deviation of the image array.
\(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.

getSkewnessFeatureValue
(axis=0)[source]¶ Calculate the Skewness of the image array.
\(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:

getKurtosisFeatureValue
(axis=0)[source]¶ Calculate the Kurtosis of the image array.
\(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:

getVarianceFeatureValue
()[source]¶ Calculate the Variance in the image array.
\(variance = \sigma^2 = \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.

getUniformityFeatureValue
()[source]¶ Calculate the Uniformity of the image array.
\(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.
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 tumor region. Let in the following definitions denote \(V\) the volume (mm^{3}) and \(A\) the surface area of the volume (mm^{2}) of interest.

getSurfaceAreaFeatureValue
()[source]¶ Calculate the surface area of the tumor region in square millimeters using a marching cubes algorithm.
\(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\)

getSurfaceVolumeRatioFeatureValue
()[source]¶ Calculate the surface area to volume ratio of the tumor region
\(surface\ to\ volume\ ratio = \frac{A}{V}\)
Here, a lower value indicates a more compact (spherelike) shape.

getSphericityFeatureValue
()[source]¶ Calculate the Sphericity of the tumor region.
\(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\bin
folder, Compactness 1 and Compactness 2 are therefore disabled.

getCompactness1FeatureValue
()[source]¶ Calculate the compactness (1) of the tumor region.
\(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\bin
folder, Compactness 1 and Compactness 2 are therefore disabled.

getCompactness2FeatureValue
()[source]¶ Calculate the Compactness (2) of the tumor region.
\(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\bin
folder, Compactness 1 and Compactness 2 are therefore disabled.

getSphericalDisproportionFeatureValue
()[source]¶ Calculate the Spherical Disproportion of the tumor region.
\(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, Sphericity and Spherical Disproportion. In the default parameter file provided in the
pyradiomics\bin
folder, Compactness 1 and Compactness 2 are therefore disabled.

getMaximum3DDiameterFeatureValue
()[source]¶ Calculate the largest pairwise euclidean distance between tumor surface voxels. Also known as Feret Diameter.

getMaximum2DDiameterSliceFeatureValue
()[source]¶ Calculate the largest pairwise euclidean distance between tumor surface voxels in the rowcolumn plane.

getMaximum2DDiameterColumnFeatureValue
()[source]¶ Calculate the largest pairwise euclidean distance between tumor surface voxels in the rowslice plane.

getMaximum2DDiameterRowFeatureValue
()[source]¶ Calculate the largest pairwise euclidean distance between tumor surface voxels in the columnslice plane.

getElongationFeatureValue
()[source]¶ Calculate the elongation of the shape, which is defined as:
\[Elongation = \frac{\lambda_{\text{longest}}}{\lambda_{\text{intermediate}}}\]Here, \(\lambda_{\text{longest}}\) and \(\lambda_{\text{intermediate}}\) are the lengths of the largest and second largest principal component axes.
References:
 Andrey P, Kieu K, Kress C, Lehmann G, Tirichine L, Liu Z, et al. Statistical analysis of 3D images detects regular spatial distributions of centromeres and chromocenters in animal and plant nuclei. PLoS Comput Biol. 2010;6:27.

getFlatnessFeatureValue
()[source]¶ Calculate the flatness of the shape, which is defined as:
\[Flatness = \frac{\lambda_{\text{intermediate}}}{\lambda_{\text{shortest}}}\]Here, \(\lambda_{\text{intermediate}}\) and \(\lambda_{\text{shortest}}\) are the lengths of the second largest and smallest principal component axes.
References:
 Andrey P, Kieu K, Kress C, Lehmann G, Tirichine L, Liu Z, et al. Statistical analysis of 3D images detects regular spatial distributions of centromeres and chromocenters in animal and plant nuclei. PLoS Comput Biol. 2010;6:27.

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 in direction \(\alpha\), and \(N_g\) is the number of discrete gray level intensities. The distance \(\delta\) from the center voxel is defined as the distance according to the infinity norm. For \(\delta=1\), this assumes 26connectivity in 3D and for \(\delta=2\) a 98connectivity.
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) in directions \(\alpha=0^\circ\) and opposite \(\alpha=180^\circ\) (i.e., to the left and right from the pixel with the given value), 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}\displaystyle\sum^{N_g}_{j=1}{p(i,j)i}\)
\(\mu_y\) be the mean gray level intensity of \(p_y\) and defined as \(\mu_y = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{p(i,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]¶ Calculate and return the mean Autocorrelation.
\(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.

getAverageIntensityFeatureValue
()[source]¶ Return the mean gray level intensity of the \(i\) distribution.
\(\mu_x = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{p(i,j)i}\)
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]¶ Using coefficients \(\mu_x\) and \(\mu_y\), calculate and return the mean Cluster Prominence.
\(cluster\ prominence = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{\big( i+j\mu_x(i)\mu_y(j)\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]¶ Using coefficients \(\mu_x\) and \(\mu_y\), calculate and return the mean Cluster Shade.
\(cluster\ shade = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{\big(i+j\mu_x(i)\mu_y(j)\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]¶ Using coefficients \(\mu_x\) and \(\mu_y\), calculate and return the mean Cluster Tendency.
\(cluster\ tendency = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{\big(i+j\mu_x(i)\mu_y(j)\big)^2p(i,j)}\)
Cluster Tendency is a measure of groupings of voxels with similar graylevel values.

getContrastFeatureValue
()[source]¶ Using the squared difference between gray values of neighbouring paris, calculate and return the mean Contrast.
\(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 \(P(i,j)\) values away from the diagonal \((i = j)\). A larger value correlates with a greater disparity in intensity values among neighboring voxels.

getCorrelationFeatureValue
()[source]¶ Using coefficients \(\mu_x\), \(\mu_y\), \(\sigma_x\) and \(\sigma_y\), calculate and return the mean Correlation.
\(correlation = \frac{\sum^{N_g}_{i=1}\sum^{N_g}_{j=1}{p(i,j)ij\mu_x(i)\mu_y(j)}}{\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.

getDifferenceAverageFeatureValue
()[source]¶ Using coefficient \(p_{xy}\), calculate and return the mean Difference Average.
\(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]¶ Using coefficient \(p_{xy}\), calculate and return the mean Difference Entropy.
\(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]¶ Using coefficients \(p_{xy}\) and DifferenceAverage (DA) calculate and return the mean Difference Variance.
\(difference\ variance = \displaystyle\sum^{N_g1}_{k=0}{(1DA)^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]¶ Calculate and return the mean Dissimilarity.
\(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.

getEnergyFeatureValue
()[source]¶ Calculate and return the mean Energy.
\(energy = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_g}_{j=1}{\big(p(i,j)\big)^2}\)
Energy (or Angular Second Moment)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.

getEntropyFeatureValue
()[source]¶ Calculate and return the mean Entropy.
\(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.

getHomogeneity1FeatureValue
()[source]¶ Calculate and return the mean Homogeneity 1.
\(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.

getHomogeneity2FeatureValue
()[source]¶ Calculate and return the mean Homogeneity 2.
\(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.

getImc1FeatureValue
()[source]¶ Using coefficients \(HX\), \(HY\), \(HXY\) and \(HXY1\), calculate and return the mean Informal Measure of Correlation 1.
\(IMC\ 1 = \frac{HXYHXY1}{\max\{HX,HY\}}\)

getImc2FeatureValue
()[source]¶ Using coefficients \(HXY\) and \(HXY2\), calculate and return the mean Informal Measure of Correlation 2.
\(IMC\ 2 = \sqrt{1e^{2(HXY2HXY)}}\)

getIdmFeatureValue
()[source]¶ Calculate and return the mean Inverse Difference Moment.
\(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]¶ Calculate and return the mean Inverse Difference Moment Normalized.
\(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]¶ Calculate and return the mean Inverse Difference.
\(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]¶ Calculate and return the mean Inverse Difference Normalized.
\(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]¶ Calculate and return the mean Inverse Variance.
\(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]¶ Calculate and return the mean Maximum Probability.
\(maximum\ probability = \max\big(p(i,j)\big)\)
Maximum Probability is occurrences of the most predominant pair of neighboring intensity values.

getSumAverageFeatureValue
()[source]¶ Coefficient \(p_{x+y}\), calculate and return the mean Sum Average.
\(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.

getSumEntropyFeatureValue
()[source]¶ Using coefficient \(p_{x+y}\), calculate and return the mean Sum Entropy.
\(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.

getSumVarianceFeatureValue
()[source]¶ Using coefficients \(p_{x+y}\) and SumEntropy (SE) calculate and return the mean Sum Variance.
\(sum\ variance = \displaystyle\sum^{2N_g}_{k=2}{(kSE)^2p_{x+y}(k)}\)
Sum Variance is a measure of heterogeneity that places higher weights on neighboring intensity level pairs that deviate more from the mean.

getSumVariance2FeatureValue
()[source]¶ Using coefficients \(p_{x+y}\) and SumAvarage (SA) calculate and return the mean Sum Variance 2. \(sum\ variance\ 2 = \displaystyle\sum^{2N_g}_{k=2}{(kSA)^2p_{x+y}(k)}\)
Sum Variance 2 is a measure of heterogeneity that places higher weights on neighboring intensity level pairs that deviate more from the mean.
This formula differs from SumVariance in that instead of subtracting the SumEntropy from the intensity, it subtracts the SumAvarage, which is the mean of intensities and not its entropy

getSumSquaresFeatureValue
()[source]¶ Using coefficients \(i\) and \(\mu_x\), calculate and return the mean Sum of Squares (also known as Variance) of the \(i\) distribution.
\(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\)
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. This yields a 26connected region in a 3D image, and an 8connected region in a 2D image. In a gray level size zone matrix \(P(i,j)\) the \((i,j)^{\text{th}}\) element describes the number of times a gray level zone with gray level \(i\) and size \(j\) appears in image.
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
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]¶ Calculate and return the Small Area Emphasis (SAE) value.
\(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)}}\)
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]¶ Calculate and return the Large Area Emphasis (LAE) value.
\(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)}}\)
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]¶ Calculate and return the Gray Level NonUniformity (GLN) value.
\(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)}}\)
Measures the variability of graylevel intensity values in the image, with a lower value indicating more homogeneity in intensity values.

getGrayLevelNonUniformityNormalizedFeatureValue
()[source]¶ Calculate and return the Gray Level NonUniformity Normalized (GLNN) value.
\(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}\)
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]¶ Calculate and return the SizeZone NonUniformity (SZN) value.
\(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)}}\)
Measures the variability of size zone volumes in the image, with a lower value indicating more homogeneity in size zone volumes.

getSizeZoneNonUniformityNormalizedFeatureValue
()[source]¶ Calculate and return the SizeZone NonUniformity Normalized (SZNN) value.
\(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}\)
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]¶ Calculate and return the Zone Percentage (ZP) value.
\(ZP = \sum^{N_g}_{i=1}\sum^{N_s}_{j=1}{\frac{\textbf{P}(i,j)}{N_p}}\)
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]¶ Calculate and return the Gray Level Variance (GLV) value.
\(GLV = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_s}_{j=1}{p(i,j)(i  \mu)^2}\), where
\(\mu = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_s}_{j=1}{p(i,j)i}\)
Measures the variance in gray level intensities for the zones.

getZoneVarianceFeatureValue
()[source]¶ Calculate and return the Zone Variance (ZV) value.
\(ZV = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_s}_{j=1}{p(i,j)(j  \mu)^2}\), where
\(\mu = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_s}_{j=1}{p(i,j)j}\)
Measures the variance in zone size volumes for the zones.

getZoneEntropyFeatureValue
()[source]¶ Calculate and return the Zone Entropy (ZE) value.
\(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}\)).
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]¶ Calculate and return the Low Gray Level Zone Emphasis (LGLZE) value.
\(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)}}\)
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]¶ Calculate and return the High Gray Level Zone Emphasis (HGLZE) value.
\(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)}}\)
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]¶ Calculate and return the Small Area Low Gray Level Emphasis (SALGLE) value.
\(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)}}\)
Measures the proportion in the image of the joint distribution of smaller size zones with lower graylevel values.

getSmallAreaHighGrayLevelEmphasisFeatureValue
()[source]¶ Calculate and return the Small Area High Gray Level Emphasis (SAHGLE) value.
\(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)}}\)
Measures the proportion in the image of the joint distribution of smaller size zones with higher graylevel values.

getLargeAreaLowGrayLevelEmphasisFeatureValue
()[source]¶ Calculate and return the Large Area Low Gray Level Emphasis (LALGLE) value.
\(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)}}\)
Measures the proportion in the image of the joint distribution of larger size zones with lower graylevel values.

getLargeAreaHighGrayLevelEmphasisFeatureValue
()[source]¶ Calculate and return the Large Area High Gray Level Emphasis (LAHGLE) value.
\(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)}}\)
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 in an image. A gray level run is 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 times a gray level \(i\) appears consecutively \(j\) times in the direction specified by \(\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]¶ Calculate and return the mean Short Run Emphasis (SRE) value for all GLRLMs.
\(SRE = \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)}}\)
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]¶ Calculate and return the mean Long Run Emphasis (LRE) value for all GLRLMs.
\(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)}}\)
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]¶ Calculate and return the mean Gray Level NonUniformity (GLN) value for all GLRLMs.
\(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)}}\)
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]¶ Calculate and return the Gray Level NonUniformity Normalized (GLNN) value.
\(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}\)
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]¶ Calculate and return the mean Run Length NonUniformity (RLN) value for all GLRLMs.
\(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)}}\)
Measures the similarity of run lengths throughout the image, with a lower value indicating more homogeneity among run lengths in the image.

getRunLengthNonUniformityNormalizedFeatureValue
()[source]¶ Calculate and return the mean Run Length NonUniformity Normalized (RLNN) value for all GLRLMs.
\(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)}}\)
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]¶ Calculate and return the mean Run Percentage (RP) value for all GLRLMs.
\(RP = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_r}_{j=1}{\frac{\textbf{P}(i,j\theta)}{N_p}}\)
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).

getGrayLevelVarianceFeatureValue
()[source]¶ Calculate and return the Gray Level Variance (GLV) value.
\(GLV = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_r}_{j=1}{p(i,j\theta)(i  \mu)^2}\), where
\(\mu = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_r}_{j=1}{p(i,j\theta)i}\)
Measures the variance in gray level intensity for the runs.

getRunVarianceFeatureValue
()[source]¶ Calculate and return the Run Variance (RV) value.
\(RV = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_r}_{j=1}{p(i,j\theta)(j  \mu)^2}\), where
\(\mu = \displaystyle\sum^{N_g}_{i=1}\displaystyle\sum^{N_r}_{j=1}{p(i,j\theta)j}\)
Measures the variance in runs for the run lengths.

getRunEntropyFeatureValue
()[source]¶ Calculate and return the Run Entropy (RE) value.
\(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}\)).

getLowGrayLevelRunEmphasisFeatureValue
()[source]¶ Calculate and return the mean Low Gray Level Run Emphasis (LGLRE) value for all GLRLMs.
\(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)}}\)
Measures the distribution of low graylevel values, with a higher value indicating a greater concentration of low graylevel values in the image.

getHighGrayLevelRunEmphasisFeatureValue
()[source]¶ Calculate and return the mean High Gray Level Run Emphasis (HGLRE) value for all GLRLMs.
\(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)}}\)
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]¶ Calculate and return the mean Short Run Low Gray Level Emphasis (SRLGLE) value for all GLRLMs.
\(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)}}\)
Measures the joint distribution of shorter run lengths with lower graylevel values.

getShortRunHighGrayLevelEmphasisFeatureValue
()[source]¶ Calculate and return the mean Short Run High Gray Level Emphasis (SRHGLE) value for all GLRLMs.
\(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)}}\)
Measures the joint distribution of shorter run lengths with higher graylevel values.

getLongRunLowGrayLevelEmphasisFeatureValue
()[source]¶ Calculate and return the mean Long Run Low Gray Level Emphasis (LRLGLE) value for all GLRLMs.
\(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)}}\)
Measures the joint distribution of long run lengths with lower graylevel values.

getLongRunHighGrayLevelEmphasisFeatureValue
()[source]¶ Calculate and return the mean Long Run High Gray Level Emphasis (LRHGLE) value for all GLRLMs.
\(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)}}\)
Measures the joint distribution of long run lengths with higher graylevel values.