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

[BUG] Segmentation fault (core dumped) in voxel-wise feature extraction #737

Open
mligerhe opened this issue Dec 14, 2021 · 6 comments
Open
Labels

Comments

@mligerhe
Copy link

mligerhe commented Dec 14, 2021

Describe the bug
When I try to run a voxel-wise feature extraction, I get the following error: 'Segmentation fault (core dumped)'.
It works with the same parameters and images when VoxelBased=False

PyRadiomics configuration
Bin size = 64
Resampling voxel size 4x4x4
Interpolation method B-spline
Radiomics features: GLDM and GLCM

PyRadiomics log file
log_file_errorpyradiomics.txt

To Reproduce
Execute the code

params = {}
params['binWidth'] = 64
params['resampledPixelSpacing'] = [4,4,4]
params['interpolator'] = 3
extractor = featureextractor.RadiomicsFeatureExtractor(**params)
extractor.disableAllFeatures()
extractor.enableFeatureClassByName('glcm')
voxel_result = extractor.execute(image1, mask, label = labels[0], voxelBased=True)

Expected behavior
Voxel-wise images of the different features from GLCM and GLDM matrices.

Version (please complete the following information):

  • OS: Linux
  • Python version: 3.7
  • PyRadiomics version 3.0.1
@mligerhe mligerhe added the bug label Dec 14, 2021
@JoostJM
Copy link
Collaborator

JoostJM commented Dec 14, 2021

Can you share a sample of the image/mask for debugging?

@mligerhe
Copy link
Author

pyradiomics_testimages.zip

Can you share a sample of the image/mask for debugging?
pyradiomics_testimages.zip

@md863
Copy link

md863 commented Jan 28, 2022

Hi, I'm encountering this same issue. Is there any update?
Thanks!

@llu025
Copy link

llu025 commented May 11, 2022

Same here with any first order feature extraction. It works like a charm with any other features (glcm, glrlm, etc.).

PyRadiomics configuration

imageType:
  Original: {}

featureClass:
  firstorder:
    - 'Minimum'

setting:
  normalize: true
  normalizeScale: 100
  binWidth: 25
  interpolator: 'sitkBSpline'
  resampledPixelSpacing: [1, 1, 1]
  correctMask: true
  voxelArrayShift: 300
  force2D: true
  force2Ddimension: 0

voxelSetting:
  kernelRadius: 1
  maskedKernel: true
  voxelBatch: 10000

To reproduce

extractor = featureextractor.RadiomicsFeatureExtractor(PRM_PATH)
features = extractor.execute(IMG, SEG, voxelBased=True)

Output

[1]    61328 segmentation fault  python3 main.py

Expected behavior

Working just fine

Version

  • OS: MacOS Monterey 12.3.1 (M1 chip)
  • Python version: 3.9.12
  • PyRadiomics version 3.0.1

@llu025
Copy link

llu025 commented Dec 2, 2022

⬆️ ⬆️ ⬆️

@ginagigo123
Copy link

ginagigo123 commented May 2, 2023

Hey Guys,
When I tried to extract the 3D image shaped (512, 512, 512), some of the images will trigger the segmentation fault error.
I thought the error will be triggered only when the voxels of segmentation exceed specific numbers due to memory limit.

So in my case, I added resampling to the image in yaml file and solved the problem.

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

5 participants