pyradiomics icon indicating copy to clipboard operation
pyradiomics copied to clipboard

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

Open mligerhe opened this issue 3 years ago • 6 comments

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 avatar Dec 14 '21 11:12 mligerhe

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

JoostJM avatar Dec 14 '21 11:12 JoostJM

pyradiomics_testimages.zip

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

mligerhe avatar Dec 14 '21 13:12 mligerhe

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

md863 avatar Jan 28 '22 10:01 md863

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 avatar May 11 '22 11:05 llu025

⬆️ ⬆️ ⬆️

llu025 avatar Dec 02 '22 09:12 llu025

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.

ginagigo123 avatar May 02 '23 08:05 ginagigo123