AIM-Harvard / pyradiomics

Open-source python package for the extraction of Radiomics features from 2D and 3D images and binary masks. Support: https://discourse.slicer.org/c/community/radiomics
http://pyradiomics.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.17k stars 497 forks source link

[FEAT EXTRACTION] #674

Closed htc-htc closed 2 years ago

htc-htc commented 3 years ago

Hi, I'm new to extracting radiomics features with this library. I'm trying to extract radiomics features from PET images, however for a few of the images, I got a segmentation fault (core dumped) error while extracting using the command line. Below are my log file and environment.

PyRadiomics log file [2021-01-15 22:00:02] D: radiomics.script: Logging initialized [2021-01-15 22:00:02] I: radiomics.script: Starting PyRadiomics (version: v3.0.1) [2021-01-15 22:00:02] I: radiomics.script: Processing input... [2021-01-15 22:00:02] D: radiomics.script: Loading batch file "batch1.csv" [2021-01-15 22:00:02] D: radiomics.script: No overrides found [2021-01-15 22:00:02] I: radiomics.featureextractor: Loading parameter file params.yaml [2021-01-15 22:00:02] D: radiomics.featureextractor: Parameters parsed, input is valid. [2021-01-15 22:00:02] D: radiomics.featureextractor: Applying settings [2021-01-15 22:00:02] D: radiomics.featureextractor: Enabled image types: {'Original': {}} [2021-01-15 22:00:02] D: radiomics.featureextractor: Enabled features: {'firstorder': None, 'glcm': None, 'gldm': None, 'glrlm': None, 'glszm': None, 'ngtdm': None} [2021-01-15 22:00:02] D: radiomics.featureextractor: Settings: {'binWidth': 25} [2021-01-15 22:00:02] I: radiomics.script: Input valid, starting sequential extraction from 1 case(s)... [2021-01-15 22:00:02] I: radiomics.script: Processing case 1 [2021-01-15 22:00:02] I: radiomics.featureextractor: Starting voxel based extraction [2021-01-15 22:00:02] I: radiomics.featureextractor: Calculating features with label: 2 [2021-01-15 22:00:02] D: radiomics.featureextractor: Enabled images types: {'Original': {}} [2021-01-15 22:00:02] D: radiomics.featureextractor: Enabled features: {'firstorder': None, 'glcm': None, 'gldm': None, 'glrlm': None, 'glszm': None, 'ngtdm': None} [2021-01-15 22:00:02] D: radiomics.featureextractor: Current settings: {'minimumROIDimensions': 2, 'minimumROISize': None, 'normalize': False, 'normalizeScale': 1, 'removeOutliers': None, 'resampledPixelSpacing': None, 'interpolator': 'sitkBSpline', 'preCrop': False, 'padDistance': 5, 'distances': [1], 'force2D': False, 'force2Ddimension': 0, 'resegmentRange': None, 'label': 2, 'additionalInfo': True, 'binWidth': 25, 'kernelRadius': 2, 'maskedKernel': True, 'initValue': -1, 'voxelBatch': 10000, 'voxelBased': True} [2021-01-15 22:00:02] I: radiomics.featureextractor: Loading image and mask [2021-01-15 22:00:02] D: radiomics.imageoperations: Force casting mask to UInt32 to ensure correct datatype. [2021-01-15 22:00:02] D: radiomics.imageoperations: Checking mask with label 2 [2021-01-15 22:00:02] D: radiomics.imageoperations: Calculating bounding box [2021-01-15 22:00:02] D: radiomics.imageoperations: Checking minimum number of dimensions requirements (2) [2021-01-15 22:00:02] D: radiomics.featureextractor: Image and Mask loaded and valid, starting extraction [2021-01-15 22:00:02] D: radiomics.featureextractor: Creating image type iterator [2021-01-15 22:00:02] I: radiomics.featureextractor: Adding image type "Original" with custom settings: {} [2021-01-15 22:00:02] D: radiomics.featureextractor: Extracting features [2021-01-15 22:00:02] D: radiomics.imageoperations: Yielding original image [2021-01-15 22:00:02] I: radiomics.featureextractor: Calculating features for original image [2021-01-15 22:00:02] D: radiomics.imageoperations: Cropping to size [168 118 59] [2021-01-15 22:00:02] I: radiomics.featureextractor: Computing firstorder [2021-01-15 22:00:02] D: radiomics.firstorder: Initializing feature class [2021-01-15 22:00:02] D: radiomics.imageoperations: Discretizing gray levels inside ROI [2021-01-15 22:00:02] D: radiomics.imageoperations: Calculated 179 bins for bin width 25 with edges: [ 425. 450. 475. 500. 525. 550. 575. 600. 625. 650. 675. 700.

                      1. 1000.
                        1. 1300.
                        1. 1600.
                        1. 1900.
                        1. 2200.
                        1. 2500.
                        1. 2800.
                        1. 3100.
                        1. 3400.
                        1. 3700.
                        1. 4000.
                        1. 4300.
                        1. 4600.
                        1. 4900.]) [2021-01-15 22:00:02] D: radiomics.firstorder: Calculating voxel batch no. 1/65 [2021-01-15 22:00:04] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:00:04] D: radiomics.firstorder: Calculating features [2021-01-15 22:00:10] D: radiomics.firstorder: Calculating voxel batch no. 2/65 [2021-01-15 22:00:12] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:00:12] D: radiomics.firstorder: Calculating features [2021-01-15 22:00:17] D: radiomics.firstorder: Calculating voxel batch no. 3/65 [2021-01-15 22:00:19] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:00:19] D: radiomics.firstorder: Calculating features [2021-01-15 22:00:24] D: radiomics.firstorder: Calculating voxel batch no. 4/65 [2021-01-15 22:00:26] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:00:26] D: radiomics.firstorder: Calculating features [2021-01-15 22:00:31] D: radiomics.firstorder: Calculating voxel batch no. 5/65 [2021-01-15 22:00:33] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:00:33] D: radiomics.firstorder: Calculating features [2021-01-15 22:00:38] D: radiomics.firstorder: Calculating voxel batch no. 6/65 [2021-01-15 22:00:40] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:00:40] D: radiomics.firstorder: Calculating features [2021-01-15 22:00:45] D: radiomics.firstorder: Calculating voxel batch no. 7/65 [2021-01-15 22:00:47] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:00:47] D: radiomics.firstorder: Calculating features [2021-01-15 22:00:51] D: radiomics.firstorder: Calculating voxel batch no. 8/65 [2021-01-15 22:00:53] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:00:53] D: radiomics.firstorder: Calculating features [2021-01-15 22:00:58] D: radiomics.firstorder: Calculating voxel batch no. 9/65 [2021-01-15 22:01:00] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:01:00] D: radiomics.firstorder: Calculating features [2021-01-15 22:01:05] D: radiomics.firstorder: Calculating voxel batch no. 10/65 [2021-01-15 22:01:07] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:01:07] D: radiomics.firstorder: Calculating features [2021-01-15 22:01:12] D: radiomics.firstorder: Calculating voxel batch no. 11/65 [2021-01-15 22:01:14] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:01:14] D: radiomics.firstorder: Calculating features [2021-01-15 22:01:19] D: radiomics.firstorder: Calculating voxel batch no. 12/65 [2021-01-15 22:01:21] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:01:21] D: radiomics.firstorder: Calculating features [2021-01-15 22:01:26] D: radiomics.firstorder: Calculating voxel batch no. 13/65 [2021-01-15 22:01:28] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:01:28] D: radiomics.firstorder: Calculating features [2021-01-15 22:01:33] D: radiomics.firstorder: Calculating voxel batch no. 14/65 [2021-01-15 22:01:35] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:01:35] D: radiomics.firstorder: Calculating features [2021-01-15 22:01:39] D: radiomics.firstorder: Calculating voxel batch no. 15/65 [2021-01-15 22:01:41] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:01:41] D: radiomics.firstorder: Calculating features [2021-01-15 22:01:46] D: radiomics.firstorder: Calculating voxel batch no. 16/65 [2021-01-15 22:01:48] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:01:48] D: radiomics.firstorder: Calculating features [2021-01-15 22:01:53] D: radiomics.firstorder: Calculating voxel batch no. 17/65 [2021-01-15 22:01:55] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:01:55] D: radiomics.firstorder: Calculating features [2021-01-15 22:02:00] D: radiomics.firstorder: Calculating voxel batch no. 18/65 [2021-01-15 22:02:02] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:02:02] D: radiomics.firstorder: Calculating features [2021-01-15 22:02:07] D: radiomics.firstorder: Calculating voxel batch no. 19/65 [2021-01-15 22:02:09] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:02:09] D: radiomics.firstorder: Calculating features [2021-01-15 22:02:14] D: radiomics.firstorder: Calculating voxel batch no. 20/65 [2021-01-15 22:02:16] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:02:16] D: radiomics.firstorder: Calculating features [2021-01-15 22:02:21] D: radiomics.firstorder: Calculating voxel batch no. 21/65 [2021-01-15 22:02:23] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:02:23] D: radiomics.firstorder: Calculating features [2021-01-15 22:02:27] D: radiomics.firstorder: Calculating voxel batch no. 22/65 [2021-01-15 22:02:29] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:02:29] D: radiomics.firstorder: Calculating features [2021-01-15 22:02:34] D: radiomics.firstorder: Calculating voxel batch no. 23/65 [2021-01-15 22:02:36] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:02:36] D: radiomics.firstorder: Calculating features [2021-01-15 22:02:41] D: radiomics.firstorder: Calculating voxel batch no. 24/65 [2021-01-15 22:02:43] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:02:43] D: radiomics.firstorder: Calculating features [2021-01-15 22:02:48] D: radiomics.firstorder: Calculating voxel batch no. 25/65 [2021-01-15 22:02:50] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:02:50] D: radiomics.firstorder: Calculating features [2021-01-15 22:02:55] D: radiomics.firstorder: Calculating voxel batch no. 26/65 [2021-01-15 22:02:57] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:02:57] D: radiomics.firstorder: Calculating features [2021-01-15 22:03:01] D: radiomics.firstorder: Calculating voxel batch no. 27/65 [2021-01-15 22:03:04] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:03:04] D: radiomics.firstorder: Calculating features [2021-01-15 22:03:08] D: radiomics.firstorder: Calculating voxel batch no. 28/65 [2021-01-15 22:03:10] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:03:10] D: radiomics.firstorder: Calculating features [2021-01-15 22:03:15] D: radiomics.firstorder: Calculating voxel batch no. 29/65 [2021-01-15 22:03:17] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:03:17] D: radiomics.firstorder: Calculating features [2021-01-15 22:03:22] D: radiomics.firstorder: Calculating voxel batch no. 30/65 [2021-01-15 22:03:24] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:03:24] D: radiomics.firstorder: Calculating features [2021-01-15 22:03:29] D: radiomics.firstorder: Calculating voxel batch no. 31/65 [2021-01-15 22:03:31] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:03:31] D: radiomics.firstorder: Calculating features [2021-01-15 22:03:36] D: radiomics.firstorder: Calculating voxel batch no. 32/65 [2021-01-15 22:03:38] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:03:38] D: radiomics.firstorder: Calculating features [2021-01-15 22:03:42] D: radiomics.firstorder: Calculating voxel batch no. 33/65 [2021-01-15 22:03:45] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:03:45] D: radiomics.firstorder: Calculating features [2021-01-15 22:03:49] D: radiomics.firstorder: Calculating voxel batch no. 34/65 [2021-01-15 22:03:51] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:03:51] D: radiomics.firstorder: Calculating features [2021-01-15 22:03:56] D: radiomics.firstorder: Calculating voxel batch no. 35/65 [2021-01-15 22:03:58] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:03:58] D: radiomics.firstorder: Calculating features [2021-01-15 22:04:03] D: radiomics.firstorder: Calculating voxel batch no. 36/65 [2021-01-15 22:04:05] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:04:05] D: radiomics.firstorder: Calculating features [2021-01-15 22:04:10] D: radiomics.firstorder: Calculating voxel batch no. 37/65 [2021-01-15 22:04:12] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:04:12] D: radiomics.firstorder: Calculating features [2021-01-15 22:04:17] D: radiomics.firstorder: Calculating voxel batch no. 38/65 [2021-01-15 22:04:19] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:04:19] D: radiomics.firstorder: Calculating features [2021-01-15 22:04:24] D: radiomics.firstorder: Calculating voxel batch no. 39/65 [2021-01-15 22:04:26] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:04:26] D: radiomics.firstorder: Calculating features [2021-01-15 22:04:30] D: radiomics.firstorder: Calculating voxel batch no. 40/65 [2021-01-15 22:04:32] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:04:32] D: radiomics.firstorder: Calculating features [2021-01-15 22:04:37] D: radiomics.firstorder: Calculating voxel batch no. 41/65 [2021-01-15 22:04:39] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:04:39] D: radiomics.firstorder: Calculating features [2021-01-15 22:04:44] D: radiomics.firstorder: Calculating voxel batch no. 42/65 [2021-01-15 22:04:46] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:04:46] D: radiomics.firstorder: Calculating features [2021-01-15 22:04:51] D: radiomics.firstorder: Calculating voxel batch no. 43/65 [2021-01-15 22:04:53] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:04:53] D: radiomics.firstorder: Calculating features [2021-01-15 22:04:58] D: radiomics.firstorder: Calculating voxel batch no. 44/65 [2021-01-15 22:05:00] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:05:00] D: radiomics.firstorder: Calculating features [2021-01-15 22:05:04] D: radiomics.firstorder: Calculating voxel batch no. 45/65 [2021-01-15 22:05:07] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:05:07] D: radiomics.firstorder: Calculating features [2021-01-15 22:05:11] D: radiomics.firstorder: Calculating voxel batch no. 46/65 [2021-01-15 22:05:13] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:05:13] D: radiomics.firstorder: Calculating features [2021-01-15 22:05:18] D: radiomics.firstorder: Calculating voxel batch no. 47/65 [2021-01-15 22:05:20] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:05:20] D: radiomics.firstorder: Calculating features [2021-01-15 22:05:25] D: radiomics.firstorder: Calculating voxel batch no. 48/65 [2021-01-15 22:05:27] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:05:27] D: radiomics.firstorder: Calculating features [2021-01-15 22:05:32] D: radiomics.firstorder: Calculating voxel batch no. 49/65 [2021-01-15 22:05:34] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:05:34] D: radiomics.firstorder: Calculating features [2021-01-15 22:05:39] D: radiomics.firstorder: Calculating voxel batch no. 50/65 [2021-01-15 22:05:41] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:05:41] D: radiomics.firstorder: Calculating features [2021-01-15 22:05:46] D: radiomics.firstorder: Calculating voxel batch no. 51/65 [2021-01-15 22:05:48] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:05:48] D: radiomics.firstorder: Calculating features [2021-01-15 22:05:52] D: radiomics.firstorder: Calculating voxel batch no. 52/65 [2021-01-15 22:05:54] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:05:54] D: radiomics.firstorder: Calculating features [2021-01-15 22:05:59] D: radiomics.firstorder: Calculating voxel batch no. 53/65 [2021-01-15 22:06:01] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:06:01] D: radiomics.firstorder: Calculating features [2021-01-15 22:06:06] D: radiomics.firstorder: Calculating voxel batch no. 54/65 [2021-01-15 22:06:08] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:06:08] D: radiomics.firstorder: Calculating features [2021-01-15 22:06:13] D: radiomics.firstorder: Calculating voxel batch no. 55/65 [2021-01-15 22:06:15] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:06:15] D: radiomics.firstorder: Calculating features [2021-01-15 22:06:20] D: radiomics.firstorder: Calculating voxel batch no. 56/65 [2021-01-15 22:06:22] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:06:22] D: radiomics.firstorder: Calculating features [2021-01-15 22:06:27] D: radiomics.firstorder: Calculating voxel batch no. 57/65 [2021-01-15 22:06:29] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:06:29] D: radiomics.firstorder: Calculating features [2021-01-15 22:06:33] D: radiomics.firstorder: Calculating voxel batch no. 58/65 [2021-01-15 22:06:35] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:06:35] D: radiomics.firstorder: Calculating features [2021-01-15 22:06:40] D: radiomics.firstorder: Calculating voxel batch no. 59/65 [2021-01-15 22:06:42] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:06:42] D: radiomics.firstorder: Calculating features [2021-01-15 22:06:47] D: radiomics.firstorder: Calculating voxel batch no. 60/65 [2021-01-15 22:06:49] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:06:49] D: radiomics.firstorder: Calculating features [2021-01-15 22:06:54] D: radiomics.firstorder: Calculating voxel batch no. 61/65 [2021-01-15 22:06:56] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:06:56] D: radiomics.firstorder: Calculating features [2021-01-15 22:07:01] D: radiomics.firstorder: Calculating voxel batch no. 62/65 [2021-01-15 22:07:03] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:07:03] D: radiomics.firstorder: Calculating features [2021-01-15 22:07:08] D: radiomics.firstorder: Calculating voxel batch no. 63/65 [2021-01-15 22:07:10] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:07:10] D: radiomics.firstorder: Calculating features [2021-01-15 22:07:15] D: radiomics.firstorder: Calculating voxel batch no. 64/65 [2021-01-15 22:07:17] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:07:17] D: radiomics.firstorder: Calculating features [2021-01-15 22:07:22] D: radiomics.firstorder: Calculating voxel batch no. 65/65 [2021-01-15 22:07:22] D: radiomics.firstorder: First order feature class initialized [2021-01-15 22:07:22] D: radiomics.firstorder: Calculating features [2021-01-15 22:07:24] I: radiomics.featureextractor: Computing glcm [2021-01-15 22:07:24] D: radiomics.glcm: Initializing feature class [2021-01-15 22:07:24] D: radiomics.imageoperations: Discretizing gray levels inside ROI [2021-01-15 22:07:24] D: radiomics.imageoperations: Calculated 179 bins for bin width 25 with edges: [ 425. 450. 475. 500. 525. 550. 575. 600. 625. 650. 675. 700.
                      1. 1000.
                        1. 1300.
                        1. 1600.
                        1. 1900.
                        1. 2200.
                        1. 2500.
                        1. 2800.
                        1. 3100.
                        1. 3400.
                        1. 3700.
                        1. 4000.
                        1. 4300.
                        1. 4600.
                        1. 4900.]) [2021-01-15 22:07:24] D: radiomics.glcm: Calculating voxel batch no. 1/65 [2021-01-15 22:07:24] D: radiomics.glcm: Calculating GLCM matrix in C

Version (please complete the following information):

JoostJM commented 3 years ago

Can you share an (anonymized) image and mask causing you this error? I cannot see what is causing the error and would need the input to debug.

JoostJM commented 2 years ago

likely related to #737