GLRLM_global_features - cerr/CERR GitHub Wiki

The feature definitions are available in IBSI section 3.7

Available Run-length features

1. Short Run Emphasis (SRE) measures the distribution of short runs. Higher value indicates fine textures.


2. Long Run Emphasis (LRE) measures the distribution of long runs. Higher value indicates coarse textures.


3. Gray Level Non-Uniformity (GLN) measure the distribution of runs over the gray values (Galloway, 1975). The feature value is low when runs are equally distributed along grey levels. Thus a lower value indicates higher similarity in intensity values.


4. Gray Level Non-Uniformity Normalized is a normalized version of the grey level non-uniformity feature


5. Run Length Non-Uniformity (RLN) measures the distribution of runs over the run lengths (Galloway, 1975). The feature value is low when runs are equally distributed along run lengths.


6. Run Length Non-Uniformity Normalized normalised version of the run length non-uniformity feature.


7. Run Percentage (RP) measures the fraction of the number of realized runs and the maximum number of potential runs (Galloway, 1975). Strongly linear or highly uniform ROI volumes produce a low run percentage.


8. Low Gray Level Run Emphasis (LGLRE)


9. High Gray Level Run Emphasis (HGLRE) is a grey level analogue to long runs emphasis. The feature emphasizes high grey levels


10. Short Run Low Gray Level Emphasis (SRLGLE) emphasizes runs in the upper left quadrant of the GLRLM, where short run lengths and low grey levels are located (Dasarathy and Holder, 1991).


11. Short Run High Gray Level Emphasis (SRHGLE) emphasises runs in the lower left quadrant of the GLRLM, where short run lengths and high grey levels are located (Dasarathy and Holder, 1991).


12. Long Run Low Gray Level Emphasis (LRLGLE) emphasises runs in the upper right quadrant of the GLRLM, where long run lengths and low grey levels are located (Dasarathy and Holder, 1991).


13. Long Run High Gray Level Emphasis (LRHGLE) emphasises runs in the lower right quadrant of the GLRLM, where long run lengths and high grey levels are located (Dasarathy and Holder, 1991).


14. Grey Level Variance measures the variance in runs for the grey levels.


15. Run Length Variance measures the variance in runs for run lengths.


where
is the total number of gray levels in the image.
is the total number of run lengths in the image.
is the total number of voxels in the image.
is the number of runs in the image in a particular direction.
is the run length matrix for a particular direction.
is the normalized run length matrix for a particular direction.

Calculation details

Let quantizedM be the discretized scan matrix. The number of voxels in the region of interest is calculated as

numVoxels = sum(~isnan(quantizedM(:)));

Now, let's build the run length matrix. The directional offsets can be obtained using the getOffsets function. The input argument to this function tells it to return 3-d or 2-d directional offsets. 13 offsets are computed for 3-d whereas 4 offsets are computed for the 2-d directionality based on the distance criteria of 1 voxel. Currently, the getOffsets function returns the directional offsets only for the distance criteria of 1 (immediate neighbors). In order to use the distance criteria other than 1, the user will have to provide the appropriate offsets.

dirFlag = 1; % 1: 3-d, 2: 2-d
offsetsM = getOffsets(dirFlag);

The run length matrix can be built separately or combined for each directional offset. The rlmType argument to the calcRLM function controls this.

rlmType= 2; % 1: combine, 2: separate GLCMs

The run length matrix is computed as follows:

rlmM = calcRLM(quantizedM, offsetsM, numGrLevels, rlmType);

rlmM is of size (numGrLevels*numRuns) x 1 for rlmType = 1, or a cell arrray of length size(offsetsM,1) containing the RLMs of size (numGrLevels*numRuns) for rlmType = 2, i.e. each element of cell array containing run length matrix for a row of offsetsM.

Generate flags for individual features

rlmFeatC = {'sre',    'lre',    'gln',    'glnNorm',    'rln',    'rlnNorm',    'rp',    'lglre',...
    'hglre',    'srlgle',    'srhgle',    'lrlgle',    'lrhgle',    'glv',    'rlv', 're'};
rlmFlagS = cell2struct(num2cell(ones(size(rlmFeatC))),rlmFeatC,2);

Finally, the scalar features from the RLM matrix are obtained as follows:

featureS = rlmToScalarFeatures(rlmM, numVoxels, rlmFlagS);

For rlmType = 2;, i.e. separate feature calculation per direction, the final feature can be obtained by combining the directional features using the following: average, maximum, minimum, standard deviation and mean absolute deviation. For example, to use the average from all directions:

featureReduceType = 'avg';
featureAvgS = reduceDirFeatures(featureS ,featureReduceType );
⚠️ **GitHub.com Fallback** ⚠️