# When I set voxelBased=True and calculate the featureclass of glcm,I meet some problems

**URL:** https://discourse.slicer.org/t/when-i-set-voxelbased-true-and-calculate-the-featureclass-of-glcm-i-meet-some-problems/28418
**Category:** Radiomics
**Tags:** python, pyradiomics
**Created:** [March 16, 2023, 1:28pm UTC](https://discourse.slicer.org/t/when-i-set-voxelbased-true-and-calculate-the-featureclass-of-glcm-i-meet-some-problems/28418 "2023-03-16T13:28:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![duckfen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/duckfen/32/18800_2.png) [@duckfen](https://discourse.slicer.org/u/duckfen)
#### Post date: [March 16, 2023, 1:28pm UTC](https://discourse.slicer.org/t/when-i-set-voxelbased-true-and-calculate-the-featureclass-of-glcm-i-meet-some-problems/28418/1 "2023-03-16T13:28:39Z")

</div>

```auto
code:
extractor = featureextractor.RadiomicsFeatureExtractor('.yaml')
result = extractor.execute(image, mask, voxelBased=True)
for key, val in six.iteritems(result):
    if isinstance(val, sitk.Image):
        shape = (sitk.GetArrayFromImage(val)).shape
        print('feature_map shape is ', shape)
        sitk.WriteImage(val,r'C:\Users\feature'+'/'+key+'.nrrd', True)
yaml:
imageType:
    Wavelet: { } }
featureClass:
     glcm: ['ClusterProminence']
setting:
    binWidth: 40

```

I am currently working on radiomic feature extraction using voxel-based analysis with the parameter voxel-base=True. When I attempt to calculate features such as gldm and firstorder, everything runs smoothly. However, when I try to calculate the glcm feature, I encounter an error.

When I set the binWidth to a larger value, the program doesn’t output anything, and PyCharm displays the message “Process finished with exit code -1073741819 (0xC0000005).” Conversely, when I set the binWidth to a smaller value, I receive a MemoryError.

I’m wondering if this issue might be due to my computer’s limited memory (16GB). The size of my original image is 170_88_170, and the size of the tumor mask is 42_40_45.

Can anyone help me troubleshoot this problem and suggest a potential solution? Thank you in advance for your assistance!
