Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sajadamiri19921400 opened this issue Nov 26, 2024 · 0 comments
Labels

Comments

@sajadamiri19921400
Copy link

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant