AIM-Harvard/pyradiomics

I believe the sample calculation for GLCM in the pyradiomics document is incorrect

Opened this issue · 0 comments

A Gray Level Co-occurrence Matrix (GLCM) of size Ng×Ng
describes the second-order joint probability function of an image region constrained by the mask and is defined as P(i,j|δ,θ)
. The (i,j)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 δ
pixels along angle θ
. The distance δ
from the center voxel is defined as the distance according to the infinity norm. For δ=1
, this results in 2 neighbors for each of 13 angles in 3D (26-connectivity) and for δ=2
a 98-connectivity (49 unique angles).

Note that pyradiomics by default computes symmetrical GLCM!

As a two dimensional example, let the following matrix I
represent a 5x5 image, having 5 discrete grey levels:

I=⎡⎣⎢⎢⎢⎢⎢⎢1311122312515142351331225⎤⎦⎥⎥⎥⎥⎥⎥
For distance δ=1
(considering pixels with a distance of 1 pixel from each other) and angle θ=0∘
(horizontal plane, i.e. voxels to the left and right of the center voxel), the following symmetrical GLCM is obtained:

P=⎡⎣⎢⎢⎢⎢⎢⎢6430040213320120110003202⎤⎦⎥⎥⎥⎥⎥⎥
Let: