pyradiomics icon indicating copy to clipboard operation
pyradiomics copied to clipboard

[FEAT EXTRACTION] GLCM autocorrelation is always 1

Open Mojzaar opened this issue 2 years ago • 0 comments

I have a 3d numpy array as my image, and I want to calculate the GLCM across the entire image. As the autocorrelation value, the pipeline always returns 1. I get the same results if I use a random array as the image. What am I overlooking here? I've included the image and its mask for your convenience. (int8 images with size (16,128,128))

I use the following code to calculate the correlation matrix. `import radiomics

import SimpleITK as sitk

mask = np.random.rand(128,128,16)

mask[mask>0.5] = int(1)

mask[mask<=0.5] = int(0)

maks= mask.astype(bool)

imgm = sitk.GetImageFromArray(np.random.rand(128,128,16))

segm = sitk.GetImageFromArray(mask)

imgm.SetSpacing((0.1,0.1,0.1))

segm.SetSpacing((0.1,0.1,0.1))

glcmRF = radiomics.glcm.RadiomicsGLCM(imgm,segm)

P_glcm = glcmRF._calculateMatrix()

img-0439.zip `

Mojzaar avatar May 26 '22 21:05 Mojzaar